• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CComboBox类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: newComboFilterArray

function newComboFilterArray($array, $name, $value)
{
    $cmbRange = new CComboBox($name, $value, 'javascript: submit();');
    $cmbRange->additem('', 'Selecione...');
    foreach ($array as $k => $v) {
        $cmbRange->additem($k, $v);
    }
    return $cmbRange;
}
开发者ID:zubayr,项目名称:zabbix-extras,代码行数:9,代码来源:zbxe_visual_imp.php


示例2: newComboAPI

function newComboAPI($Data, $keyField, $showField, $selected_value, $name, $reloadScript = 'javascript: submit();', $fristBlank = true)
{
    $cmbRange = new CComboBox($name, $selected_value, $reloadScript);
    if ($fristBlank == true) {
        $cmbRange->additem("0", "");
    }
    for ($i = 0; $i < count($Data); $i++) {
        $cmbRange->additem($Data[$i][$keyField], $Data[$i][$showField]);
    }
    return $cmbRange;
}
开发者ID:zubayr,项目名称:zabbix-extras,代码行数:11,代码来源:zbxe-ir.php


示例3: make_operation_box_footer

function make_operation_box_footer($hostids, $form_name)
{
    $box = new CComboBox("script");
    $hostScripts = API::Script()->getScriptsByHosts($hostids);
    $scripts = array();
    foreach ($hostScripts as $hostid => $hscripts) {
        foreach ($hscripts as $script) {
            if (!in_array($script, $scripts) && check_script($form_name, $script['name'])) {
                array_push($scripts, $script);
            }
        }
    }
    foreach ($scripts as $script) {
        $option = new CComboItem($script['scriptid'], $script['name']);
        $box->addItem($option);
    }
    $button = new CButton('execute', _('Execute'), "return executeScriptOnMultipleHosts('{$form_name}', 'script', 'hostids[]', 'Execute');");
    $button->setAttribute('id', 'executeButton');
    return array($box, $button);
}
开发者ID:sogaoh,项目名称:hyclops,代码行数:20,代码来源:additional_blocks_func.inc.php


示例4: md5

        if (isset($macrosData[$exprPart['expression']])) {
            continue;
        }
        $fname = 'test_data_' . md5($exprPart['expression']);
        $macrosData[$exprPart['expression']] = get_request($fname, '');
        $info = get_item_function_info($exprPart['expression']);
        if (!is_array($info) && isset($definedErrorPhrases[$info])) {
            $allowedTesting = false;
            $control = new CTextBox($fname, $macrosData[$exprPart['expression']], 30);
            $control->setAttribute('disabled', 'disabled');
        } else {
            $octet = $info['value_type'] == 'HHMMSS';
            $validation = $info['validation'];
            if (substr($validation, 0, COMBO_PATTERN_LENGTH) == COMBO_PATTERN) {
                $vals = explode(',', substr($validation, COMBO_PATTERN_LENGTH, zbx_strlen($validation) - COMBO_PATTERN_LENGTH - 4));
                $control = new CComboBox($fname, $macrosData[$exprPart['expression']]);
                foreach ($vals as $v) {
                    $control->addItem($v, $v);
                }
            } else {
                $control = new CTextBox($fname, $macrosData[$exprPart['expression']], 30);
            }
            $fields[$fname] = array($info['type'], O_OPT, null, $validation, 'isset({test_expression})', $exprPart['expression']);
        }
        $data_table->addRow(new CRow(array($exprPart['expression'], is_array($info) || !isset($definedErrorPhrases[$info]) ? $info['value_type'] : new CCol($definedErrorPhrases[$info], 'disaster'), $control)));
    }
}
//---------------------------------- CHECKS ------------------------------------
$fields['test_expression'] = array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null);
if (!check_fields($fields)) {
    $test = false;
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:tr_testexpr.php


示例5: dirname

**/
require_once dirname(__FILE__) . '/include/config.inc.php';
$page['title'] = _('Configuration of trigger displaying options');
$page['file'] = 'adm.triggerdisplayoptions.php';
$page['hist_arg'] = array();
require_once dirname(__FILE__) . '/include/page_header.php';
$fields = array('problem_unack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'problem_ack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'ok_unack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'ok_ack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'problem_unack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'problem_ack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'ok_unack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'ok_ack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'ok_period' => array(T_ZBX_INT, O_OPT, null, null, 'isset({save})'), 'blink_period' => array(T_ZBX_INT, O_OPT, null, null, 'isset({save})'), 'save' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'form' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form_refresh' => array(T_ZBX_INT, O_OPT, null, null, null));
check_fields($fields);
if (isset($_REQUEST['save'])) {
    $configs = array('ok_period' => get_request('ok_period'), 'blink_period' => get_request('blink_period'), 'problem_unack_color' => get_request('problem_unack_color'), 'problem_ack_color' => get_request('problem_ack_color'), 'ok_unack_color' => get_request('ok_unack_color'), 'ok_ack_color' => get_request('ok_ack_color'), 'problem_unack_style' => get_request('problem_unack_style', 0), 'problem_ack_style' => get_request('problem_ack_style', 0), 'ok_unack_style' => get_request('ok_unack_style', 0), 'ok_ack_style' => get_request('ok_ack_style', 0));
    $result = update_config($configs);
    show_messages($result, _('Configuration updated'), _('Cannot update configuration'));
}
$form = new CForm();
$form->cleanItems();
$cmbConf = new CComboBox('configDropDown', 'adm.triggerdisplayoptions.php', 'redirect(this.options[this.selectedIndex].value);');
$cmbConf->addItems(array('adm.gui.php' => _('GUI'), 'adm.housekeeper.php' => _('Housekeeping'), 'adm.images.php' => _('Images'), 'adm.iconmapping.php' => _('Icon mapping'), 'adm.regexps.php' => _('Regular expressions'), 'adm.macros.php' => _('Macros'), 'adm.valuemapping.php' => _('Value mapping'), 'adm.workingtime.php' => _('Working time'), 'adm.triggerseverities.php' => _('Trigger severities'), 'adm.triggerdisplayoptions.php' => _('Trigger displaying options'), 'adm.other.php' => _('Other')));
$form->addItem($cmbConf);
$cnf_wdgt = new CWidget();
$cnf_wdgt->addPageHeader(_('CONFIGURATION OF ZABBIX'), $form);
$data = array();
$data['form_refresh'] = get_request('form_refresh', 0);
// form has been submitted
if ($data['form_refresh']) {
    $data['ok_period'] = get_request('ok_period');
    $data['blink_period'] = get_request('blink_period');
    $data['problem_unack_color'] = get_request('problem_unack_color');
    $data['problem_ack_color'] = get_request('problem_ack_color');
    $data['ok_unack_color'] = get_request('ok_unack_color');
    $data['ok_ack_color'] = get_request('ok_ack_color');
    $data['problem_unack_style'] = get_request('problem_unack_style');
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:adm.triggerdisplayoptions.php


示例6: CCol

            $ack_cb_col = new CCol($ack_cb);
            $ack_cb_col->setColSpan(2);
            $row = new CRow(array(SPACE, $config['event_ack_enable'] ? $ack_cb_col : null, $status, $clock, zbx_date2age($row_event['clock']), zbx_date2age($next_clock, $row_event['clock']), $config['event_ack_enable'] ? $ack : NULL, is_show_all_nodes() ? SPACE : null, $empty_col), 'odd_row');
            $row->setAttribute('data-parentid', $trigger['triggerid']);
            $row->addStyle('display: none;');
            $table->addRow($row);
            if ($i > $config['event_show_max']) {
                break;
            }
        }
    }
}
//----- GO ------
$footer = null;
if ($config['event_ack_enable']) {
    $goBox = new CComboBox('go');
    $goBox->addItem('bulkacknowledge', S_BULK_ACKNOWLEDGE);
    // goButton name is necessary!!!
    $goButton = new CButton('goButton', S_GO . ' (0)');
    $goButton->setAttribute('id', 'goButton');
    $show_event_col ? zbx_add_post_js('chkbxRange.pageGoName = "events";') : zbx_add_post_js('chkbxRange.pageGoName = "triggers";');
    $footer = get_table_header(array($goBox, $goButton));
}
//----
$table = array($paging, $table, $paging, $footer);
$m_form->addItem($table);
$trigg_wdgt->addItem($m_form);
$trigg_wdgt->show();
zbx_add_post_js('blink.init();');
zbx_add_post_js("var switcher = new CSwitcher('{$switcherName}');");
$jsmenu = new CPUMenu(null, 170);
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:tr_status.php


示例7: CLink

                default:
                    $style = null;
                    $url = 'hosts.php?form=update&hostid=' . $hostid . '&groupid=' . $groupid;
                    break;
            }
            $hosts_output[] = new CLink($host['host'], $url, $style);
            $hosts_output[] = ', ';
        }
        array_pop($hosts_output);
        foreach ($group['hosts'] as $hostid => $host) {
            $host['status'] == HOST_STATUS_TEMPLATE ? $tpl_count++ : $host_count++;
        }
        $table->addRow(array(new CCheckBox('groups[' . $groupid . ']', NULL, NULL, $groupid), new CLink($group['name'], 'hostgroups.php?form=update&groupid=' . $groupid), array(array(new CLink(S_HOSTS, 'hosts.php?groupid=' . $groupid), ' (' . $host_count . ')'), BR(), array(new CLink(S_TEMPLATES, 'templates.php?groupid=' . $groupid, 'unknown'), ' (' . $tpl_count . ')')), new CCol(empty($hosts_output) ? '-' : $hosts_output, 'wraptext')));
    }
    $row_count = $table->getNumRows();
    //----- GO ------
    $goBox = new CComboBox('go');
    $goBox->addItem('activate', S_ACTIVATE_SELECTED);
    $goBox->addItem('disable', S_DISABLE_SELECTED);
    $goBox->addItem('delete', S_DELETE_SELECTED);
    // goButton name is necessary!!!
    $goButton = new CButton('goButton', S_GO . ' (0)');
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "groups";');
    $table->setFooter(new CCol(array($goBox, $goButton)));
    //----
    $form->addItem($table);
    $form->show();
    zbx_add_post_js('insert_in_element("numrows","' . $row_count . '");');
}
include_once 'include/page_footer.php';
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:hostgroups.php


示例8: unset

            $problemTrigger['description'] = $triggers[$problemTrigger['triggerid']]['description'];
        }
        unset($problemTrigger);
    }
    unset($serviceSla);
    $treeData = array();
    createServiceMonitoringTree($services, $slaData, $period, $treeData);
    $tree = new CServiceTree('service_status_tree', $treeData, array('caption' => _('Service'), 'status' => _('Status'), 'reason' => _('Reason'), 'sla' => _('Problem time'), 'sla2' => nbsp(_('SLA') . ' / ' . _('Acceptable SLA'))));
    if ($tree) {
        // creates form for choosing a preset interval
        $r_form = new CForm();
        $r_form->setAttribute('class', 'nowrap');
        $r_form->setMethod('get');
        $r_form->setAttribute('name', 'period_choice');
        $r_form->addVar('fullscreen', $_REQUEST['fullscreen']);
        $period_combo = new CComboBox('period', $period, 'javascript: submit();');
        foreach ($periods as $key => $val) {
            $period_combo->addItem($key, $val);
        }
        $r_form->addItem(array(_('Period') . SPACE, $period_combo));
        $srv_wdgt = new CWidget('hat_services', 'service-list service-mon');
        $srv_wdgt->addPageHeader(_('IT SERVICES'), get_icon('fullscreen', array('fullscreen' => $_REQUEST['fullscreen'])));
        $srv_wdgt->addHeader(_('IT services'), $r_form);
        $srv_wdgt->addItem(BR());
        $srv_wdgt->addItem($tree->getHTML());
        $srv_wdgt->show();
    } else {
        error(_('Cannot format Tree. Check logic structure in service links.'));
    }
}
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:srv_status.php


示例9: CCheckBox

// SPACE added to extend CB width in Chrome
$cbMain = new CCheckBox('maintenance', $maintenance, null, '1');
if (!$filterEnable) {
    $cbMain->setAttribute('disabled', 'disabled');
}
$dashForm->addRow(S_HOSTS, array($cbMain, S_SHOW_HOSTS_IN_MAINTENANCE));
// Trigger
$severity = zbx_toHash($severity);
$trgSeverities = array();
$severities = array(TRIGGER_SEVERITY_NOT_CLASSIFIED, TRIGGER_SEVERITY_INFORMATION, TRIGGER_SEVERITY_WARNING, TRIGGER_SEVERITY_AVERAGE, TRIGGER_SEVERITY_HIGH, TRIGGER_SEVERITY_DISASTER);
foreach ($severities as $snum => $sever) {
    $cb = new CCheckBox('trgSeverity[' . $sever . ']', isset($severity[$sever]), '', 1);
    $cb->setEnabled($filterEnable);
    $trgSeverities[] = array($cb, getSeverityCaption($sever));
    $trgSeverities[] = BR();
}
array_pop($trgSeverities);
$dashForm->addRow(S_TRIGGERS_WITH_SEVERITY, $trgSeverities);
$config = select_config();
$cb = new CComboBox('extAck', $extAck);
$cb->addItems(array(EXTACK_OPTION_ALL => S_O_ALL, EXTACK_OPTION_BOTH => S_O_SEPARATED, EXTACK_OPTION_UNACK => S_O_UNACKNOWLEDGED_ONLY));
$cb->setEnabled($filterEnable && $config['event_ack_enable']);
if (!$config['event_ack_enable']) {
    $cb->setAttribute('title', S_EVENT_ACKNOWLEDGING_DISABLED);
}
$dashForm->addRow(S_PROBLEM_DISPLAY, $cb);
//-----
$dashForm->addItemToBottomRow(new CButton('save', S_SAVE));
$dashboard_wdgt->addItem($dashForm);
$dashboard_wdgt->show();
include_once 'include/page_footer.php';
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:dashconf.php


示例10: array

$service = API::Service()->get(array('output' => array('serviceid', 'name', 'showsla', 'goodsla'), 'serviceids' => $_REQUEST['serviceid']));
$service = reset($service);
if (!$service) {
    access_deny();
}
$form = new CForm();
$form->setMethod('get');
$form->addVar('serviceid', $_REQUEST['serviceid']);
$cmbPeriod = new CComboBox('period', $period, 'submit();');
$cmbPeriod->addItem('daily', _('Daily'));
$cmbPeriod->addItem('weekly', _('Weekly'));
$cmbPeriod->addItem('monthly', _('Monthly'));
$cmbPeriod->addItem('yearly', _('Yearly'));
$form->addItem(array(SPACE . _('Period') . SPACE, $cmbPeriod));
if ($period != 'yearly') {
    $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 . _('Year') . SPACE, $cmbYear));
}
show_table_header(array(_('IT SERVICES AVAILABILITY REPORT'), SPACE . '"', new CLink($service['name'], 'srv_status.php?showgraph=1&serviceid=' . $service['serviceid']), '"'), $form);
$table = new CTableInfo();
$header = array(_('Ok'), _('Problems'), _('Downtime'), _('SLA'), _('Acceptable SLA'));
switch ($period) {
    case 'yearly':
        $from = date('Y') - YEAR_LEFT_SHIFT;
        $to = date('Y');
        array_unshift($header, new CCol(_('Year'), 'center'));
        function get_time($y)
        {
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:report3.php


示例11: CForm

$itemForm = new CForm();
$itemForm->setName('itemForm');
$itemForm->addVar('group_itemid', $this->data['group_itemid']);
$itemForm->addVar('hostid', $this->data['hostid']);
$itemForm->addVar('go', 'copy_to');
// create form list
$itemFormList = new CFormList('itemFormList');
// append type to form list
$copyTypeComboBox = new CComboBox('copy_type', $this->data['copy_type'], 'submit()');
$copyTypeComboBox->addItem(0, _('Hosts'));
$copyTypeComboBox->addItem(1, _('Host groups'));
$itemFormList->addRow(_('Target type'), $copyTypeComboBox);
// append targets to form list
$targetList = array();
if ($this->data['copy_type'] == 0) {
    $groupComboBox = new CComboBox('copy_groupid', $this->data['copy_groupid'], 'submit()');
    foreach ($this->data['groups'] as $group) {
        $groupComboBox->addItem($group['groupid'], $group['name']);
    }
    $itemFormList->addRow(_('Group'), $groupComboBox);
    foreach ($this->data['hosts'] as $host) {
        array_push($targetList, array(new CCheckBox('copy_targetid[' . $host['hostid'] . ']', uint_in_array($host['hostid'], $this->data['copy_targetid']), null, $host['hostid']), SPACE, $host['name'], BR()));
    }
} else {
    foreach ($this->data['groups'] as $group) {
        array_push($targetList, array(new CCheckBox('copy_targetid[' . $group['groupid'] . ']', uint_in_array($group['groupid'], $this->data['copy_targetid']), null, $group['groupid']), SPACE, $group['name'], BR()));
    }
}
$itemFormList->addRow(_('Target'), !empty($targetList) ? $targetList : SPACE);
// append tabs to form
$itemTab = new CTabView();
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:configuration.item.copy.php


示例12: while

while ($hostgroup = DBfetch($res)) {
    $hostsgroups[$hostgroup['hostid']] = $hostgroup['groupid'];
}
$params = array('nodeids' => get_current_nodeid(), 'pattern' => $search, 'extend_pattern' => true, 'count' => 1);
$hosts_count = CHost::get($params);
$overalCount = $hosts_count['rowscount'];
$viewCount = count($hosts);
$header = array(is_show_all_nodes() ? new CCol(S_NODE) : null, new CCol(S_HOSTS), new CCol(S_IP), new CCol(S_DNS), new CCol(S_LATEST_DATA), new CCol(S_TRIGGERS), new CCol(S_EVENTS), $admin ? new CCol(S_EDIT, 'center') : null);
$table = new CTableInfo();
$table->setHeader($header);
foreach ($hosts as $num => $host) {
    $hostid = $host['hostid'];
    $groupid = isset($hostsgroups[$hostid]) ? $hostsgroups[$hostid] : 0;
    $link = 'groupid=' . $groupid . '&hostid=' . $hostid;
    if ($admin) {
        $pageBox = new CComboBox('hostpages_' . $hostid);
        $pageBox->addItem('hosts.php?form=update&config=0&' . $link, S_HOST);
        $pageBox->addItem('items.php?' . $link, S_ITEMS);
        $pageBox->addItem('triggers.php?' . $link, S_TRIGGERS);
        $pageBox->addItem('graphs.php?' . $link, S_GRAPHS);
        $pageGo = new CButton('pagego', S_GO, "javascript: " . " redirect(\$('hostpages_{$hostid}').options[\$('hostpages_{$hostid}').selectedIndex].value);");
        $pageSelect = array($pageBox, SPACE, $pageGo);
    } else {
        $pageSelect = null;
    }
    $caption = make_decoration($host['host'], $search);
    $hostip = make_decoration($host['ip'], $search);
    $hostdns = make_decoration($host['dns'], $search);
    $table->addRow(array(get_node_name_by_elid($hostid), $caption, $hostip, $hostdns, new CLink(S_GO, 'latest.php?' . $link), new CLink(S_GO, 'tr_status.php?' . $link), new CLink(S_GO, 'events.php?' . $link), $pageSelect));
}
$table->setFooter(new CCol(S_DISPLAYING . SPACE . $viewCount . SPACE . S_OF_SMALL . SPACE . $overalCount . SPACE . S_FOUND_SMALL));
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:search.php


示例13: stage3

 function stage3()
 {
     $table = new CTable(null, 'requirements');
     $table->setAlign('center');
     $DB['TYPE'] = $this->getConfig('DB_TYPE');
     $cmbType = new CComboBox('type', $DB['TYPE'], 'this.form.submit();');
     $frontendSetup = new FrontendSetup();
     $databases = $frontendSetup->getSupportedDatabases();
     foreach ($databases as $id => $name) {
         $cmbType->addItem($id, $name);
     }
     $table->addRow(array(new CCol(_('Database type'), 'header'), $cmbType));
     switch ($DB['TYPE']) {
         case ZBX_DB_SQLITE3:
             $database = new CTextBox('database', $this->getConfig('DB_DATABASE', 'zabbix'));
             $database->attr('onchange', "disableSetupStepButton('#next_2')");
             $table->addRow(array(new CCol(_('Database file'), 'header'), $database));
             break;
         default:
             $server = new CTextBox('server', $this->getConfig('DB_SERVER', 'localhost'));
             $server->attr('onchange', "disableSetupStepButton('#next_2')");
             $table->addRow(array(new CCol(_('Database host'), 'header'), $server));
             $port = new CNumericBox('port', $this->getConfig('DB_PORT', '0'), 5, 'no', false, false);
             $port->attr('style', '');
             $port->attr('onchange', "disableSetupStepButton('#next_2'); validateNumericBox(this, 'false', 'false');");
             $table->addRow(array(new CCol(_('Database port'), 'header'), array($port, ' 0 - use default port')));
             $database = new CTextBox('database', $this->getConfig('DB_DATABASE', 'zabbix'));
             $database->attr('onchange', "disableSetupStepButton('#next_2')");
             $table->addRow(array(new CCol(_('Database name'), 'header'), $database));
             if ($DB['TYPE'] == ZBX_DB_DB2) {
                 $schema = new CTextBox('schema', $this->getConfig('DB_SCHEMA', ''));
                 $schema->attr('onchange', "disableSetupStepButton('#next_2')");
                 $table->addRow(array(new CCol(_('Database schema'), 'header'), $schema));
             }
             $user = new CTextBox('user', $this->getConfig('DB_USER', 'root'));
             $user->attr('onchange', "disableSetupStepButton('#next_2')");
             $table->addRow(array(new CCol(_('User'), 'header'), $user));
             $password = new CPassBox('password', $this->getConfig('DB_PASSWORD', ''));
             $password->attr('onchange', "disableSetupStepButton('#next_2')");
             $table->addRow(array(new CCol(_('Password'), 'header'), $password));
             break;
     }
     global $ZBX_MESSAGES;
     if (!empty($ZBX_MESSAGES)) {
         $lst_error = new CList(null, 'messages');
         foreach ($ZBX_MESSAGES as $msg) {
             $lst_error->addItem($msg['message'], $msg['type']);
         }
         $table = array($table, $lst_error);
     }
     return array(new CDiv(new CDiv(array('Please create database manually, and set the configuration parameters for connection to this database.', BR(), BR(), 'Press "Test connection" button when done.', BR(), $table), 'vertical_center'), 'table_wraper'), new CDiv(array(isset($_REQUEST['retry']) ? !$this->DISABLE_NEXT_BUTTON ? new CSpan(array(_('OK'), BR()), 'ok') : new CSpan(array(_('Fail'), BR()), 'fail') : null, new CSubmit('retry', 'Test connection')), 'info_bar'));
 }
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:52,代码来源:setup.inc.php


示例14: array

        if (!str_in_array($new_opcondition['conditiontype'], $allowedOpConditions)) {
            $new_opcondition['conditiontype'] = $allowedOpConditions[0];
        }
        $rowCondition = array();
        $conditionTypeComboBox = new CComboBox('new_opcondition[conditiontype]', $new_opcondition['conditiontype'], 'submit()');
        foreach ($allowedOpConditions as $opcondition) {
            $conditionTypeComboBox->addItem($opcondition, condition_type2str($opcondition));
        }
        array_push($rowCondition, $conditionTypeComboBox);
        $operationConditionComboBox = new CComboBox('new_opcondition[operator]');
        foreach (get_operators_by_conditiontype($new_opcondition['conditiontype']) as $operationCondition) {
            $operationConditionComboBox->addItem($operationCondition, condition_operator2str($operationCondition));
        }
        array_push($rowCondition, $operationConditionComboBox);
        if ($new_opcondition['conditiontype'] == CONDITION_TYPE_EVENT_ACKNOWLEDGED) {
            $operationConditionValueComboBox = new CComboBox('new_opcondition[value]', $new_opcondition['value']);
            $operationConditionValueComboBox->addItem(0, _('Not Ack'));
            $operationConditionValueComboBox->addItem(1, _('Ack'));
            $rowCondition[] = $operationConditionValueComboBox;
        }
        $newOperationConditionTable->addRow($rowCondition);
        $newOperationConditionFooter = array(new CSubmit('add_opcondition', _('Add'), null, 'link_menu'), SPACE . SPACE, new CSubmit('cancel_new_opcondition', _('Cancel'), null, 'link_menu'));
        $newOperationsTable->addRow(array(_('Operation condition'), new CDiv(array($newOperationConditionTable, $newOperationConditionFooter), 'objectgroup inlineblock border_dotted ui-corner-all')));
    }
    $footer = array(new CSubmit('add_operation', $this->data['new_operation']['action'] == 'update' ? _('Update') : _('Add'), null, 'link_menu'), SPACE . SPACE, new CSubmit('cancel_new_operation', _('Cancel'), null, 'link_menu'));
    $operationFormList->addRow(_('Operation details'), new CDiv(array($newOperationsTable, $footer), 'objectgroup inlineblock border_dotted ui-corner-all'));
}
// append tabs to form
$actionTabs = new CTabView();
if (!isset($_REQUEST['form_refresh'])) {
    $actionTabs->setSelected(0);
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:configuration.action.edit.php


示例15: CComboBox

** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
// header
$imageComboBox = new CComboBox('imagetype', $this->data['imagetype'], 'submit();');
$imageComboBox->addItem(IMAGE_TYPE_ICON, _('Icon'));
$imageComboBox->addItem(IMAGE_TYPE_BACKGROUND, _('Background'));
$imageComboBoxForm = new CForm();
$imageComboBoxForm->addItem(_('Type') . SPACE);
$imageComboBoxForm->addItem($imageComboBox);
$this->data['widget']->addHeader(_('Images'), $imageComboBoxForm);
// form
$imageForm = new CForm();
$imageForm->setName('imageForm');
$imageForm->addItem(BR());
$imageTable = new CTable(_('No images found.'), 'header_wide padding_standard');
$count = 0;
$imageRow = new CRow();
foreach ($this->data['images'] as $image) {
    $img = $image['imagetype'] == IMAGE_TYPE_BACKGROUND ? new CLink(new CImg('imgstore.php?width=200&height=200&iconid=' . $image['imageid'], 'no image'), 'image.php?imageid=' . $image['imageid']) : new CImg('imgstore.php?iconid=' . $image['imageid'], 'no image');
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:administration.general.image.list.php


示例16: DBfetch

 $frmCnct->SetHelp("web.sysmap.connector.php");
 $frmCnct->AddVar("dstfrm", $_REQUEST["dstfrm"]);
 if (isset($_REQUEST["linkid"]) && isset($_REQUEST['triggerid'])) {
     $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();
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:popup_link_tr.php


示例17: CWidget

** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
$hostInventoryWidget = new CWidget();
$rForm = new CForm('get');
$rForm->addItem(array(_('Group'), SPACE, $this->data['pageFilter']->getGroupsCB()));
$hostInventoryWidget->addPageHeader(_('HOST INVENTORY'), SPACE);
$hostInventoryWidget->addHeader(_('Hosts'), $rForm);
$filterTable = new CTable('', 'filter filter-center');
// getting inventory fields to make a drop down
$inventoryFields = getHostInventories(true);
// 'true' means list should be ordered by title
$inventoryFieldsComboBox = new CComboBox('filter_field', $this->data['filterField']);
foreach ($inventoryFields as $inventoryField) {
    $inventoryFieldsComboBox->addItem($inventoryField['db_field'], $inventoryField['title']);
}
$exactComboBox = new CComboBox('filter_exact', $this->data['filterExact']);
$exactComboBox->addItem('0', _('like'));
$exactComboBox->addItem('1', _('exactly'));
$filterTable->addRow(array(array(array(bold(_('Field')), SPACE, $inventoryFieldsComboBox), array($exactComboBox, new CTextBox('filter_field_value', $this->data['filterFieldValue'], 20)))), 'host-inventories');
$filter = new CSubmit('filter_set', _('Filter'));
$filter->useJQueryStyle('main');
$reset = new CSubmit('filter_rst', _('Reset'));
$reset->useJQueryStyle();
$divButtons = new CDiv(array($filter, SPACE, $reset));
$divButtons->setAttribute('style', 'padding: 4px 0px;');
$footerCol = new CCol($divButtons, 'controls');
$filterTable->addRow($footerCol);
$filterForm = new CForm('get');
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$filterForm->addItem($filterTable);
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:inventory.host.list.php


示例18: dirname

** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/triggers.inc.php';
$page['title'] = _('Most busy triggers top 100');
$page['file'] = 'report5.php';
$page['hist_arg'] = array('period');
require_once dirname(__FILE__) . '/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);
$rprt_wdgt = new CWidget();
$_REQUEST['period'] = getRequest('period', 'day');
$admin_links = CWebUser::$data['type'] == USER_TYPE_ZABBIX_ADMIN || CWebUser::$data['type'] == USER_TYPE_SUPER_ADMIN;
$form = new CForm('get');
$cmbPeriod = new CComboBox('period', $_REQUEST['period'], 'submit()');
$cmbPeriod->addItem('day', _('Day'));
$cmbPeriod->addItem('week', _('Week'));
$cmbPeriod->addItem('month', _('Month'));
$cmbPeriod->addItem('year', _('Year'));
$form->addItem($cmbPeriod);
$rprt_wdgt->addPageHeader(_('MOST BUSY TRIGGERS TOP 100'));
$rprt_wdgt->addHeader(_('Report'), $form);
$rprt_wdgt->addItem(BR());
$table = new CTableInfo(_('No triggers found.'));
$table->setHeader(array(_('Host'), _('Trigger'), _('Severity'), _('Number of status changes')));
switch ($_REQUEST['period']) {
    case 'week':
        $time_dif = SEC_PER_WEEK;
        break;
    case 'month':
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:report5.php


示例19: insert_map_form

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)) {
        if (!sysmap_accessible($row["sysmapid"], PERM_READ_WRITE)) {
            continue;
        }
        $table->AddRow(array(new CCheckBox('maps[' . $row['sysmapid'] . ']', NULL, NULL, $row['sysmapid']), new CLink($row["name"], "sysmaps.php?form=update" . "&sysmapid=" . $row["sysmapid"] . "#form", 'action'), $row["width"], $row["height"], new CLink(S_EDIT, "sysmap.php?sysmapid=" . $row["sysmapid"])));
    }
    //----- GO ------
    $goBox = new CComboBox('go');
    $goBox->addItem('delete', S_DELETE_SELECTED);
    // goButton name is necessary!!!
    $goButton = new CButton('goButton', S_GO . ' (0)');
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "maps";');
    $table->setFooter(new CCol(array($goBox, $goButton)));
    $form->addItem($table);
    $form->show();
    zbx_add_post_js('insert_in_element("numrows","' . $table->getNumRows() . '");');
}
include_once "include/page_footer.php";
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:sysmaps.php


示例20: array

$page["title"] = "S_QUEUE_BIG";
$page["file"] = "queue.php";
$page['hist_arg'] = array('show');
define('ZBX_PAGE_DO_REFRESH', 1);
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;
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:queue.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CComboItem类代码示例发布时间:2022-05-23
下一篇:
PHP CCol类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap