diff options
author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-11-05 12:14:03 +0000 |
---|---|---|
committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-11-05 12:14:03 +0000 |
commit | 4ca1f91b93ebdf892377410a0f1f64ca5db2c194 (patch) | |
tree | 52b05b962227b640cc76e54e0b9a714c0e0427b1 /frontends/php/overview.php | |
parent | a15d9da563de55c96eb08f52dad5ac805f21e3d3 (diff) | |
download | zabbix-4ca1f91b93ebdf892377410a0f1f64ca5db2c194.tar.gz zabbix-4ca1f91b93ebdf892377410a0f1f64ca5db2c194.tar.xz zabbix-4ca1f91b93ebdf892377410a0f1f64ca5db2c194.zip |
- [DEV-60] added availability of setting hosts view style in overview & screens (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@4974 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/overview.php')
-rw-r--r-- | frontends/php/overview.php | 75 |
1 files changed, 40 insertions, 35 deletions
diff --git a/frontends/php/overview.php b/frontends/php/overview.php index 992c57d9..ea699341 100644 --- a/frontends/php/overview.php +++ b/frontends/php/overview.php @@ -17,62 +17,56 @@ ** along with this program; if not, write to the Free Software ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. **/ -?> -<?php - require_once "include/config.inc.php"; - require_once "include/hosts.inc.php"; - require_once "include/triggers.inc.php"; - require_once "include/items.inc.php"; - $page["title"] = "S_OVERVIEW"; - $page["file"] = "overview.php"; - $page['hist_arg'] = array('groupid','type'); +require_once "include/config.inc.php"; +require_once "include/hosts.inc.php"; +require_once "include/triggers.inc.php"; +require_once "include/items.inc.php"; - define('ZBX_PAGE_DO_REFRESH', 1); +$page["title"] = "S_OVERVIEW"; +$page["file"] = "overview.php"; +$page['hist_arg'] = array('groupid','type'); + +define('ZBX_PAGE_DO_REFRESH', 1); include_once "include/page_header.php"; -?> -<?php - define("SHOW_TRIGGERS",0); - define("SHOW_DATA",1); +define("SHOW_TRIGGERS",0); +define("SHOW_DATA",1); - if(isset($_REQUEST["select"])&&($_REQUEST["select"]!="")) - { - unset($_REQUEST["groupid"]); - unset($_REQUEST["hostid"]); - } -?> -<?php +if(isset($_REQUEST["select"])&&($_REQUEST["select"]!="")) +{ + unset($_REQUEST["groupid"]); + unset($_REQUEST["hostid"]); +} // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION $fields=array( - "groupid"=> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), - "type"=> array(T_ZBX_INT, O_OPT, P_SYS, IN("0,1"), NULL) + 'groupid'=> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), + 'view_style'=> array(T_ZBX_INT, O_OPT, P_SYS, IN("0,1"), NULL), + 'type'=> array(T_ZBX_INT, O_OPT, P_SYS, IN("0,1"), NULL) ); check_fields($fields); - + + $_REQUEST['view_style'] = get_request('view_style',get_profile('web.overview.view.style',STYLE_TOP)); + update_profile('web.overview.view.style',$_REQUEST['view_style']); + validate_group(PERM_READ_ONLY,array("allow_all_hosts","monitored_hosts","with_monitored_items")); -?> -<?php - $_REQUEST["type"] = get_request("type",get_profile("web.overview.type",SHOW_TRIGGERS)); + $_REQUEST["type"] = get_request("type",get_profile("web.overview.type",SHOW_TRIGGERS)); update_profile("web.overview.type",$_REQUEST["type"]); -?> -<?php + $form = new CForm(); $form->SetMethod('get'); $cmbGroup = new CComboBox("groupid",$_REQUEST["groupid"],"submit()"); $cmbGroup->AddItem(0,S_ALL_SMALL); - if($_REQUEST["type"] == SHOW_TRIGGERS) - { + if($_REQUEST["type"] == SHOW_TRIGGERS){ $from = ", functions f, triggers t"; $where = " and i.itemid=f.itemid and f.triggerid=t.triggerid and t.status=".TRIGGER_STATUS_ENABLED; } - else - { + else{ $where = $from = ''; } @@ -102,10 +96,10 @@ include_once "include/page_header.php"; $help = new CHelp('web.view.php','left'); $help_table = new CTableInfo(); $help_table->AddOption('style', 'width: 200px'); - if($_REQUEST["type"]==SHOW_TRIGGERS) - { + if($_REQUEST["type"]==SHOW_TRIGGERS){ $help_table->AddRow(array(new CCol(SPACE, 'normal'), S_DISABLED)); } + foreach(array(1,2,3,4,5) as $tr_severity) $help_table->AddRow(array(new CCol(get_severity_description($tr_severity),get_severity_style($tr_severity)),S_ENABLED)); $help_table->AddRow(array(new CCol(SPACE, 'unknown_trigger'), S_UNKNOWN)); @@ -129,6 +123,17 @@ include_once "include/page_header.php"; $help->SetHint($help_table); show_table_header(array($help, S_OVERVIEW_BIG), $form); unset($help, $help_table, $form, $col); + + $form = new CForm(); + $form->SetMethod('get'); + + $cmbStyle = new CComboBox("view_style",$_REQUEST["view_style"],"submit()"); + $cmbStyle->AddItem(STYLE_TOP,S_TOP); + $cmbStyle->AddItem(STYLE_LEFT,S_LEFT); + + $form->Additem(array(S_HOSTS_LOCATION.SPACE,$cmbStyle)); + + show_table_header($form, NULL); ?> <?php |