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


PHP CComboBox::AddItem方法代码示例

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


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

示例1: DBfetch

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") {
    $form->AddItem(SPACE . S_YEAR . SPACE);
    $cmbYear = new CComboBox("year", $year, "submit();");
    for ($y = $MIN_YEAR; $y <= date("Y"); $y++) {
        $cmbYear->AddItem($y, $y);
    }
    $form->AddItem($cmbYear);
}
show_table_header(S_NOTIFICATIONS_BIG, $form);
$_REQUEST["year"] = $year;
$_REQUEST["period"] = $period;
$_REQUEST["media_type"] = $media_type;
$table = new CTableInfo();
$header = array();
$db_users = DBselect('select * from users where ' . DBin_node('userid') . ' order by alias,userid');
while ($user_data = DBfetch($db_users)) {
    array_push($header, new CImg("vtext.php?text=" . $user_data["alias"]));
    $users[$user_data['userid']] = $user_data['alias'];
}
$media_types = array();
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:report4.php

示例2: insert_mass_update_item_form

function insert_mass_update_item_form($elements_array_name)
{
    global $USER_DETAILS;
    $frmItem = new CFormTable(S_ITEM, null, 'post');
    $frmItem->SetHelp('web.items.item.php');
    $frmItem->SetTitle(S_MASS_UPDATE);
    $frmItem->addVar('form_mass_update', 1);
    $frmItem->addVar('group_itemid', get_request('group_itemid', array()));
    $frmItem->addVar('config', get_request('config', 0));
    if ($_REQUEST['groupid'] > 0) {
        $frmItem->addVar('groupid', $_REQUEST['groupid']);
    }
    $frmItem->addVar('hostid', $_REQUEST['hostid']);
    $description = get_request('description', '');
    $key = get_request('key', '');
    $host = get_request('host', null);
    $delay = get_request('delay', 30);
    $history = get_request('history', 90);
    $status = get_request('status', 0);
    $type = get_request('type', 0);
    $snmp_community = get_request('snmp_community', 'public');
    $snmp_oid = get_request('snmp_oid', 'interfaces.ifTable.ifEntry.ifInOctets.1');
    $snmp_port = get_request('snmp_port', 161);
    $value_type = get_request('value_type', ITEM_VALUE_TYPE_UINT64);
    $data_type = get_request('data_type', ITEM_DATA_TYPE_DECIMAL);
    $trapper_hosts = get_request('trapper_hosts', '');
    $units = get_request('units', '');
    $valuemapid = get_request('valuemapid', 0);
    $delta = get_request('delta', 0);
    $trends = get_request('trends', 365);
    $applications = get_request('applications', array());
    $delay_flex = get_request('delay_flex', array());
    $snmpv3_securityname = get_request('snmpv3_securityname', '');
    $snmpv3_securitylevel = get_request('snmpv3_securitylevel', 0);
    $snmpv3_authpassphrase = get_request('snmpv3_authpassphrase', '');
    $snmpv3_privpassphrase = get_request('snmpv3_privpassphrase', '');
    $formula = get_request('formula', '1');
    $logtimefmt = get_request('logtimefmt', '');
    $add_groupid = get_request('add_groupid', get_request('groupid', 0));
    $delay_flex_el = array();
    $i = 0;
    foreach ($delay_flex as $val) {
        if (!isset($val['delay']) && !isset($val['period'])) {
            continue;
        }
        array_push($delay_flex_el, array(new CCheckBox('rem_delay_flex[]', 'no', null, $i), $val['delay'], ' sec at ', $val['period']), BR());
        $frmItem->addVar("delay_flex[" . $i . "][delay]", $val['delay']);
        $frmItem->addVar("delay_flex[" . $i . "][period]", $val['period']);
        $i++;
        if ($i >= 7) {
            break;
        }
        /* limit count of  intervals
         * 7 intervals by 30 symbols = 210 characters
         * db storage field is 256
         */
    }
    if (count($delay_flex_el) == 0) {
        array_push($delay_flex_el, "No flexible intervals");
    } else {
        array_push($delay_flex_el, new CButton('del_delay_flex', 'delete selected'));
    }
    if (count($applications) == 0) {
        array_push($applications, 0);
    }
    $cmbType = new CComboBox('type', $type);
    foreach (array(ITEM_TYPE_ZABBIX, ITEM_TYPE_ZABBIX_ACTIVE, ITEM_TYPE_SIMPLE, ITEM_TYPE_SNMPV1, ITEM_TYPE_SNMPV2C, ITEM_TYPE_SNMPV3, ITEM_TYPE_TRAPPER, ITEM_TYPE_INTERNAL, ITEM_TYPE_AGGREGATE, ITEM_TYPE_AGGREGATE, ITEM_TYPE_EXTERNAL, ITEM_TYPE_DB_MONITOR) as $it) {
        $cmbType->addItem($it, item_type2str($it));
    }
    $frmItem->addRow(array(new CVisibilityBox('type_visible', get_request('type_visible'), 'type', S_ORIGINAL), S_TYPE), $cmbType);
    $frmItem->addRow(array(new CVisibilityBox('community_visible', get_request('community_visible'), 'snmp_community', S_ORIGINAL), S_SNMP_COMMUNITY), new CTextBox('snmp_community', $snmp_community, 16));
    $frmItem->addRow(array(new CVisibilityBox('securityname_visible', get_request('securityname_visible'), 'snmpv3_securityname', S_ORIGINAL), S_SNMPV3_SECURITY_NAME), new CTextBox('snmpv3_securityname', $snmpv3_securityname, 64));
    $cmbSecLevel = new CComboBox('snmpv3_securitylevel', $snmpv3_securitylevel);
    $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_NOAUTHNOPRIV, "NoAuthPriv");
    $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV, "AuthNoPriv");
    $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV, "AuthPriv");
    $frmItem->addRow(array(new CVisibilityBox('securitylevel_visible', get_request('securitylevel_visible'), 'snmpv3_securitylevel', S_ORIGINAL), S_SNMPV3_SECURITY_LEVEL), $cmbSecLevel);
    $frmItem->addRow(array(new CVisibilityBox('authpassphrase_visible', get_request('authpassphrase_visible'), 'snmpv3_authpassphrase', S_ORIGINAL), S_SNMPV3_AUTH_PASSPHRASE), new CTextBox('snmpv3_authpassphrase', $snmpv3_authpassphrase, 64));
    $frmItem->addRow(array(new CVisibilityBox('privpassphras_visible', get_request('privpassphras_visible'), 'snmpv3_privpassphrase', S_ORIGINAL), S_SNMPV3_PRIV_PASSPHRASE), new CTextBox('snmpv3_privpassphrase', $snmpv3_privpassphrase, 64));
    $frmItem->addRow(array(new CVisibilityBox('port_visible', get_request('port_visible'), 'snmp_port', S_ORIGINAL), S_SNMP_PORT), new CNumericBox('snmp_port', $snmp_port, 5));
    $cmbValType = new CComboBox('value_type', $value_type);
    $cmbValType->AddItem(ITEM_VALUE_TYPE_UINT64, S_NUMERIC_UNSIGNED);
    $cmbValType->AddItem(ITEM_VALUE_TYPE_FLOAT, S_NUMERIC_FLOAT);
    $cmbValType->AddItem(ITEM_VALUE_TYPE_STR, S_CHARACTER);
    $cmbValType->AddItem(ITEM_VALUE_TYPE_LOG, S_LOG);
    $cmbValType->AddItem(ITEM_VALUE_TYPE_TEXT, S_TEXT);
    $frmItem->AddRow(array(new CVisibilityBox('value_type_visible', get_request('value_type_visible'), 'value_type', S_ORIGINAL), S_TYPE_OF_INFORMATION), $cmbValType);
    $cmbDataType = new CComboBox('data_type', $data_type);
    $cmbDataType->addItem(ITEM_DATA_TYPE_DECIMAL, item_data_type2str(ITEM_DATA_TYPE_DECIMAL));
    $cmbDataType->addItem(ITEM_DATA_TYPE_OCTAL, item_data_type2str(ITEM_DATA_TYPE_OCTAL));
    $cmbDataType->addItem(ITEM_DATA_TYPE_HEXADECIMAL, item_data_type2str(ITEM_DATA_TYPE_HEXADECIMAL));
    $frmItem->addRow(array(new CVisibilityBox('data_type_visible', get_request('data_type_visible'), 'data_type', S_ORIGINAL), S_DATA_TYPE), $cmbDataType);
    $frmItem->addRow(array(new CVisibilityBox('units_visible', get_request('units_visible'), 'units', S_ORIGINAL), S_UNITS), new CTextBox('units', $units, 40));
    $frmItem->addRow(array(new CVisibilityBox('formula_visible', get_request('formula_visible'), 'formula', S_ORIGINAL), S_CUSTOM_MULTIPLIER . ' (0 - ' . S_DISABLED . ')'), new CTextBox('formula', $formula, 40));
    $frmItem->addRow(array(new CVisibilityBox('delay_visible', get_request('delay_visible'), 'delay', S_ORIGINAL), S_UPDATE_INTERVAL_IN_SEC), new CNumericBox('delay', $delay, 5));
    $delay_flex_el = new CSpan($delay_flex_el);
    $delay_flex_el->addOption('id', 'delay_flex_list');
    $frmItem->addRow(array(new CVisibilityBox('delay_flex_visible', get_request('delay_flex_visible'), array('delay_flex_list', 'new_delay_flex_el'), S_ORIGINAL), S_FLEXIBLE_INTERVALS), $delay_flex_el);
    $new_delay_flex_el = new CSpan(array(S_DELAY, SPACE, new CNumericBox("new_delay_flex[delay]", "50", 5), S_PERIOD, SPACE, new CTextBox("new_delay_flex[period]", "1-7,00:00-23:59", 27), BR(), new CButton("add_delay_flex", S_ADD)));
    $new_delay_flex_el->addOption('id', 'new_delay_flex_el');
//.........这里部分代码省略.........
开发者ID:rennhak,项目名称:zabbix,代码行数:101,代码来源:forms.inc.php

示例3: CComboBox

$cmbFnc = new CComboBox('expr_type', $expr_type, 'submit()');
foreach ($functions as $id => $f) {
    foreach ($f['operators'] as $op => $txt_op) {
        $cmbFnc->AddItem($id . '[' . $op . ']', str_replace('{OP}', $txt_op, $f['description']));
    }
}
$form->AddRow(S_FUNCTION, $cmbFnc);
if (isset($functions[$function]['params'])) {
    foreach ($functions[$function]['params'] as $pid => $pf) {
        $pv = isset($param[$pid]) ? $param[$pid] : null;
        if ($pf['T'] == T_ZBX_INT) {
            if (0 == $pid) {
                if (isset($pf['M']) && is_array($pf['M'])) {
                    $cmbParamType = new CComboBox('paramtype', $paramtype);
                    foreach ($pf['M'] as $mid => $caption) {
                        $cmbParamType->AddItem($mid, $caption);
                    }
                } else {
                    $form->AddVar('paramtype', PARAM_TYPE_SECONDS);
                    $cmbParamType = S_SECONDS;
                }
            } else {
                $cmbParamType = null;
            }
            $form->AddRow(S_LAST_OF . ' ', array(new CNumericBox('param[' . $pid . ']', $pv, 10), $cmbParamType));
        } else {
            $form->AddRow($pf['C'], new CTextBox('param[' . $pid . ']', $pv, 30));
            $form->AddVar('paramtype', PARAM_TYPE_SECONDS);
        }
    }
} else {
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:popup_trexpr.php

示例4: array

require_once 'include/config.inc.php';
require_once 'include/triggers.inc.php';
$page['title'] = "S_TRIGGERS_TOP_100";
$page['file'] = 'report5.php';
$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':
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:report5.php

示例5: unset

        unset($_REQUEST['triggerid']);
    }
    $cmbGroups = new CComboBox('groupid', $PAGE_GROUPS['selected'], 'javascript: submit();');
    $cmbHosts = new CComboBox('hostid', $PAGE_HOSTS['selected'], 'javascript: submit();');
    foreach ($PAGE_GROUPS['groups'] as $groupid => $name) {
        $cmbGroups->addItem($groupid, get_node_name_by_elid($groupid) . $name);
    }
    foreach ($PAGE_HOSTS['hosts'] as $hostid => $name) {
        $cmbHosts->addItem($hostid, get_node_name_by_elid($hostid) . $name);
    }
    $r_form->addItem(array(S_GROUP . SPACE, $cmbGroups));
    $r_form->addItem(array(SPACE . S_HOST . SPACE, $cmbHosts));
}
if ($allow_discovery) {
    $cmbSource = new CComboBox('source', $source, 'submit()');
    $cmbSource->AddItem(EVENT_SOURCE_TRIGGERS, S_TRIGGER);
    $cmbSource->AddItem(EVENT_SOURCE_DISCOVERY, S_DISCOVERY);
    $r_form->AddItem(array(SPACE . S_SOURCE . SPACE, $cmbSource));
}
// Header
$p_elements = array();
$text = array(S_HISTORY_OF_EVENTS_BIG, SPACE, date('[H:i:s]', time()));
$url = '?fullscreen=' . ($_REQUEST['fullscreen'] ? '0' : '1');
$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(S_EVENTS, $r_form);
//-------------
// Day View Calc
$start = $_REQUEST['nav_time'];
$start = mktime(0, 0, 0, date('m', $start), date('d', $start), date('Y', $start));
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:events.php

示例6: DBfetch

            $frmCnct->AddVar("linkid", $_REQUEST["linkid"]);
            $db_link = DBfetch(DBselect('SELECT * FROM sysmaps_link_triggers WHERE linkid=' . $_REQUEST["linkid"] . ' AND triggerid=' . $_REQUEST['triggerid']));
            $triggerid = $_REQUEST['triggerid'];
            $drawtype = $db_link["drawtype"];
            $color = $db_link["color"];
        } else {
            $triggerid = get_request("triggerid", 0);
            $drawtype = get_request("drawtype", 0);
            $color = get_request("color", 0);
        }
        $frmCnct->AddVar("triggerid", $triggerid);
        /* START comboboxes preparations */
        $cmbType = new CComboBox("drawtype", $drawtype);
        foreach (map_link_drawtypes() as $i) {
            $value = map_link_drawtype2str($i);
            $cmbType->AddItem($i, $value);
        }
        $btnSelect = new CButton('btn1', S_SELECT, "return PopUp('popup.php?dstfrm=" . $frmCnct->GetName() . "&dstfld1=triggerid&dstfld2=trigger&srctbl=triggers&srcfld1=triggerid&srcfld2=description');", 'T');
        $btnSelect->SetType('button');
        /* END preparation */
        $description = $triggerid > 0 ? expand_trigger_description($triggerid) : '';
        $frmCnct->AddRow(S_TRIGGER, array(new CTextBox('trigger', $description, 70, 'yes'), SPACE, $btnSelect));
        $frmCnct->AddRow(S_TYPE . ' (' . S_PROBLEM_BIG . ')', $cmbType);
        $frmCnct->AddRow(S_COLOR . ' (' . S_PROBLEM_BIG . ')', new CColor('color', $color));
        $frmCnct->AddItemToBottomRow(new CButton("save", isset($_REQUEST['triggerid']) ? S_SAVE : S_ADD));
        $frmCnct->AddItemToBottomRow(SPACE);
        $frmCnct->AddItemToBottomRow(new CButton("cancel", S_CANCEL, 'javascript: window.close();'));
        $frmCnct->Show();
    }
}
include_once "include/page_footer.php";
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:popup_link_tr.php

示例7: 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

示例8: get_screen_item_form


//.........这里部分代码省略.........
                                    // HOSTS info
                                    $caption = '';
                                    $id = 0;
                                    $available_groups = get_accessible_groups_by_user($USER_DETAILS, PERM_READ_ONLY);
                                    if (remove_nodes_from_id($resourceid) > 0) {
                                        $result = DBselect('SELECT DISTINCT n.name as node_name,g.groupid,g.name ' . ' FROM hosts_groups hg, groups g ' . ' LEFT JOIN nodes n ON n.nodeid=' . DBid2nodeid('g.groupid') . ' WHERE ' . DBcondition('g.groupid', $available_groups) . ' AND g.groupid=' . $resourceid);
                                        while ($row = DBfetch($result)) {
                                            $row['node_name'] = isset($row['node_name']) ? '(' . $row['node_name'] . ') ' : '';
                                            $caption = $row['node_name'] . $row['name'];
                                            $id = $resourceid;
                                        }
                                    } else {
                                        if (remove_nodes_from_id($resourceid) == 0) {
                                            $result = DBselect('SELECT DISTINCT n.name as node_name ' . ' FROM nodes n ' . ' WHERE n.nodeid=' . id2nodeid($resourceid));
                                            while ($row = DBfetch($result)) {
                                                $row['node_name'] = isset($row['node_name']) ? '(' . $row['node_name'] . ') ' : '';
                                                $caption = $row['node_name'] . S_MINUS_ALL_GROUPS_MINUS;
                                                $id = $resourceid;
                                            }
                                        }
                                    }
                                    $form->AddVar('resourceid', $id);
                                    $textfield = new CTextbox('caption', $caption, 60, 'yes');
                                    $selectbtn = new Cbutton('select', S_SELECT, "javascript: return PopUp('popup.php?dstfrm=" . $form->getName() . "&dstfld1=resourceid&dstfld2=caption&srctbl=host_group_scr&srcfld1=groupid&srcfld2=name',480,450);");
                                    $selectbtn->setAttribute('onmouseover', "javascript: this.style.cursor = 'pointer';");
                                    $form->AddRow(S_GROUP, array($textfield, SPACE, $selectbtn));
                                } else {
                                    // SCREEN_RESOURCE_CLOCK
                                    $form->addVar('resourceid', 0);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    if (uint_in_array($resourcetype, array(SCREEN_RESOURCE_HOSTS_INFO, SCREEN_RESOURCE_TRIGGERS_INFO))) {
        $cmbStyle = new CComboBox("style", $style);
        $cmbStyle->AddItem(STYLE_HORISONTAL, S_HORIZONTAL);
        $cmbStyle->AddItem(STYLE_VERTICAL, S_VERTICAL);
        $form->AddRow(S_STYLE, $cmbStyle);
    } else {
        if (uint_in_array($resourcetype, array(SCREEN_RESOURCE_TRIGGERS_OVERVIEW, SCREEN_RESOURCE_DATA_OVERVIEW))) {
            $cmbStyle = new CComboBox('style', $style);
            $cmbStyle->AddItem(STYLE_LEFT, S_LEFT);
            $cmbStyle->AddItem(STYLE_TOP, S_TOP);
            $form->AddRow(S_HOSTS_LOCATION, $cmbStyle);
        } else {
            if ($resourcetype == SCREEN_RESOURCE_CLOCK) {
                $cmbStyle = new CComboBox('style', $style);
                $cmbStyle->AddItem(TIME_TYPE_LOCAL, S_LOCAL_TIME);
                $cmbStyle->AddItem(TIME_TYPE_SERVER, S_SERVER_TIME);
                $form->AddRow(S_TIME_TYPE, $cmbStyle);
            } else {
                $form->AddVar('style', 0);
            }
        }
    }
    if (uint_in_array($resourcetype, array(SCREEN_RESOURCE_URL))) {
        $form->AddRow(S_URL, new CTextBox('url', $url, 60));
    } else {
        $form->AddVar('url', '');
    }
    if (uint_in_array($resourcetype, array(SCREEN_RESOURCE_GRAPH, SCREEN_RESOURCE_SIMPLE_GRAPH, SCREEN_RESOURCE_CLOCK, SCREEN_RESOURCE_URL))) {
        $form->AddRow(S_WIDTH, new CNumericBox('width', $width, 5));
        $form->AddRow(S_HEIGHT, new CNumericBox('height', $height, 5));
    } else {
        $form->AddVar('width', 500);
        $form->AddVar('height', 100);
    }
    if (uint_in_array($resourcetype, array(SCREEN_RESOURCE_GRAPH, SCREEN_RESOURCE_SIMPLE_GRAPH, SCREEN_RESOURCE_MAP, SCREEN_RESOURCE_CLOCK, SCREEN_RESOURCE_URL))) {
        $cmbHalign = new CComboBox('halign', $halign);
        $cmbHalign->AddItem(HALIGN_CENTER, S_CENTRE);
        $cmbHalign->AddItem(HALIGN_LEFT, S_LEFT);
        $cmbHalign->AddItem(HALIGN_RIGHT, S_RIGHT);
        $form->AddRow(S_HORIZONTAL_ALIGN, $cmbHalign);
    } else {
        $form->AddVar('halign', 0);
    }
    $cmbValign = new CComboBox('valign', $valign);
    $cmbValign->AddItem(VALIGN_MIDDLE, S_MIDDLE);
    $cmbValign->AddItem(VALIGN_TOP, S_TOP);
    $cmbValign->AddItem(VALIGN_BOTTOM, S_BOTTOM);
    $form->AddRow(S_VERTICAL_ALIGN, $cmbValign);
    $form->AddRow(S_COLUMN_SPAN, new CNumericBox('colspan', $colspan, 2));
    $form->AddRow(S_ROW_SPAN, new CNumericBox('rowspan', $rowspan, 2));
    // dynamic AddOn
    if (uint_in_array($resourcetype, array(SCREEN_RESOURCE_GRAPH, SCREEN_RESOURCE_SIMPLE_GRAPH, SCREEN_RESOURCE_PLAIN_TEXT))) {
        $form->AddRow(S_DYNAMIC_ITEM, new CCheckBox('dynamic', $dynamic, null, 1));
    }
    $form->AddItemToBottomRow(new CButton('save', S_SAVE));
    if (isset($_REQUEST['screenitemid'])) {
        $form->addItemToBottomRow(SPACE);
        $form->addItemToBottomRow(new CButtonDelete(null, url_param('form') . url_param('screenid') . url_param('screenitemid')));
    }
    $form->addItemToBottomRow(SPACE);
    $form->addItemToBottomRow(new CButtonCancel(url_param('screenid')));
    return $form;
}
开发者ID:phedders,项目名称:zabbix,代码行数:101,代码来源:screens.inc.php

示例9: CTextBox

     $frmAuth->AddRow(S_LDAP . SPACE . S_HOST, new CTextBox('ldap_host', $config['ldap_host'], 64));
     $frmAuth->AddRow(S_PORT, new CNumericBox('ldap_port', $config['ldap_port'], 5));
     $frmAuth->AddRow(S_BASE_DN, new CTextBox('ldap_base_dn', $config['ldap_base_dn'], 64));
     $frmAuth->AddRow(S_SEARCH_ATTRIBUTE, new CTextBox('ldap_search_attribute', empty($config['ldap_search_attribute']) ? 'uid' : $config['ldap_search_attribute']));
     $frmAuth->AddRow(S_BIND_DN . '*', new CTextBox('ldap_bind_dn', $config['ldap_bind_dn'], 64));
     $frmAuth->AddRow(S_BIND_PASSWORD . '*', new CPassBox('ldap_bind_password', $config['ldap_bind_password']));
     $action = "javascript: if(confirm('Switching LDAP authentication will reset all current sessions! Continue?')) return true; else return false;";
     $frmAuth->AddRow(S_LDAP . SPACE . S_AUTHENTICATION . SPACE . S_ENABLED, new CCheckBox('authentication_type', $config['authentication_type'], $action, ZBX_AUTH_LDAP));
     $frmAuth->AddRow(S_TEST . SPACE . S_AUTHENTICATION, ' [' . S_MUST_BE_VALID_SMALL . SPACE . S_LDAP . SPACE . S_USER . ']');
     if (GROUP_GUI_ACCESS_INTERNAL == get_user_auth($USER_DETAILS['userid'])) {
         $usr_test = new CComboBox('user', $USER_DETAILS['alias']);
         $sql = 'SELECT u.alias, u.userid ' . ' FROM users u ' . ' WHERE ' . DBin_node('u.userid') . ' ORDER BY alias ASC';
         $u_res = DBselect($sql);
         while ($db_user = Dbfetch($u_res)) {
             if (check_perm2login($db_user['userid']) && check_perm2system($db_user['userid'])) {
                 $usr_test->AddItem($db_user['alias'], $db_user['alias']);
             }
         }
     } else {
         $usr_test = new CTextBox('user', $USER_DETAILS['alias'], null, 'yes');
     }
     $frmAuth->AddRow(S_LOGIN, $usr_test);
     $frmAuth->AddRow(S_USER . SPACE . S_PASSWORD, new CPassBox('user_password'));
     $frmAuth->AddItemToBottomRow(new CButton('save', S_SAVE));
     $frmAuth->AddItemToBottomRow(new CButton('test', S_TEST));
     $frmAuth->Show();
 } else {
     if (ZBX_AUTH_HTTP == $_REQUEST['config']) {
         $form_refresh_http = get_request('form_refresh_http', 0);
         $form_refresh_http++;
         $frmAuth = new CFormTable(S_HTTP_AUTH, 'authentication.php');
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:authentication.php

示例10: array

//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array("dstfrm" => array(T_ZBX_STR, O_MAND, P_SYS, NOT_EMPTY, NULL), "permission" => array(T_ZBX_INT, O_MAND, P_SYS, IN(PERM_DENY . ',' . PERM_READ_ONLY . ',' . PERM_READ_WRITE), NULL), 'nodeid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL));
check_fields($fields);
$dstfrm = get_request("dstfrm", 0);
// destination form
$permission = get_request("permission", PERM_DENY);
// 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)) {
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:popup_right.php

示例11: CCol

     $filtertimetab->SetCellSpacing(0);
     $td_tmp = new CCol(new CTextBox('new_service_time[note]', '<short description>', 40));
     $td_tmp->SetColSpan(10);
     $filtertimetab->AddRow(array(S_NOTE, $td_tmp));
     $filtertimetab->AddRow(array(S_FROM, new CNumericBox('downtime_since_day', '', 2), '/', new CNumericBox('downtime_since_month', '', 2), '/', new CNumericBox('downtime_since_year', '', 4), SPACE, new CNumericBox('downtime_since_hour', '', 2), ':', new CNumericBox('downtime_since_minute', '', 2), $clndr_icon));
     zbx_add_post_js('create_calendar(' . 'null,' . '["downtime_since_day","downtime_since_month","downtime_since_year","downtime_since_hour","downtime_since_minute"],' . '"downtime_since");');
     $clndr_icon->AddAction('onclick', 'javascript: var pos = getPosition(this);' . ' pos.top-=203; pos.left+=16; ' . " CLNDR['downtime_till'].clndr.clndrshow(pos.top,pos.left);");
     $filtertimetab->AddRow(array(S_TILL, new CNumericBox('downtime_till_day', '', 2), '/', new CNumericBox('downtime_till_month', '', 2), '/', new CNumericBox('downtime_till_year', '', 4), SPACE, new CNumericBox('downtime_till_hour', '', 2), ':', new CNumericBox('downtime_till_minute', '', 2), $clndr_icon));
     zbx_add_post_js('create_calendar(' . 'null,' . '["downtime_till_day","downtime_till_month","downtime_till_year","downtime_till_hour","downtime_till_minute"],' . '"downtime_till");');
     $time_param->AddRow($filtertimetab);
 } else {
     $cmbWeekFrom = new CComboBox('new_service_time[from_week]', 'Sunday');
     $cmbWeekTo = new CComboBox('new_service_time[to_week]', 'Sunday');
     foreach (array('Sunday' => S_SUNDAY, 'Monday' => S_MONDAY, 'Tuesday' => S_TUESDAY, 'Wednesday' => S_WEDNESDAY, 'Thursday' => S_THURSDAY, 'Friday' => S_FRIDAY, 'Saturday' => S_SATURDAY) as $day_num => $day_str) {
         $cmbWeekFrom->AddItem($day_num, $day_str);
         $cmbWeekTo->AddItem($day_num, $day_str);
     }
     $time_param->AddRow(array(S_FROM, $cmbWeekFrom, new CTextBox('new_service_time[from]', 'H:i', 9)));
     $time_param->AddRow(array(S_TILL, $cmbWeekTo, new CTextBox('new_service_time[to]', 'H:i', 9)));
     $frmService->AddVar('new_service_time[note]', '');
 }
 $frmService->AddRow(S_NEW_SERVICE_TIME, array($cmbTimeType, BR(), $time_param, new CButton('add_service_time', 'add', 'javascript: document.forms[0].action += \'?sform=1\'; submit();')));
 //trigger
 $frmService->AddRow(S_LINK_TO_TRIGGER_Q, new CCheckBox("linktrigger", $linktrigger, "javascript: display_element('trigger_name');", 1));
 if ($triggerid > 0) {
     $trigger = expand_trigger_description($triggerid);
 } else {
     $trigger = "";
 }
 $row = new CRow(array(new CCol(S_TRIGGER, 'form_row_l'), new CCol(array(new CTextBox("trigger", $trigger, 64, 'yes'), new CButton("btn1", S_SELECT, "return PopUp('popup.php?" . "dstfrm=" . $frmService->GetName() . "&dstfld1=triggerid&dstfld2=trigger" . "&srctbl=triggers&srcfld1=triggerid&srcfld2=description&real_hosts=1');", 'T')), 'form_row_r')));
 $row->setAttribute('id', 'trigger_name');
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:services_form.php

示例12: elseif

 } else {
     if ($_REQUEST['config'] == 8) {
         echo SBR;
         insert_event_ack_form();
     } else {
         if ($_REQUEST['config'] == 9) {
             insert_themes_form();
         } elseif ($_REQUEST["config"] == 3) {
             echo SBR;
             if (isset($_REQUEST["form"])) {
                 insert_image_form();
             } else {
                 $imagetype = get_request('imagetype', IMAGE_TYPE_ICON);
                 $r_form = new CForm();
                 $cmbImg = new CComboBox('imagetype', $imagetype, 'submit();');
                 $cmbImg->AddItem(IMAGE_TYPE_ICON, S_ICON);
                 $cmbImg->AddItem(IMAGE_TYPE_BACKGROUND, S_BACKGROUND);
                 $r_form->AddItem(S_TYPE . SPACE);
                 $r_form->AddItem($cmbImg);
                 show_table_header(S_IMAGES_BIG, $r_form);
                 $table = new CTableInfo(S_NO_IMAGES_DEFINED);
                 $table->setHeader(array(S_NAME, S_TYPE, S_IMAGE));
                 $result = DBselect('SELECT imageid,imagetype,name ' . ' FROM images' . ' WHERE ' . DBin_node('imageid') . ' AND imagetype=' . $imagetype . ' ORDER BY name');
                 while ($row = DBfetch($result)) {
                     if ($row['imagetype'] == IMAGE_TYPE_ICON) {
                         $imagetype = S_ICON;
                     } else {
                         if ($row['imagetype'] == IMAGE_TYPE_BACKGROUND) {
                             $imagetype = S_BACKGROUND;
                         } else {
                             $imagetype = S_UNKNOWN;
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:config.php

示例13: CForm

         $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 {
     $txt = new CTag('p', 'yes', $l_header);
     $txt->Show();
     echo "\n";
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:history.php

示例14: array

unset($all_maps[0]);
if (isset($_REQUEST["sysmapid"])) {
    update_profile("web.maps.sysmapid", $_REQUEST["sysmapid"]);
}
$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;
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:maps.php

示例15: CForm

                }
            }
        }
    }
}
$_REQUEST['filter_usrgrpid'] = get_request('filter_usrgrpid', get_profile('web.users.filter.usrgrpid', 0));
update_profile('web.users.filter.usrgrpid', $_REQUEST['filter_usrgrpid'], PROFILE_TYPE_ID);
$frmForm = new CForm();
$frmForm->SetMethod('get');
$cmbConf = new CComboBox('config', $_REQUEST['config'], 'submit()');
$cmbConf->AddItem(0, S_USERS);
$cmbConf->AddItem(1, S_USER_GROUPS);
$frmForm->AddItem($cmbConf);
if (0 == $_REQUEST['config']) {
    $cmbUGrp = new CComboBox('filter_usrgrpid', $_REQUEST['filter_usrgrpid'], 'submit()');
    $cmbUGrp->AddItem(0, S_ALL_S);
    $result = DBselect('SELECT usrgrpid, name FROM usrgrp WHERE ' . DBin_node('usrgrpid') . ' ORDER BY name');
    while ($usrgrp = DBfetch($result)) {
        $cmbUGrp->AddItem($usrgrp['usrgrpid'], $usrgrp['name']);
    }
    $frmForm->AddItem(array(SPACE . SPACE, S_USER_GROUP, $cmbUGrp));
}
$frmForm->AddItem(SPACE . '|' . SPACE);
$frmForm->AddItem($btnNew = new CButton('form', $_REQUEST['config'] == 0 ? S_CREATE_USER : S_CREATE_GROUP));
show_table_header(S_CONFIGURATION_OF_USERS_AND_USER_GROUPS, $frmForm);
echo SBR;
$row_count = 0;
if ($_REQUEST['config'] == 0) {
    if (isset($_REQUEST['form'])) {
        insert_user_form(get_request('userid', null));
    } else {
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:users.php


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