当前位置: 首页>>代码示例>>PHP>>正文


PHP CForm::AddItem方法代码示例

本文整理汇总了PHP中CForm::AddItem方法的典型用法代码示例。如果您正苦于以下问题:PHP CForm::AddItem方法的具体用法?PHP CForm::AddItem怎么用?PHP CForm::AddItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CForm的用法示例。


在下文中一共展示了CForm::AddItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: DBend

                $result &= delete_sysmap($mapid);
                if (!$result) {
                    break;
                }
            }
            $result = DBend($result);
            if ($result) {
                unset($_REQUEST["form"]);
            }
            show_messages($result, S_MAP_DELETED, S_CANNOT_DELETE_MAP);
        }
    }
}
$form = new CForm();
$form->SetMethod('get');
$form->AddItem(new CButton("form", S_CREATE_MAP));
show_table_header(S_CONFIGURATION_OF_NETWORK_MAPS, $form);
echo SBR;
if (isset($_REQUEST["form"])) {
    insert_map_form();
} else {
    $form = new CForm();
    $form->setName('frm_maps');
    $numrows = new CSpan(null, 'info');
    $numrows->setAttribute('name', 'numrows');
    $header = get_table_header(array(S_MAPS_BIG, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows));
    show_table_header($header);
    $table = new CTableInfo(S_NO_MAPS_DEFINED);
    $table->SetHeader(array(new CCheckBox('all_maps', NULL, "checkAll('" . $form->getName() . "','all_maps','maps');"), make_sorting_link(S_NAME, 'sm.name'), make_sorting_link(S_WIDTH, 'sm.width'), make_sorting_link(S_HEIGHT, 'sm.height'), S_MAP));
    $result = DBselect('SELECT sm.sysmapid,sm.name,sm.width,sm.height ' . ' FROM sysmaps sm' . ' WHERE ' . DBin_node('sm.sysmapid') . order_by('sm.name,sm.width,sm.height', 'sm.sysmapid'));
    while ($row = DBfetch($result)) {
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:sysmaps.php

示例2: array

                $users_id = array();
                $db_users = DBselect('SELECT DISTINCT u.alias,u.userid ' . ' FROM users u,users_groups ug ' . ' WHERE u.userid=ug.userid ' . ' AND ug.usrgrpid=' . $row['usrgrpid'] . ' ORDER BY u.alias');
                while ($db_user = DBfetch($db_users)) {
                    if (!empty($users)) {
                        $users[$db_user['userid']][] = ', ';
                    } else {
                        $users[$db_user['userid']] = array();
                    }
                    $users[$db_user['userid']][] = new Clink($db_user['alias'], 'users.php?form=update&config=0&userid=' . $db_user['userid'] . '#form');
                }
                $gui_access = user_auth_type2str($row['gui_access']);
                $users_status = $row['users_status'] == GROUP_STATUS_ENABLED ? S_ENABLED : S_DISABLED;
                if (granted2update_group($row['usrgrpid'])) {
                    $next_gui_auth = $row['gui_access'] + 1 > GROUP_GUI_ACCESS_DISABLED ? GROUP_GUI_ACCESS_SYSTEM : $row['gui_access'] + 1;
                    $gui_access = new CLink($gui_access, 'users.php?form=update' . '&set_gui_access=' . $next_gui_auth . '&usrgrpid=' . $row['usrgrpid'] . url_param('config'), $row['gui_access'] == GROUP_GUI_ACCESS_DISABLED ? 'orange' : 'enabled');
                    $users_status = new CLink($users_status, 'users.php?form=update' . '&set_users_status=' . ($row['users_status'] == GROUP_STATUS_ENABLED ? GROUP_STATUS_DISABLED : GROUP_STATUS_ENABLED) . '&usrgrpid=' . $row['usrgrpid'] . url_param('config'), $row['users_status'] == GROUP_STATUS_ENABLED ? 'enabled' : 'disabled');
                } else {
                    $gui_access = new CSpan($gui_access, $row['gui_access'] == GROUP_GUI_ACCESS_DISABLED ? 'orange' : 'green');
                    $users_status = new CSpan($users_status, $row['users_status'] == GROUP_STATUS_ENABLED ? 'green' : 'red');
                }
                $table->addRow(array($users_status, $gui_access, array(new CCheckBox('group_groupid[' . $row['usrgrpid'] . ']', NULL, NULL, $row['usrgrpid']), $alias = new CLink($row['name'], 'users.php?form=update' . url_param('config') . '&usrgrpid=' . $row['usrgrpid'] . '#form', 'action')), new CCol($users, 'wraptext')));
                $row_count++;
            }
            $table->SetFooter(new CCol(new CButtonQMessage('delete_selected', S_DELETE_SELECTED, S_DELETE_SELECTED_GROUPS_Q)));
            $form->AddItem($table);
            $form->Show();
        }
    }
}
zbx_add_post_js('insert_in_element("numrows","' . $row_count . '");');
include_once 'include/page_footer.php';
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:users.php

示例3: CForm

    $cmbHosts->addItem($hostid, get_node_name_by_elid($hostid) . $name);
}
$r_form->addItem(array(S_GROUP . SPACE, $cmbGroup));
$r_form->addItem(array(SPACE . S_HOST . SPACE, $cmbHosts));
$sql_from = '';
$sql_where = '';
if ($_REQUEST['groupid'] > 0) {
    $sql_from .= ',hosts_groups hg ';
    $sql_where .= ' AND hg.hostid=h.hostid AND hg.groupid=' . $_REQUEST['groupid'];
}
//---
$l_form = new CForm();
$l_form->SetMethod('get');
$l_form->addVar('groupid', $_REQUEST['groupid']);
$l_form->addVar('hostid', $_REQUEST['hostid']);
$l_form->AddItem(array(S_SHOW_ITEMS_WITH_DESCRIPTION_LIKE, new CTextBox('select', $_REQUEST['select'], 20)));
$l_form->AddItem(array(SPACE, new CButton('show', S_SHOW, 'javascript: submit();')));
//	$l_form->AddItem(array(SPACE, new CButton('show',S_SHOW,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."',this.form);")));
$p_elements[] = get_table_header($l_form, $r_form);
//-------------
validate_sort_and_sortorder('i.description', ZBX_SORT_UP);
$_REQUEST['groupbyapp'] = get_request('groupbyapp', get_profile('web.latest.groupbyapp', 1));
update_profile('web.latest.groupbyapp', $_REQUEST['groupbyapp'], PROFILE_TYPE_INT);
$_REQUEST['applications'] = get_request('applications', get_profile('web.latest.applications', array(), PROFILE_TYPE_ARRAY_ID));
if (isset($_REQUEST['open'])) {
    if (!isset($_REQUEST['applicationid'])) {
        $_REQUEST['applications'] = array();
        $show_all_apps = 1;
    } else {
        if (!uint_in_array($_REQUEST['applicationid'], $_REQUEST['applications'])) {
            array_push($_REQUEST['applications'], $_REQUEST['applicationid']);
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:latest.php

示例4: CForm

    /* form */
    insert_drule_form();
} else {
    show_table_header(S_DISCOVERY_BIG);
    /* table */
    $form = new CForm();
    $form->SetName('frmdrules');
    $tblDiscovery = new CTableInfo(S_NO_DISCOVERY_RULES_DEFINED);
    $tblDiscovery->SetHeader(array(array(new CCheckBox('all_drules', null, "CheckAll('" . $form->GetName() . "','all_drules');"), make_sorting_link(S_NAME, 'd.name')), make_sorting_link(S_IP_RANGE, 'd.iprange'), make_sorting_link(S_DELAY, 'd.delay'), S_CHECKS, S_STATUS));
    $db_rules = DBselect('SELECT d.* ' . ' FROM drules d' . ' WHERE ' . DBin_node('druleid') . order_by('d.name,d.iprange,d.delay', 'd.druleid'));
    while ($rule_data = DBfetch($db_rules)) {
        $cheks = array();
        $db_checks = DBselect("select * from dchecks where druleid=" . $rule_data["druleid"] . " order by type,druleid");
        while ($check_data = DBfetch($db_checks)) {
            $cheks[] = discovery_check_type2str($check_data['type']);
        }
        $status = new CCol(new CLink(discovery_status2str($rule_data["status"]), '?g_druleid%5B%5D=' . $rule_data['druleid'] . ($rule_data["status"] == DRULE_STATUS_ACTIVE ? '&group_disable=1' : '&group_enable=1'), discovery_status2style($rule_data["status"])));
        $description = array();
        if ($rule_data["proxy_hostid"]) {
            $proxy = get_host_by_hostid($rule_data["proxy_hostid"]);
            array_push($description, $proxy["host"], ":");
        }
        array_push($description, new CLink($rule_data['name'], "?form=update&druleid=" . $rule_data['druleid'], 'action'));
        $drule = new CCol(array(new CCheckBox('g_druleid[' . $rule_data["druleid"] . ']', null, null, $rule_data["druleid"]), SPACE, $description));
        $tblDiscovery->AddRow(array($drule, $rule_data['iprange'], $rule_data['delay'], implode(',', $cheks), $status));
    }
    $tblDiscovery->SetFooter(new CCol(array(new CButtonQMessage('group_enable', S_ENABLE_SELECTED, S_ENABLE_SELECTED_RULES_Q), SPACE, new CButtonQMessage('group_disable', S_DISABLE_SELECTED, S_DISABLE_SELECTED_RULES_Q), SPACE, new CButtonQMessage('group_delete', S_DELETE_SELECTED, S_DELETE_SELECTED_RULES_Q))));
    $form->AddItem($tblDiscovery);
    $form->Show();
}
include_once "include/page_footer.php";
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:discoveryconf.php

示例5: array

include_once "include/page_header.php";
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array("year" => array(T_ZBX_INT, O_OPT, P_SYS | P_NZERO, NULL, NULL), "period" => array(T_ZBX_STR, O_OPT, P_SYS | P_NZERO, IN('"dayly","weekly","monthly","yearly"'), NULL), "media_type" => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL));
check_fields($fields);
$year = get_request("year", intval(date("Y")));
$period = get_request("period", "weekly");
$media_type = get_request("media_type", 0);
if (($min_time = DBfetch(DBselect('select min(clock) as clock from alerts'))) && $min_time['clock']) {
    $MIN_YEAR = intval(date("Y", $min_time['clock']));
}
if (!isset($MIN_YEAR)) {
    $MIN_YEAR = intval(date("Y"));
}
$form = new CForm();
$form->SetMethod('get');
$form->AddItem(SPACE . S_MEDIA_TYPE . SPACE);
$cmbMedia = new CComboBox("media_type", $media_type, "submit();");
$cmbMedia->AddItem(0, S_ALL_SMALL);
$db_medias = DBselect('select * from media_type where ' . DBin_node('mediatypeid') . ' order by description');
while ($media_data = DBfetch($db_medias)) {
    $cmbMedia->AddItem($media_data["mediatypeid"], $media_data["description"]);
}
$form->AddItem($cmbMedia);
$form->AddItem(SPACE . S_PERIOD . SPACE);
$cmbPeriod = new CComboBox("period", $period, "submit();");
$cmbPeriod->AddItem("dayly", S_DAILY);
$cmbPeriod->AddItem("weekly", S_WEEKLY);
$cmbPeriod->AddItem("monthly", S_MONTHLY);
$cmbPeriod->AddItem("yearly", S_YEARLY);
$form->AddItem($cmbPeriod);
if ($period != "yearly") {
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:report4.php

示例6: array

}
//--------
validate_sort_and_sortorder('ip', ZBX_SORT_UP);
$p_elements = array();
$r_form = new CForm();
$r_form->SetMethod('get');
$druleid = get_request('druleid', 0);
$fullscreen = get_request('fullscreen', 0);
$cmbDRules = new CComboBox('druleid', $druleid, 'submit()');
$cmbDRules->AddItem(0, S_ALL_SMALL);
$db_drules = DBselect('select distinct druleid,name from drules where ' . DBin_node('druleid') . ' order by name');
while ($drule = DBfetch($db_drules)) {
    $cmbDRules->AddItem($drule['druleid'], get_node_name_by_elid($drule['druleid']) . $drule['name']);
}
$r_form->addVar('fullscreen', $fullscreen);
$r_form->AddItem(array(S_DISCOVERY_RULE . SPACE, $cmbDRules));
// Header
$text = array(SPACE);
$url = '?fullscreen=' . ($_REQUEST['fullscreen'] ? '0' : '1') . '&druleid=' . $druleid;
$fs_icon = new CDiv(SPACE, 'fullscreen');
$fs_icon->AddOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
$fs_icon->AddAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
$p_elements[] = get_table_header($text, $r_form);
//-------------
$services = array();
$db_dservices = DBselect('SELECT s.type,s.port,s.key_ FROM dservices s,dhosts h' . ' WHERE ' . DBin_node('s.dserviceid') . ' AND s.dhostid=h.dhostid' . ($druleid > 0 ? ' AND h.druleid=' . $druleid : ''));
while ($dservice = DBfetch($db_dservices)) {
    $service_name = discovery_check_type2str($dservice['type']) . discovery_port2str($dservice['type'], $dservice['port']) . (empty($dservice['key_']) ? '' : ':' . $dservice['key_']);
    $services[$service_name] = 1;
}
ksort($services);
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:discovery.php

示例7: array

    fatal_error(S_NO_IT_SERVICE_DEFINED);
}
$available_triggers = get_accessible_triggers(PERM_READ_ONLY, array(), PERM_RES_IDS_ARRAY);
$sql = 'SELECT s.* ' . ' FROM services s ' . ' WHERE s.serviceid=' . $_REQUEST['serviceid'] . ' AND (s.triggerid IS NULL OR ' . DBcondition('s.triggerid', $available_triggers) . ') ' . ' AND ' . DBin_node('s.serviceid');
if (!($service = DBfetch(DBselect($sql)))) {
    access_deny();
}
$form = new CForm();
$form->SetMethod('get');
$form->AddVar("serviceid", $_REQUEST["serviceid"]);
$cmbPeriod = new CComboBox("period", $period, "submit();");
$cmbPeriod->AddItem("dayly", S_DAILY);
$cmbPeriod->AddItem("weekly", S_WEEKLY);
$cmbPeriod->AddItem("monthly", S_MONTHLY);
$cmbPeriod->AddItem("yearly", S_YEARLY);
$form->AddItem(array(SPACE . S_PERIOD . SPACE, $cmbPeriod));
$cmbYear = new CComboBox("year", $year, "submit();");
for ($y = date("Y") - YEAR_LEFT_SHIFT; $y <= date("Y"); $y++) {
    $cmbYear->AddItem($y, $y);
}
$form->AddItem(array(SPACE . S_YEAR . SPACE, $cmbYear));
show_table_header(array(S_IT_SERVICES_AVAILABILITY_REPORT_BIG, SPACE . "\"", new CLink($service["name"], "srv_status.php?serviceid=" . $service["serviceid"]), "\""), $form);
$table = new CTableInfo();
$header = array(S_OK, S_PROBLEMS, S_DOWNTIME, S_PERCENTAGE, S_SLA);
switch ($period) {
    case "yearly":
        $from = date("Y") - YEAR_LEFT_SHIFT;
        $to = date("Y");
        array_unshift($header, new CCol(S_YEAR, "center"));
        function get_time($y)
        {
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:report3.php

示例8: CForm

                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
$form = new CForm();
$form->SetMethod('get');
$cmbConfig = new CComboBox('config', $config, 'submit()');
$cmbConfig->AddItem(0, S_SCREENS);
$cmbConfig->AddItem(1, S_SLIDESHOWS);
$form->AddItem($cmbConfig);
$form->AddItem(new CButton("form", 0 == $config ? S_CREATE_SCREEN : S_SLIDESHOW));
show_table_header(0 == $config ? S_CONFIGURATION_OF_SCREENS_BIG : S_CONFIGURATION_OF_SLIDESHOWS_BIG, $form);
echo SBR;
$row_count = 0;
if (0 == $config) {
    if (isset($_REQUEST["form"])) {
        insert_screen_form();
    } else {
        $numrows = new CSpan(null, 'info');
        $numrows->addOption('name', 'numrows');
        $header = get_table_header(array(S_SCREENS_BIG, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows));
        show_table_header($header);
        $table = new CTableInfo(S_NO_SCREENS_DEFINED);
        $table->SetHeader(array(make_sorting_link(S_NAME, 's.name'), make_sorting_link(S_DIMENSION_COLS_ROWS, 'size'), S_SCREEN));
        $result = DBselect('SELECT s.screenid,s.name,s.hsize,s.vsize,(s.hsize*s.vsize) as s_size ' . ' FROM screens s ' . ' WHERE ' . DBin_node('s.screenid') . order_by('s.name,s_size', 's.screenid'));
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:screenconf.php

示例9: array

$page['hist_arg'] = array('period');
$page['scripts'] = array('menu_scripts.js');
include_once 'include/page_header.php';
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('period' => array(T_ZBX_STR, O_OPT, P_SYS | P_NZERO, IN('"day","week","month","year"'), NULL));
check_fields($fields);
$_REQUEST['period'] = get_request('period', 'day');
$admin_links = $USER_DETAILS['type'] == USER_TYPE_ZABBIX_ADMIN || $USER_DETAILS['type'] == USER_TYPE_SUPER_ADMIN;
$form = new CForm();
$form->SetMethod('get');
$cmbPeriod = new CComboBox('period', $_REQUEST['period'], 'submit()');
$cmbPeriod->AddItem('day', S_DAY);
$cmbPeriod->AddItem('week', S_WEEK);
$cmbPeriod->AddItem('month', S_MONTH);
$cmbPeriod->AddItem('year', S_YEAR);
$form->AddItem($cmbPeriod);
show_table_header(S_TRIGGERS_TOP_100_BIG, $form);
$table = new CTableInfo();
$table->setHeader(array(is_show_subnodes() ? S_NODE : null, S_HOST, S_TRIGGER, S_SEVERITY, S_NUMBER_OF_STATUS_CHANGES));
switch ($_REQUEST['period']) {
    case 'week':
        $time_dif = 7 * 24 * 3600;
        break;
    case 'month':
        $time_dif = 10 * 24 * 3600;
        break;
    case 'year':
        $time_dif = 365 * 24 * 3600;
        break;
    case 'day':
    default:
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:report5.php

示例10: CForm

// right
$nodeid = get_request('nodeid', get_profile('web.popup_right.nodeid.last', get_current_nodeid(false)));
update_profile('web.popup_right.nodeid.last', $nodeid);
$frmTitle = new CForm();
$frmTitle->AddVar('dstfrm', $dstfrm);
$frmTitle->AddVar('permission', $permission);
if (ZBX_DISTRIBUTED) {
    $available_nodes = get_accessible_nodes_by_user($USER_DETAILS, PERM_READ_WRITE, PERM_RES_IDS_ARRAY);
    $cmbResourceNode = new CComboBox('nodeid', $nodeid, 'submit();');
    $cmbResourceNode->AddItem(0, S_ALL_S);
    $sql = 'SELECT name,nodeid FROM nodes WHERE ' . DBcondition('nodeid', $available_nodes);
    $db_nodes = DBselect($sql);
    while ($node = DBfetch($db_nodes)) {
        $cmbResourceNode->AddItem($node['nodeid'], $node['name']);
    }
    $frmTitle->AddItem(array(S_NODE, SPACE, $cmbResourceNode));
}
show_table_header(permission2str($permission), $frmTitle);
$form = new CForm();
$form->addOption('id', 'groups');
$table = new CTableInfo(S_NO_RESOURCES_DEFINED);
$table->SetHeader(new CCol(array(new CCheckBox("all_groups", NULL, 'check_all(this.checked)'), S_NAME)));
$result = DBselect('SELECT n.name as node_name, g.name as name, g.groupid as id' . ' FROM groups g ' . ' LEFT JOIN nodes n on ' . DBid2nodeid('g.groupid') . '=n.nodeid ' . ($nodeid ? ' WHERE nodeid=' . $nodeid : '') . ' ORDER BY n.name, g.name');
$grouplist = array();
while ($row = DBfetch($result)) {
    if (isset($row['node_name'])) {
        $row['name'] = $row['node_name'] . ':' . $row['name'];
    }
    $grouplist[$row['id']] = array('name' => $row['name'], 'permission' => $permission);
    $table->addRow(new CCol(array(new CCheckBox('groups[' . $row['id'] . ']', NULL, NULL, $row['id']), $row['name'])));
}
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:popup_right.php

示例11: array

}
$p_elements = array();
$text = null;
$form = new CForm();
$form->SetMethod('get');
$form->AddVar('fullscreen', $_REQUEST['fullscreen']);
if (isset($_REQUEST['period'])) {
    $form->AddVar('period', $_REQUEST['period']);
}
if (isset($_REQUEST['stime'])) {
    $form->AddVar('stime', $_REQUEST['stime']);
}
$cmbConfig = new CComboBox('config', $config, "javascript: redirect('slides.php?config=1');");
$cmbConfig->addItem(0, S_SCREENS);
$cmbConfig->addItem(1, S_SLIDESHOWS);
$form->AddItem(array(S_SHOW . SPACE, $cmbConfig));
$cmbElements = new CComboBox('elementid', $elementid, 'submit()');
unset($screen_correct);
unset($first_screen);
$result = DBselect('SELECT screenid as elementid, name ' . ' FROM screens ' . ' WHERE ' . DBin_node('screenid') . ' ORDER BY name');
while ($row = DBfetch($result)) {
    if (!screen_accessible($row['elementid'], PERM_READ_ONLY)) {
        continue;
    }
    $cmbElements->addItem($row['elementid'], get_node_name_by_elid($row['elementid']) . $row['name']);
    if (bccomp($elementid, $row['elementid']) == 0) {
        $element_correct = 1;
    }
    if (!isset($first_element)) {
        $first_element = $row['elementid'];
    }
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:screens.php

示例12: array

         $to_save_request = array("filter_task", "filter", "mark_color");
         $filter_task = get_request("filter_task", 0);
         $filter = get_request("filter", "");
         $mark_color = get_request("mark_color", 0);
         $r_header = new CForm();
         $r_header->SetMethod('get');
         $r_header->AddVar("action", $_REQUEST["action"]);
         $r_header->AddVar("from", $_REQUEST["from"]);
         $r_header->AddVar("period", $_REQUEST["period"]);
         $r_header->AddVar("itemid", $_REQUEST["itemid"]);
         $cmbFTask = new CComboBox("filter_task", $filter_task, "submit()");
         $cmbFTask->AddItem(FILTER_TAST_SHOW, S_SHOW_SELECTED);
         $cmbFTask->AddItem(FILTER_TAST_HIDE, S_HIDE_SELECTED);
         $cmbFTask->AddItem(FILTER_TAST_MARK, S_MARK_SELECTED);
         $cmbFTask->AddItem(FILTER_TAST_INVERT_MARK, S_MARK_OTHERS);
         $r_header->AddItem(array(S_SELECT_ROWS_WITH_VALUE_LIKE, SPACE, new CTextBox("filter", $filter, 25), $cmbFTask, SPACE));
         if (str_in_array($filter_task, array(FILTER_TAST_MARK, FILTER_TAST_INVERT_MARK))) {
             $cmbColor = new CComboBox("mark_color", $mark_color);
             $cmbColor->AddItem(MARK_COLOR_RED, S_AS_RED);
             $cmbColor->AddItem(MARK_COLOR_GREEN, S_AS_GREEN);
             $cmbColor->AddItem(MARK_COLOR_BLUE, S_AS_BLUE);
             $r_header->AddItem(array($cmbColor, SPACE));
         }
         $r_header->AddItem(new CButton("select", "Select"));
     } else {
         $r_header = null;
     }
     if (($l_header || $r_header) && $_REQUEST['fullscreen'] == 0) {
         show_table_header($l_header, $r_header);
     }
 } else {
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:history.php

示例13: array

}
$p_elements = array();
$text = null;
if (isset($_REQUEST["sysmapid"])) {
    $sysmap = get_sysmap_by_sysmapid($_REQUEST["sysmapid"]);
    $text = $all_maps[$_REQUEST["sysmapid"]];
}
$form = new CForm();
$form->SetMethod('get');
$form->AddVar("fullscreen", $_REQUEST["fullscreen"]);
$cmbMaps = new CComboBox("sysmapid", get_request("sysmapid", 0), "submit()");
foreach ($all_maps as $id => $name) {
    $cmbMaps->AddItem($id, $name);
}
if ($cmbMaps->ItemsCount() > 0) {
    $form->AddItem($cmbMaps);
    $p_elements[] = get_table_header($text, $form);
}
$table = new CTable(S_NO_MAPS_DEFINED, "map");
if (isset($_REQUEST["sysmapid"])) {
    $action_map = get_action_map_by_sysmapid($_REQUEST["sysmapid"]);
    $table->AddRow($action_map);
    $imgMap = new CImg("map.php?noedit=1&sysmapid=" . $_REQUEST["sysmapid"]);
    $imgMap->SetMap($action_map->GetName());
    $table->AddRow($imgMap);
}
$p_elements[] = $table;
$icon = null;
$fs_icon = null;
if (isset($_REQUEST["sysmapid"])) {
    $sysmap = get_sysmap_by_sysmapid($_REQUEST["sysmapid"]);
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:maps.php

示例14: array

    }
    $treeServ = array();
    createShowServiceTree($services, $treeServ);
    //return into $treeServ parametr
    //permission issue
    $treeServ = del_empty_nodes($treeServ);
    $tree = new CTree('service_status_tree', $treeServ, array('caption' => bold(S_SERVICE), 'status' => bold(S_STATUS), 'reason' => bold(S_REASON), 'sla' => bold('SLA (' . $periods[$period_start] . ')'), 'sla2' => bold(nbsp(S_SLA)), 'graph' => bold(S_GRAPH)));
    if ($tree) {
        // creates form for choosing a preset interval
        $r_form = new CForm();
        $r_form->setClass('nowrap');
        $r_form->setMethod('get');
        $r_form->setAttribute('name', 'period_choice');
        $r_form->addVar('fullscreen', $_REQUEST['fullscreen']);
        $period_combo = new CComboBox('period_start', $period_start, 'javascript: submit();');
        foreach ($periods as $key => $val) {
            $period_combo->AddItem($key, $val);
        }
        $r_form->AddItem(array(S_PERIOD, $period_combo));
        $url = '?period_start=' . $period_start . '&fullscreen=' . ($_REQUEST['fullscreen'] ? '0' : '1');
        $fs_icon = new CDiv(SPACE, 'fullscreen');
        $fs_icon->setAttribute('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
        $fs_icon->addAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
        $srv_wdgt = new CWidget('hat_services', $tree->getHTML());
        $srv_wdgt->addHeader(S_IT_SERVICES_BIG, array($r_form, $fs_icon));
        $srv_wdgt->show();
    } else {
        error('Can not format Tree. Check logik structure in service links');
    }
}
include_once "include/page_footer.php";
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:srv_status.php

示例15: array

include_once "include/page_header.php";
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array("show" => array(T_ZBX_INT, O_OPT, P_SYS, IN("0,1,2"), NULL));
check_fields($fields);
$available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY);
?>

<?php 
$_REQUEST["show"] = get_request("show", 0);
$form = new CForm();
$form->SetMethod('get');
$cmbMode = new CComboBox("show", $_REQUEST["show"], "submit();");
$cmbMode->AddItem(0, S_OVERVIEW);
$cmbMode->AddItem(1, S_OVERVIEW_BY_PROXY);
$cmbMode->AddItem(2, S_DETAILS);
$form->AddItem($cmbMode);
show_table_header(S_QUEUE_OF_ITEMS_TO_BE_UPDATED_BIG, $form);
?>

<?php 
$now = time();
$item_types = array(ITEM_TYPE_ZABBIX, ITEM_TYPE_ZABBIX_ACTIVE, ITEM_TYPE_SNMPV1, ITEM_TYPE_SNMPV2C, ITEM_TYPE_SNMPV3, ITEM_TYPE_SIMPLE, ITEM_TYPE_INTERNAL, ITEM_TYPE_AGGREGATE, ITEM_TYPE_EXTERNAL);
$result = DBselect('SELECT i.itemid,i.nextcheck,i.description,i.key_,i.type,h.host,h.hostid,h.proxy_hostid ' . ' FROM items i,hosts h ' . ' WHERE i.status=' . ITEM_STATUS_ACTIVE . ' AND i.type in (' . implode(',', $item_types) . ') ' . ' AND ((h.status=' . HOST_STATUS_MONITORED . ' AND h.available != ' . HOST_AVAILABLE_FALSE . ') ' . ' OR (h.status=' . HOST_STATUS_MONITORED . ' AND h.available=' . HOST_AVAILABLE_FALSE . ' AND h.disable_until<=' . $now . ')) ' . ' AND i.hostid=h.hostid ' . ' AND i.nextcheck + 5 <' . $now . ' AND i.key_ NOT IN (' . zbx_dbstr('status') . ',' . zbx_dbstr('icmpping') . ',' . zbx_dbstr('icmppingsec') . ',' . zbx_dbstr('zabbix[log]') . ') ' . ' AND i.value_type not in (' . ITEM_VALUE_TYPE_LOG . ') ' . ' AND ' . DBcondition('h.hostid', $available_hosts) . ' AND ' . DBin_node('h.hostid', get_current_nodeid()) . ' ORDER BY i.nextcheck,h.host,i.description,i.key_');
$table = new CTableInfo(S_THE_QUEUE_IS_EMPTY);
if ($_REQUEST["show"] == 0) {
    foreach ($item_types as $type) {
        $sec_10[$type] = 0;
        $sec_30[$type] = 0;
        $sec_60[$type] = 0;
        $sec_300[$type] = 0;
        $sec_600[$type] = 0;
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:queue.php


注:本文中的CForm::AddItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。