diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-05-06 09:13:51 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-05-06 09:13:51 +0000 |
| commit | 8465ff8a0e531247f41f4d3c7b3b1cbe03643974 (patch) | |
| tree | 11a89a3bea5b2720cd839a7a2455d4d47caf9815 /frontends/php/include | |
| parent | 37085eb0c73b06780c4f3a34f82693d04a1c2596 (diff) | |
- [DEV-137] fixes to GUI (Artem) big thanks to Palmertree
git-svn-id: svn://svn.zabbix.com/trunk@5677 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
| -rw-r--r-- | frontends/php/include/blocks.inc.php | 4 | ||||
| -rw-r--r-- | frontends/php/include/classes/clink.inc.php | 38 | ||||
| -rw-r--r-- | frontends/php/include/page_footer.php | 12 | ||||
| -rw-r--r-- | frontends/php/include/page_header.php | 1 | ||||
| -rw-r--r-- | frontends/php/include/perm.inc.php | 2 | ||||
| -rw-r--r-- | frontends/php/include/profiles.inc.php | 21 |
6 files changed, 50 insertions, 28 deletions
diff --git a/frontends/php/include/blocks.inc.php b/frontends/php/include/blocks.inc.php index c3809ccf..c685acc8 100644 --- a/frontends/php/include/blocks.inc.php +++ b/frontends/php/include/blocks.inc.php @@ -177,7 +177,7 @@ function make_system_summary(){ $config=select_config(); $available_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY,PERM_RES_IDS_ARRAY); - $available_triggers = get_accessible_triggers(PERM_READ_LIST,PERM_RES_DATA_ARRAY); + $available_triggers = get_accessible_triggers(PERM_READ_LIST,PERM_RES_IDS_ARRAY); $table = new CTableInfo(); $table->SetHeader(array( @@ -666,7 +666,7 @@ return $table; function make_webmon_overview(){ global $USER_DETAILS; - $available_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY,PERM_RES_DATA_ARRAY); + $available_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY,PERM_RES_IDS_ARRAY); $table = new CTableInfo(); $table->SetHeader(array( diff --git a/frontends/php/include/classes/clink.inc.php b/frontends/php/include/classes/clink.inc.php index 04c5ebd1..bea460e3 100644 --- a/frontends/php/include/classes/clink.inc.php +++ b/frontends/php/include/classes/clink.inc.php @@ -22,39 +22,43 @@ class CLink extends CTag { /* public */ - function CLink($item=NULL,$url=NULL,$class=NULL,$action=NULL) - { - parent::CTag("a","yes"); + function CLink($item=NULL,$url=NULL,$class=NULL,$action=NULL){ + parent::CTag('a','yes'); - $this->tag_start= ""; - $this->tag_end = ""; - $this->tag_body_start = ""; - $this->tag_body_end = ""; + $this->tag_start= ''; + $this->tag_end = ''; + $this->tag_body_start = ''; + $this->tag_body_end = ''; if(!is_null($class)) $this->SetClass($class); if(!is_null($item)) $this->AddItem($item); if(!is_null($url)) $this->SetUrl($url); if(!is_null($action)) $this->SetAction($action); } - function SetAction($value=NULL) - { + + function SetAction($value=NULL){ if(is_null($value)) return $this->options['action'] = $page['file']; return parent::AddAction('onclick', $value); } - function SetUrl($value) - { + + function SetUrl($value){ $this->AddOption('href', $value); } - function SetTarget($value=NULL) - { - if(is_null($value)) - { + + function getUrl(){ + if(isset($this->options['href'])) + return $this->options['href']; + else + return null; + } + + function SetTarget($value=NULL){ + if(is_null($value)){ unset($this->options['target']); } - else - { + else{ $this->options['target'] = $value; } } diff --git a/frontends/php/include/page_footer.php b/frontends/php/include/page_footer.php index 65731903..47fd861f 100644 --- a/frontends/php/include/page_footer.php +++ b/frontends/php/include/page_footer.php @@ -25,15 +25,14 @@ global $page; global $ZBX_PAGE_POST_JS; - if(!defined('PAGE_HEADER_LOADED')) - { + if(!defined('PAGE_HEADER_LOADED')){ define ('PAGE_HEADER_LOADED', 1); } - + + add_user_history($page); show_messages(); - if($page['type'] == PAGE_TYPE_HTML) - { + if($page['type'] == PAGE_TYPE_HTML){ ?> <script language="JavaScript" type="text/javascript"> <!-- @@ -50,8 +49,7 @@ function zbxCallPostScripts(){ </script> <?php - if(!defined('ZBX_PAGE_NO_MENU') && !defined('ZBX_PAGE_NO_FOOTER')) - { + if(!defined('ZBX_PAGE_NO_MENU') && !defined('ZBX_PAGE_NO_FOOTER')){ $table = new CTable(NULL,"page_footer"); $table->SetCellSpacing(0); $table->SetCellPadding(1); diff --git a/frontends/php/include/page_header.php b/frontends/php/include/page_header.php index ac919dd6..858dd33c 100644 --- a/frontends/php/include/page_header.php +++ b/frontends/php/include/page_header.php @@ -558,7 +558,6 @@ COpt::compare_files_with_menu($ZBX_MENU); $table->SetCellPadding(0); $history = get_user_history(); - add_user_history($page); $tr = new CRow(new CCol('History:','caption')); $tr->AddItem($history); diff --git a/frontends/php/include/perm.inc.php b/frontends/php/include/perm.inc.php index 5cf3ae64..e4301a6b 100644 --- a/frontends/php/include/perm.inc.php +++ b/frontends/php/include/perm.inc.php @@ -58,7 +58,7 @@ $incorect_session = true; } else if($login['attempt_failed']){ - error('There was ['.$login['attempt_failed'].'] failed attempts to Login from ['.$login['attempt_ip'].'] at ['.date('d.m.Y H:nn',$login['attempt_clock']).'] o\'clock!'); + error('There was ['.$login['attempt_failed'].'] failed attempts to Login from ['.$login['attempt_ip'].'] at ['.date('d.m.Y H:i',$login['attempt_clock']).'] o\'clock!'); DBexecute('UPDATE users SET attempt_failed=0 WHERE userid='.zbx_dbstr($login['userid'])); } } diff --git a/frontends/php/include/profiles.inc.php b/frontends/php/include/profiles.inc.php index 885b6361..7bb9f159 100644 --- a/frontends/php/include/profiles.inc.php +++ b/frontends/php/include/profiles.inc.php @@ -255,6 +255,27 @@ function get_user_history(){ return $history; } +function get_last_history_page($same_page=false){ + global $page; + $title = explode('[',$page['title']); + $title = $title[0]; + + $rows=false; + for($i = 0; $i < ZBX_HISTORY_COUNT; $i++){ + $new_rows = get_multi_profile('web.history.'.$i,false,PROFILE_TYPE_MULTI); + + if(!$same_page && ($title == $new_rows['value'])) continue; + $rows = $new_rows; + } + + if(is_array($rows)){ + $rows['page'] = $rows['value']; + $rows['url'] = $rows['value2']; + } + +return $rows; +} + // Author: Aly function add_user_history($page){ |
