diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-12-18 12:54:25 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-12-18 12:54:25 +0000 |
| commit | 5da5f464180147ff1c28db495dc13149c79f4060 (patch) | |
| tree | 677e193b7459a5894539fca92c6bdeca1ddb7318 /frontends/php | |
| parent | 653533cb7714ecaab944eb1b483f20f6e14a3858 (diff) | |
| download | zabbix-5da5f464180147ff1c28db495dc13149c79f4060.tar.gz zabbix-5da5f464180147ff1c28db495dc13149c79f4060.tar.xz zabbix-5da5f464180147ff1c28db495dc13149c79f4060.zip | |
- [DEV-88] duplicated entry "Login" removed (Artem)
- [ZBX-208] fixes related to html parse (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5191 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
| -rw-r--r-- | frontends/php/css.css | 9 | ||||
| -rw-r--r-- | frontends/php/include/locales/en_gb.inc.php | 3 | ||||
| -rw-r--r-- | frontends/php/include/page_header.php | 74 | ||||
| -rw-r--r-- | frontends/php/include/services.inc.php | 29 | ||||
| -rw-r--r-- | frontends/php/srv_status.php | 21 | ||||
| -rw-r--r-- | frontends/php/styles/div.css | 18 |
6 files changed, 76 insertions, 78 deletions
diff --git a/frontends/php/css.css b/frontends/php/css.css index 9320953f..8159aee1 100644 --- a/frontends/php/css.css +++ b/frontends/php/css.css @@ -22,15 +22,6 @@ body{ } -/********** REQUIREMENTS TABLE *************/ -span.ok{ - color: green; - font-weight: bold; -} -span.fail{ - color: red; - font-weight: bold; -} /**************** OTHERS ****************/ .top { vertical-align: top; } diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php index 80fa4bff..9ca9d8c4 100644 --- a/frontends/php/include/locales/en_gb.inc.php +++ b/frontends/php/include/locales/en_gb.inc.php @@ -1093,6 +1093,9 @@ 'S_DELETE_SLIDESHOW_Q'=> 'Delete slideshow?', // services.php + 'S_AVERAGE_PROBLEM'=> 'Average problem', + 'S_SERIOUS_PROBLEM'=> 'Serious problem', + 'S_MINOR_PROBLEM'=> 'Minor problem', 'S_ROOT_SMALL'=> 'root', 'S_IT_SERVICE'=> 'IT service', 'S_IT_SERVICES'=> 'IT services', diff --git a/frontends/php/include/page_header.php b/frontends/php/include/page_header.php index 21b9e70a..5162c3c9 100644 --- a/frontends/php/include/page_header.php +++ b/frontends/php/include/page_header.php @@ -225,38 +225,42 @@ COpt::profiling_start("page"); $deny = true; } - if(isset($sub['node_perm'])) - { + if(isset($sub['node_perm'])){ if ( 0 == count(get_accessible_nodes_by_user( - $USER_DETAILS,$sub['node_perm'],null, - PERM_RES_IDS_ARRAY,get_current_nodeid(false)))) - $deny = true; + $USER_DETAILS, + $sub['node_perm'], + null, + PERM_RES_IDS_ARRAY, + get_current_nodeid(false)))) + { + $deny = true; + } } - if($label=='login') - { - unset($deny); + if($label=='login'){ + $deny = true; +/* if(isset($USER_DETAILS['sessionid'])) + $sub['label'] = S_LOGOUT; + else + unset($deny); +*/ } } // End of main menu permissions checking unset($menu_url); - foreach($sub['pages'] as $id => $sub_pages) - { - if(!defined('ZBX_PAGE_NO_AUTHERIZATION')) - { - if(isset($sub_pages['user_type'])) - { - if($USER_DETAILS['type'] < $sub_pages['user_type']) - { + foreach($sub['pages'] as $id => $sub_pages){ + + if(!defined('ZBX_PAGE_NO_AUTHERIZATION')){ + if(isset($sub_pages['user_type'])){ + if($USER_DETAILS['type'] < $sub_pages['user_type']){ unset($sub['pages'][$id]); continue; } } - if(isset($sub_pages['node_perm'])) - { + if(isset($sub_pages['node_perm'])){ if ( 0 == count(get_accessible_nodes_by_user( $USER_DETAILS,$sub_pages['node_perm'],null, PERM_RES_IDS_ARRAY,get_current_nodeid(false)))) @@ -269,21 +273,17 @@ COpt::profiling_start("page"); if(isset($page_exist)) continue; - if($page['file'] == $sub_pages['url']) - { - if(isset($sub_pages['label'])) - { + if($page['file'] == $sub_pages['url']){ + if(isset($sub_pages['label'])){ $menu_url = $sub_pages['url']; } + $page_exist = true; $sub['pages'][$id]['active'] = true; /* mark as active */ } - else if(isset($sub_pages['sub_pages'])) - { - if(in_array($page['file'], $sub_pages['sub_pages'])) - { - if(isset($sub_pages['label'])) - { + else if(isset($sub_pages['sub_pages'])){ + if(in_array($page['file'], $sub_pages['sub_pages'])){ + if(isset($sub_pages['label'])){ $menu_url = $sub_pages['url']; } $page_exist = true; @@ -293,27 +293,23 @@ COpt::profiling_start("page"); if ( isset($page_exist) && ( isset($sub['forse_disable_subnodes']) || isset($sub_pages['forse_disable_subnodes']) ) && - !defined('ZBX_DISABLE_SUBNODES') - ) + !defined('ZBX_DISABLE_SUBNODES')) { define('ZBX_DISABLE_SUBNODES', 1); } } - if(isset($menu_url)) /* active menu */ - { + if(isset($menu_url)){ /* active menu */ $class = "active"; update_profile('web.menu.'.$label.'.last', $menu_url); - if(isset($deny)) - { + if(isset($deny)){ $denyed_page_requested = true; continue; } - foreach($sub['pages'] as $sub_pages) - { + foreach($sub['pages'] as $sub_pages){ if(!isset($sub_pages['label'])) continue; $label = new CLink($sub_pages['label'], $sub_pages['url'],'highlight'); @@ -325,8 +321,7 @@ COpt::profiling_start("page"); ); } } - else - { + else{ if(isset($deny)) continue; $class = "horizontal_menu_n"; @@ -341,8 +336,7 @@ COpt::profiling_start("page"); unset($menu_url, $class); } - if((!isset($page_exist) && $page['type']!=PAGE_TYPE_XML)) - { + if((!isset($page_exist) && $page['type']!=PAGE_TYPE_XML)){ $denyed_page_requested = true; } diff --git a/frontends/php/include/services.inc.php b/frontends/php/include/services.inc.php index 8f4e484a..b1b7f782 100644 --- a/frontends/php/include/services.inc.php +++ b/frontends/php/include/services.inc.php @@ -570,30 +570,25 @@ $dt = 0; return $sla_time; } - function get_service_status_description($status) - { - $desc='<font color="#00AA00">OK</a>'; + function get_service_status_description($status){ + $desc=new CSpan(S_OK_BIG,'green'); if($status==5) { - $desc='<div class="disaster">Disaster</div>'; + $desc=new CTag('div','yes',S_DISASTER,'disaster'); } - elseif($status==4) - { - $desc='<div class="high">Serious'.SPACE.'problem</div> '; + else if($status==4){ + $desc=new CTag('div','yes',S_SERIOUS_PROBLEM,'high'); } - elseif($status==3) - { - $desc='<div class="average">Average'.SPACE.'problem</div> '; + else if($status==3){ + $desc=new CTag('div','yes',S_AVERAGE_PROBLEM,'average'); } - elseif($status==2) - { - $desc='<div class="warning">Minor'.SPACE.'problem</div> '; + else if($status==2){ + $desc=new CTag('div','yes',S_MINOR_PROBLEM,'warning'); } - elseif($status==1) - { - $desc='<font color="#00AA00">OK</font>'; + else if($status==1){ + $desc=new CSpan(S_OK_BIG,'green'); } - return $desc; + return $desc; } function get_num_of_service_childs($serviceid) diff --git a/frontends/php/srv_status.php b/frontends/php/srv_status.php index 95459265..c0cb224c 100644 --- a/frontends/php/srv_status.php +++ b/frontends/php/srv_status.php @@ -111,7 +111,7 @@ include_once "include/page_header.php"; if(isset($row["triggerid"]) && !empty($row["triggerid"])){ $url = new CLink(expand_trigger_description($row['triggerid']),'tr_events.php?triggerid='.$row['triggerid']); - $row['caption'] = $row['caption'].SPACE.'['.$url->ToString().']'; + $row['caption'] = array($row['caption'].' [',$url,']'); } @@ -144,13 +144,12 @@ include_once "include/page_header.php"; $stat = calculate_service_availability($row["serviceid"],$period_start,$period_end); if($row["goodsla"] > $stat["ok"]){ - $color="AA0000"; + $sla_style='red'; } else { - $color="00AA00"; + $sla_style='green'; } - $row['sla2'] = sprintf("<font color=\"#00AA00\">%.2f%%</font><b>/</b><font color=\"#%s\">%.2f%%</font>", - $row["goodsla"], $color,$stat["ok"]); + $row['sla2'] = array(new CSpan(round($row["goodsla"],3),'green'),'/', new CSpan(round($stat["ok"],3),$sla_style)); } else { $row['sla']= "-"; $row['sla2']= "-"; @@ -176,12 +175,12 @@ include_once "include/page_header.php"; //permission issue $treeServ = del_empty_nodes($treeServ); - $tree = new CTree($treeServ,array('caption' => '<b>'.S_SERVICE.'</b>', - 'status' => '<b>'.S_STATUS.'</b>', - 'reason' => '<b>'.S_REASON.'</b>', - 'sla' => '<b>'.S_SLA_LAST_7_DAYS.'</b>', - 'sla2' => '<b>'.nbsp(S_PLANNED_CURRENT_SLA).'</b>', - 'graph' => '<b>'.S_GRAPH.'</b>')); + $tree = new CTree($treeServ,array('caption' => bold(S_SERVICE), + 'status' => bold(S_STATUS), + 'reason' => bold(S_REASON), + 'sla' => bold(S_SLA_LAST_7_DAYS), + 'sla2' => bold(nbsp(S_PLANNED_CURRENT_SLA)), + 'graph' => bold(S_GRAPH))); if($tree){ echo $tree->CreateJS(); diff --git a/frontends/php/styles/div.css b/frontends/php/styles/div.css index 47d269c8..b77ecb38 100644 --- a/frontends/php/styles/div.css +++ b/frontends/php/styles/div.css @@ -36,4 +36,20 @@ span.divider{ font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: normal; -}
\ No newline at end of file +} + +/********** REQUIREMENTS TABLE *************/ +span.ok{ + color: #00AA00; + font-weight: bold; +} +span.fail{ + color: #AA0000; + font-weight: bold; +} +span.green{ + color: #00AA00; +} +span.red{ + color: #AA0000; +} |
