當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CTextBox::setAttribute方法代碼示例

本文整理匯總了PHP中CTextBox::setAttribute方法的典型用法代碼示例。如果您正苦於以下問題:PHP CTextBox::setAttribute方法的具體用法?PHP CTextBox::setAttribute怎麽用?PHP CTextBox::setAttribute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CTextBox的用法示例。


在下文中一共展示了CTextBox::setAttribute方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct($name, $value)
 {
     parent::__construct();
     $lbl = new CColorCell('lbl_' . $name, $value, "show_color_picker('" . $name . "')");
     $txt = new CTextBox($name, $value, 7);
     $txt->setAttribute('maxlength', 6);
     $txt->setAttribute('id', $name);
     $txt->addAction('onchange', "set_color_by_name('" . $name . "',this.value)");
     $txt->setAttribute('style', 'margin-top: 0px; margin-bottom: 0px');
     $this->addItem(array($txt, $lbl));
     insert_show_color_picker_javascript();
 }
開發者ID:phedders,項目名稱:zabbix,代碼行數:12,代碼來源:class.ccolor.php

示例2: CComboBox

// append inventories to form list
$inventoryModesComboBox = new CComboBox('inventory_mode', $this->data['inventory_mode'], 'submit()');
$inventoryModesComboBox->addItem(HOST_INVENTORY_DISABLED, _('Disabled'));
$inventoryModesComboBox->addItem(HOST_INVENTORY_MANUAL, _('Manual'));
$inventoryModesComboBox->addItem(HOST_INVENTORY_AUTOMATIC, _('Automatic'));
$hostFormList->addRow(array(_('Inventory mode'), SPACE, new CVisibilityBox('visible[inventory_mode]', isset($this->data['visible']['inventory_mode']), 'inventory_mode', _('Original'))), $inventoryModesComboBox);
$hostInventoryTable = DB::getSchema('host_inventory');
if ($this->data['inventory_mode'] != HOST_INVENTORY_DISABLED) {
    foreach ($this->data['inventories'] as $field => $fieldInfo) {
        if (!isset($this->data['host_inventory'][$field])) {
            $this->data['host_inventory'][$field] = '';
        }
        if ($hostInventoryTable['fields'][$field]['type'] == DB::FIELD_TYPE_TEXT) {
            $fieldInput = new CTextArea('host_inventory[' . $field . ']', $this->data['host_inventory'][$field]);
            $fieldInput->addStyle('width: 64em;');
        } else {
            $fieldLength = $hostInventoryTable['fields'][$field]['length'];
            $fieldInput = new CTextBox('host_inventory[' . $field . ']', $this->data['host_inventory'][$field]);
            $fieldInput->setAttribute('maxlength', $fieldLength);
            $fieldInput->addStyle('width: ' . ($fieldLength > 64 ? 64 : $fieldLength) . 'em;');
        }
        $hostFormList->addRow(array($fieldInfo['title'], SPACE, new CVisibilityBox('visible[' . $field . ']', isset($this->data['visible'][$field]), 'host_inventory[' . $field . ']', _('Original'))), $fieldInput);
    }
}
// append tabs to form
$hostTab = new CTabView();
$hostTab->addTab('hostTab', _('Mass update'), $hostFormList);
$hostForm->addItem($hostTab);
// append buttons to form
$hostForm->addItem(makeFormFooter(new CSubmit('masssave', _('Update')), new CButtonCancel(url_param('groupid'))));
return $hostForm;
開發者ID:quanta-computing,項目名稱:debian-packages,代碼行數:31,代碼來源:configuration.host.massupdate.php

示例3: CCheckBox

// status
$httpFormList->addRow(_('Enabled'), new CCheckBox('status', !$this->data['status']));
/*
 * Authentication tab
 */
$httpAuthenticationFormList = new CFormList('httpAuthenticationFormList');
// Authentication type
$authenticationComboBox = new CComboBox('authentication', $this->data['authentication']);
$authenticationComboBox->addItems(httptest_authentications());
$httpAuthenticationFormList->addRow(_('HTTP authentication'), $authenticationComboBox);
$httpAuthenticationUserTB = new CTextBox('http_user', $this->data['http_user'], ZBX_TEXTBOX_STANDARD_SIZE, false, 64);
$httpAuthenticationPasswordTB = new CTextBox('http_password', $this->data['http_password'], ZBX_TEXTBOX_STANDARD_SIZE, false, 64);
$authenticationInputsHidden = $this->data['authentication'] == HTTPTEST_AUTH_NONE;
if ($authenticationInputsHidden) {
    $httpAuthenticationUserTB->setAttribute('disabled', true);
    $httpAuthenticationPasswordTB->setAttribute('disabled', true);
}
$httpAuthenticationFormList->addRow(_('User'), $httpAuthenticationUserTB, $authenticationInputsHidden);
$httpAuthenticationFormList->addRow(_('Password'), $httpAuthenticationPasswordTB, $authenticationInputsHidden);
// SSL verify peer checkbox
$httpAuthenticationFormList->addRow(_('SSL verify peer'), new CCheckBox('verify_peer', $this->data['verify_peer']));
// SSL verify host checkbox
$httpAuthenticationFormList->addRow(_('SSL verify host'), new CCheckBox('verify_host', $this->data['verify_host']));
// SSL certificate file
$httpAuthenticationFormList->addRow(_('SSL certificate file'), new CTextBox('ssl_cert_file', $this->data['ssl_cert_file'], ZBX_TEXTBOX_STANDARD_SIZE, false, 255));
// SSL key file
$httpAuthenticationFormList->addRow(_('SSL key file'), new CTextBox('ssl_key_file', $this->data['ssl_key_file'], ZBX_TEXTBOX_STANDARD_SIZE, false, 255));
// SSL key password
$httpAuthenticationFormList->addRow(_('SSL key password'), new CTextBox('ssl_key_password', $this->data['ssl_key_password'], ZBX_TEXTBOX_STANDARD_SIZE, false, 64));
/*
 * Step tab
開發者ID:TonywalkerCN,項目名稱:Zabbix,代碼行數:31,代碼來源:configuration.httpconf.edit.php

示例4: array

$severityTab->addRow(_('Information'), array($severityNameTB1, SPACE, $severityColorTB1));
$severityNameTB2 = new CTextBox('severity_name_2', $this->data['config']['severity_name_2']);
$severityNameTB2->addStyle('width: 15em;');
$severityNameTB2->setAttribute('maxlength', 32);
$severityColorTB2 = new CColor('severity_color_2', $this->data['config']['severity_color_2']);
$severityTab->addRow(_('Warning'), array($severityNameTB2, SPACE, $severityColorTB2));
$severityNameTB3 = new CTextBox('severity_name_3', $this->data['config']['severity_name_3']);
$severityNameTB3->addStyle('width: 15em;');
$severityNameTB3->setAttribute('maxlength', 32);
$severityColorTB3 = new CColor('severity_color_3', $this->data['config']['severity_color_3']);
$severityTab->addRow(_('Average'), array($severityNameTB3, SPACE, $severityColorTB3));
$severityNameTB4 = new CTextBox('severity_name_4', $this->data['config']['severity_name_4']);
$severityNameTB4->addStyle('width: 15em;');
$severityNameTB4->setAttribute('maxlength', 32);
$severityColorTB4 = new CColor('severity_color_4', $this->data['config']['severity_color_4']);
$severityTab->addRow(_('High'), array($severityNameTB4, SPACE, $severityColorTB4));
$severityNameTB5 = new CTextBox('severity_name_5', $this->data['config']['severity_name_5']);
$severityNameTB5->addStyle('width: 15em;');
$severityNameTB5->setAttribute('maxlength', 32);
$severityColorTB5 = new CColor('severity_color_5', $this->data['config']['severity_color_5']);
$severityTab->addRow(_('Disaster'), array($severityNameTB5, SPACE, $severityColorTB5));
$severityTab->addRow(SPACE);
$severityTab->addInfo(_('Custom severity names affect all locales and require manual translation!'));
$severityView = new CTabView();
$severityView->addTab('severities', _('Trigger severities'), $severityTab);
$severityForm = new CForm();
$severityForm->setName('triggerSeverity');
$severityForm->addVar('form_refresh', $this->data['form_refresh'] + 1);
$severityForm->addItem($severityView);
$severityForm->addItem(makeFormFooter(array(new CSubmit('save', _('Save'))), new CButton('resetDefaults', _('Reset defaults'))));
return $severityForm;
開發者ID:quanta-computing,項目名稱:debian-packages,代碼行數:31,代碼來源:administration.general.triggerSeverity.edit.php

示例5: array

$inventoryAutomaticBtn->setEnabled(!$isDiscovered);
$inventoryTypeRadioButton = array($inventoryDisabledBtn, new CLabel(_('Disabled'), 'host_inventory_radio_' . HOST_INVENTORY_DISABLED), $inventoryManualBtn, new CLabel(_('Manual'), 'host_inventory_radio_' . HOST_INVENTORY_MANUAL), $inventoryAutomaticBtn, new CLabel(_('Automatic'), 'host_inventory_radio_' . HOST_INVENTORY_AUTOMATIC));
$inventoryFormList->addRow(SPACE, new CDiv($inventoryTypeRadioButton, 'jqueryinputset'));
$hostInventoryTable = DB::getSchema('host_inventory');
$hostInventoryFields = getHostInventories();
foreach ($hostInventoryFields as $inventoryNo => $inventoryInfo) {
    if (!isset($host_inventory[$inventoryInfo['db_field']])) {
        $host_inventory[$inventoryInfo['db_field']] = '';
    }
    if ($hostInventoryTable['fields'][$inventoryInfo['db_field']]['type'] == DB::FIELD_TYPE_TEXT) {
        $input = new CTextArea('host_inventory[' . $inventoryInfo['db_field'] . ']', $host_inventory[$inventoryInfo['db_field']]);
        $input->addStyle('width: 64em;');
    } else {
        $fieldLength = $hostInventoryTable['fields'][$inventoryInfo['db_field']]['length'];
        $input = new CTextBox('host_inventory[' . $inventoryInfo['db_field'] . ']', $host_inventory[$inventoryInfo['db_field']]);
        $input->setAttribute('maxlength', $fieldLength);
        $input->addStyle('width: ' . ($fieldLength > 64 ? 64 : $fieldLength) . 'em;');
    }
    if ($inventory_mode == HOST_INVENTORY_DISABLED) {
        $input->setAttribute('disabled', 'disabled');
    }
    // link to populating item at the right side (if any)
    if (isset($hostItemsToInventory[$inventoryNo])) {
        $itemName = itemName($hostItemsToInventory[$inventoryNo]);
        $populatingLink = new CLink($itemName, 'items.php?form=update&itemid=' . $hostItemsToInventory[$inventoryNo]['itemid']);
        $populatingLink->setAttribute('title', _s('This field is automatically populated by item "%s".', $itemName));
        $populatingItemCell = array(' ← ', $populatingLink);
        $input->addClass('linked_to_item');
        // this will be used for disabling fields via jquery
        if ($inventory_mode == HOST_INVENTORY_AUTOMATIC) {
            $input->setAttribute('disabled', 'disabled');
開發者ID:SandipSingh14,項目名稱:Zabbix_,代碼行數:31,代碼來源:configuration.host.edit.php

示例6: foreach

            $group_tb->addItem($group['groupid'], $group['name']);
        }
    }
} else {
    /*
     * When cloning a template or creating a new one, don't show read-only host groups in left box
     * show empty or posted groups in case of an error.
     */
    foreach ($groupsAllowed as $group) {
        $group_tb->addItem($group['groupid'], $group['name']);
    }
}
$templateList->addRow(_('Groups'), $group_tb->get(_('In groups'), _('Other groups')));
// FORM ITEM : new group text box [  ]
$newgroupTB = new CTextBox('newgroup', $newgroup);
$newgroupTB->setAttribute('maxlength', 64);
$tmp_label = _('New group');
if (CWebUser::$data['type'] != USER_TYPE_SUPER_ADMIN) {
    $tmp_label .= SPACE . _('(Only super admins can create groups)');
    $newgroupTB->setReadonly(true);
}
$templateList->addRow(SPACE, array($tmp_label, BR(), $newgroupTB), null, null, 'new');
// FORM ITEM : linked Hosts tween box [  ] [  ]
$twb_groupid = get_request('twb_groupid', 0);
if ($twb_groupid == 0) {
    $gr = reset($groupsAllowed);
    $twb_groupid = $gr['groupid'];
}
$cmbGroups = new CComboBox('twb_groupid', $twb_groupid, 'submit()');
foreach ($groupsAllowed as $group) {
    $cmbGroups->addItem($group['groupid'], $group['name']);
開發者ID:itnihao,項目名稱:zatree-2.2,代碼行數:31,代碼來源:configuration.template.edit.php

示例7: CDiv

        } else {
            $sub_menu_div->setAttribute('style', 'display: none;');
        }
        $menu_divs[] = $sub_menu_div;
    }
    $sub_menu_div = new CDiv(SPACE);
    $sub_menu_div->setAttribute('id', 'sub_empty');
    $sub_menu_div->setAttribute('style', 'display: ' . ($menu_selected ? 'none;' : 'block;'));
    $menu_divs[] = $sub_menu_div;
    $search_div = null;
    if ($page['file'] != 'index.php' && $USER_DETAILS['userid'] > 0) {
        $search_form = new CForm('search.php');
        $search_form->setMethod('get');
        $search_form->setAttribute('class', 'thin');
        $searchBox = new CTextBox('search', get_request('search', ''));
        $searchBox->setAttribute('autocomplete', 'off');
        $searchBox->setAttribute('style', 'width: 160px;');
        $search_form->addItem(new CDiv(array(S_SEARCH_BIG . ': ', $searchBox)));
        $search_div = new CDiv($search_form);
        $search_div->setAttribute('id', 'zbx_search');
        $search_div->setAttribute('class', 'zbx_search');
        zbx_add_post_js("var sid = createSuggest('search');");
    }
    $sub_menu_table->addRow(array($menu_divs, $search_div));
    $page_menu->addItem($sub_menu_table);
    //---
    $page_menu->show();
}
//------------------------------------- <HISTORY> ---------------------------------------
if (isset($page['hist_arg']) && $USER_DETAILS['alias'] != ZBX_GUEST_USER && $page['type'] == PAGE_TYPE_HTML && !defined('ZBX_PAGE_NO_MENU')) {
    $table = new CTable();
開發者ID:songyuanjie,項目名稱:zabbix-stats,代碼行數:31,代碼來源:page_header.php

示例8: interval

// update interval
$httpFormList->addRow(_('Update interval (in sec)'), new CNumericBox('delay', $this->data['delay'], 5));
// number of retries
$httpFormList->addRow(_('Retries'), new CNumericBox('retries', $this->data['retries'], 2));
// append http agents to form list - http://www.useragentstring.com
$agentComboBox = new CEditableComboBox('agent', $this->data['agent'], ZBX_TEXTBOX_STANDARD_SIZE);
$agentComboBox->addItemsInGroup(_('Internet Explorer'), array('Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)' => 'Internet Explorer 10.0', 'Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)' => 'Internet Explorer 9.0', 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 1.0.3705; .NET CLR 1.1.4322)' => 'Internet Explorer 8.0', 'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)' => 'Internet Explorer 7.0', 'Mozilla/5.0 (compatible; MSIE 6.0; Windows NT 5.1)' => 'Internet Explorer 6.0'));
$agentComboBox->addItemsInGroup(_('Mozilla Firefox'), array('Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20100101 Firefox/8.0' => 'Mozilla Firefox 8.0', 'Mozilla/5.0 (X11; Linux i686; rv:7.0) Gecko/20100101 Firefox/7.0' => 'Mozilla Firefox 7.0', 'Mozilla/5.0 (X11; Linux i686; rv:6.0) Gecko/20100101 Firefox/6.0' => 'Mozilla Firefox 6.0', 'Mozilla/5.0 (X11; U; Linux i586; de; rv:5.0) Gecko/20100101 Firefox/5.0' => 'Mozilla Firefox 5.0', 'Mozilla/5.0 (X11; U; Linux x86_64; pl-PL; rv:2.0) Gecko/20110307 Firefox/4.0' => 'Mozilla Firefox 4.0', 'Mozilla/6.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:2.0.0.0) Gecko/20061028 Firefox/3.0' => 'Mozilla Firefox 3.0', 'Mozilla/5.0 (X11;U;Linux i686;en-US;rv:1.8.1) Gecko/2006101022 Firefox/2.0' => 'Mozilla Firefox 2.0'));
$agentComboBox->addItemsInGroup(_('Opera'), array('Opera/9.80 (Windows NT 6.1; U; es-ES) Presto/2.9.181 Version/12.00' => 'Opera 12.00', 'Opera/9.80 (X11; Linux x86_64; U; pl) Presto/2.7.62 Version/11.00' => 'Opera 11.00', 'Opera/9.80 (X11; Linux x86_64; U; en) Presto/2.2.15 Version/10.00' => 'Opera 10.00', 'Opera/9.00 (X11; Linux i686; U; pl)' => 'Opera 9.00'));
$agentComboBox->addItemsInGroup(_('Safari'), array('Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+' => 'Safari 5.0', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; ru-RU) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16' => 'Safari 4.0', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; sv-SE) AppleWebKit/523.13 (KHTML, like Gecko) Version/3.0 Safari/523.13' => 'Safari 3.0', 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_1 like Mac OS X; fr-fr) AppleWebKit/525.18.1 (KHTML, like Gecko) Mobile/5F136' => 'Safari on iPhone'));
$agentComboBox->addItemsInGroup(_('Google Chrome'), array('Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.8 (KHTML, like Gecko) Chrome/17.0.940.0 Safari/535.8' => 'Google Chrome 17', 'Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.36 Safari/535.7' => 'Google Chrome 16', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.872.0 Safari/535.2' => 'Google Chrome 15', 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Ubuntu/11.04 Chromium/14.0.825.0 Chrome/14.0.825.0 Safari/535.1' => 'Google Chrome 14', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_3) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.32 Safari/535.1' => 'Google Chrome 13', 'Mozilla/5.0 (Windows NT 6.1; en-US) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.750.0 Safari/534.30' => 'Google Chrome 12'));
$agentComboBox->addItemsInGroup(_('Others'), array('Mozilla/5.0 (X11; Linux 3.1.0-rc9+; en_US) KHTML/4.7.2 (like Gecko) Konqueror/4.7' => 'Konqueror 4.7', 'Mozilla/5.0 (compatible; Konqueror/4.6; Linux) KHTML/4.6.0 (like Gecko)' => 'Konqueror 4.6', 'Lynx/2.8.7rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8r' => 'Lynx 2.8.7rel.1', 'Lynx/2.8.4rel.1 libwww-FM/2.14' => 'Lynx 2.8.4rel.1', 'Links (2.3pre1; Linux 2.6.35.10 i686; 225x51)' => 'Links 2.3pre1', 'Links (2.2; Linux 2.6.37.6-0.7-desktop i686; 225x51)' => 'Links 2.2', 'Googlebot/2.1 (+http://www.google.com/bot.html)' => 'Googlebot'));
$httpFormList->addRow(_('Agent'), $agentComboBox);
// append HTTP proxy to form list
$httpProxyTextBox = new CTextBox('http_proxy', $this->data['http_proxy'], ZBX_TEXTBOX_STANDARD_SIZE, 'no', 255);
$httpProxyTextBox->setAttribute('placeholder', 'http://[username[:password]@]proxy.example.com[:port]');
$httpFormList->addRow(_('HTTP proxy'), $httpProxyTextBox);
// append status to form list
$httpFormList->addRow(_('Variables'), new CTextArea('variables', $this->data['variables']));
$httpFormList->addRow(_('Enabled'), new CCheckBox('status', !$this->data['status']));
/*
 * Step tab
 */
$httpStepFormList = new CFormList('httpFormList');
$stepsTable = new CTable(null, 'formElementTable');
$stepsTable->setAttributes(array('style' => 'min-width: 500px;', 'id' => 'httpStepTable'));
$stepsTable->setHeader(array(new CCol(SPACE, null, null, '15'), new CCol(SPACE, null, null, '15'), new CCol(_('Name'), null, null, '150'), new CCol(_('Timeout'), null, null, '50'), new CCol(_('URL'), null, null, '200'), new CCol(_('Required'), null, null, '50'), new CCol(_('Status codes'), 'nowrap', null, '90'), new CCol('', null, null, '50')));
$i = 1;
foreach ($this->data['steps'] as $stepid => $step) {
    if (!isset($step['name'])) {
        $step['name'] = '';
開發者ID:itnihao,項目名稱:zatree-2.2,代碼行數:31,代碼來源:configuration.httpconf.edit.php

示例9: array

    $conditions = array(array('macro' => '', 'value' => '', 'formulaid' => num2letter(0)));
} else {
    $conditions = CConditionHelper::sortConditionsByFormulaId($conditions);
}
// fields
foreach ($conditions as $i => $condition) {
    // formula id
    $formulaId = array(new CSpan($condition['formulaid']), new CVar('conditions[' . $i . '][formulaid]', $condition['formulaid']));
    // macro
    $macro = new CTextBox('conditions[' . $i . '][macro]', $condition['macro'], 30, false, 64);
    $macro->addClass('macro');
    $macro->setAttribute('placeholder', '{#MACRO}');
    $macro->setAttribute('data-formulaid', $condition['formulaid']);
    // value
    $value = new CTextBox('conditions[' . $i . '][value]', $condition['value'], 40, false, 255);
    $value->setAttribute('placeholder', _('regular expression'));
    // delete button
    $deleteButtonCell = array(new CButton('conditions_' . $i . '_remove', _('Remove'), null, 'link_menu element-table-remove'));
    $row = array($formulaId, $macro, new CSpan(_('matches')), $value, $deleteButtonCell);
    $conditionTable->addRow($row, 'form_row');
}
$addButton = new CButton('macro_add', _('Add'), null, 'link_menu element-table-add');
$buttonColumn = new CCol($addButton);
$buttonColumn->setAttribute('colspan', 5);
$buttonRow = new CRow();
$buttonRow->setAttribute('id', 'row_new_macro');
$buttonRow->addItem($buttonColumn);
$conditionTable->addRow($buttonRow);
$conditionFormList->addRow(_('Filters'), new CDiv($conditionTable, 'objectgroup inlineblock border_dotted ui-corner-all'));
// append tabs to form
$itemTab = new CTabView();
開發者ID:omidmt,項目名稱:zabbix-greenplum,代碼行數:31,代碼來源:configuration.host.discovery.edit.php

示例10: CTable

 $item_params_tbl = new CTable();
 $item_params_tbl->attr('class', 'formtable');
 $item_params_tbl->addStyle("width: 100%; align: left");
 $item_params_tbl->addRow(array(_('Interval') . ':', $itemDelay, _('History') . ':', $itemHistory, _('Trends') . ':', $itemTrends));
 $item_params_div->addItem($item_params_tbl);
 $item_params_w->addItem($item_params_div);
 $right_tab->addRow($empty_row);
 $right_tab->addRow($item_params_w);
 // Graph parameters
 $graphCreate = new CCheckBox('graph_create', 'no', '', 1);
 $graphName = new CTextBox('graph_name', $graph_name);
 $graphWidth = new CTextBox('graph_width', $graph_width);
 $graphWidth->setAttribute("size", "5");
 $graphWidth->setAttribute("maxlength", "5");
 $graphHeight = new CTextBox('graph_height', $graph_height);
 $graphHeight->setAttribute("size", "5");
 $graphHeight->setAttribute("maxlength", "5");
 // Graph type selector
 $cmbGraphType = new CComboBox('graph_type', $graph_type);
 $cmbGraphType->addItem(GRAPH_TYPE_NORMAL, _('Normal'));
 $cmbGraphType->addItem(GRAPH_TYPE_STACKED, _('Stacked'));
 $cmbGraphType->addItem(GRAPH_TYPE_PIE, _('Pie'));
 $cmbGraphType->addItem(GRAPH_TYPE_EXPLODED, _('Exploded'));
 // Graph function selector
 $cmbGraphFunc = new CComboBox('graph_func', $graph_func);
 foreach (array(CALC_FNC_ALL, CALC_FNC_MIN, CALC_FNC_AVG, CALC_FNC_MAX) as $func) {
     $cmbGraphFunc->addItem($func, graph_item_calc_fnc2str($func));
 }
 // Draw type selector
 $cmbDrawType = new CComboBox('draw_type', $draw_type);
 foreach (graph_item_drawtypes() as $dt) {
開發者ID:SandipSingh14,項目名稱:Zabbix_,代碼行數:31,代碼來源:snmp_builder.php

示例11: array

     $linktrigger = get_request('linktrigger', 0);
     //links
     $parentid = get_request('parentid', 0);
     $parentname = get_request('parentname', '');
     $childs = get_request('childs', array());
     //-----
 }
 if (isset($service)) {
     $frmService->AddVar('serviceid', $service['serviceid']);
 }
 $frmService->AddRow(S_NAME, new CTextBox('name', $name, 60));
 //link
 //-------------------------------------------- <LINK> --------------------------------------------
 //parent link
 $ctb = new CTextBox('parent_name', $parentname, 60);
 $ctb->setAttribute('disabled', 'disabled');
 $frmService->AddVar('parentname', $parentname);
 $frmService->AddVar('parentid', $parentid);
 $cb = new CButton('select_parent', S_CHANGE);
 $cb->SetType('button');
 $cb->SetAction("javascript: openWinCentered('services_form.php?pservices=1" . url_param('serviceid') . "','ZBX_Services_List',740,420,'scrollbars=1, toolbar=0, menubar=0, resizable=1, dialog=0');");
 $frmService->AddRow('Parent Service', array($ctb, $cb));
 //----------
 //child links
 $table = new CTable();
 $table->setClass('tableinfo');
 $table->setOddRowClass('even_row');
 $table->setEvenRowClass('even_row');
 $table->attributes['cellpadding'] = 3;
 $table->attributes['cellspacing'] = 1;
 $table->headerClass = 'header';
開發者ID:phedders,項目名稱:zabbix,代碼行數:31,代碼來源:services_form.php

示例12: insert_graph_form

function insert_graph_form()
{
    $frmGraph = new CFormTable(S_GRAPH, null, 'post');
    $frmGraph->SetName('frm_graph');
    $frmGraph->SetHelp("web.graphs.graph.php");
    $frmGraph->SetMethod('post');
    $items = get_request('items', array());
    if (isset($_REQUEST['graphid'])) {
        $frmGraph->addVar('graphid', $_REQUEST['graphid']);
        $result = DBselect('SELECT * FROM graphs WHERE graphid=' . $_REQUEST['graphid']);
        $row = DBfetch($result);
        $frmGraph->SetTitle(S_GRAPH . ' "' . $row['name'] . '"');
    }
    if (isset($_REQUEST['graphid']) && !isset($_REQUEST['form_refresh'])) {
        $name = $row['name'];
        $width = $row['width'];
        $height = $row['height'];
        $ymin_type = $row["ymin_type"];
        $ymax_type = $row["ymax_type"];
        $yaxismin = $row['yaxismin'];
        $yaxismax = $row['yaxismax'];
        $ymin_itemid = $row["ymin_itemid"];
        $ymax_itemid = $row["ymax_itemid"];
        $showworkperiod = $row['show_work_period'];
        $showtriggers = $row['show_triggers'];
        $graphtype = $row['graphtype'];
        $legend = $row['show_legend'];
        $graph3d = $row['show_3d'];
        $percent_left = $row['percent_left'];
        $percent_right = $row['percent_right'];
        $db_items = DBselect('SELECT * FROM graphs_items WHERE graphid=' . $_REQUEST['graphid']);
        while ($item = DBfetch($db_items)) {
            array_push($items, array('itemid' => $item['itemid'], 'drawtype' => $item['drawtype'], 'sortorder' => $item['sortorder'], 'color' => $item['color'], 'yaxisside' => $item['yaxisside'], 'calc_fnc' => $item['calc_fnc'], 'type' => $item['type'], 'periods_cnt' => $item['periods_cnt']));
        }
    } else {
        $name = get_request('name', '');
        $graphtype = get_request('graphtype', GRAPH_TYPE_NORMAL);
        if ($graphtype == GRAPH_TYPE_PIE || $graphtype == GRAPH_TYPE_EXPLODED) {
            $width = get_request('width', 400);
            $height = get_request('height', 300);
        } else {
            $width = get_request('width', 900);
            $height = get_request('height', 200);
        }
        $ymin_type = get_request("ymin_type", GRAPH_YAXIS_TYPE_CALCULATED);
        $ymax_type = get_request("ymax_type", GRAPH_YAXIS_TYPE_CALCULATED);
        $yaxismin = get_request("yaxismin", 0.0);
        $yaxismax = get_request("yaxismax", 100.0);
        $ymin_itemid = get_request("ymin_itemid", 0);
        $ymax_itemid = get_request("ymax_itemid", 0);
        $showworkperiod = get_request('showworkperiod', 0);
        $showtriggers = get_request('showtriggers', 0);
        $legend = get_request('legend', 0);
        $graph3d = get_request('graph3d', 0);
        $visible = get_request('visible');
        $percent_left = 0;
        $percent_right = 0;
        if (isset($visible['percent_left'])) {
            $percent_left = get_request('percent_left', 0);
        }
        if (isset($visible['percent_right'])) {
            $percent_right = get_request('percent_right', 0);
        }
    }
    /* reinit $_REQUEST */
    $_REQUEST['items'] = $items;
    $_REQUEST['name'] = $name;
    $_REQUEST['width'] = $width;
    $_REQUEST['height'] = $height;
    $_REQUEST['ymin_type'] = $ymin_type;
    $_REQUEST['ymax_type'] = $ymax_type;
    $_REQUEST['yaxismin'] = $yaxismin;
    $_REQUEST['yaxismax'] = $yaxismax;
    $_REQUEST['ymin_itemid'] = $ymin_itemid;
    $_REQUEST['ymax_itemid'] = $ymax_itemid;
    $_REQUEST['showworkperiod'] = $showworkperiod;
    $_REQUEST['showtriggers'] = $showtriggers;
    $_REQUEST['graphtype'] = $graphtype;
    $_REQUEST['legend'] = $legend;
    $_REQUEST['graph3d'] = $graph3d;
    $_REQUEST['percent_left'] = $percent_left;
    $_REQUEST['percent_right'] = $percent_right;
    /********************/
    if ($graphtype != GRAPH_TYPE_NORMAL) {
        foreach ($items as $gid => $gitem) {
            if ($gitem['type'] != GRAPH_ITEM_AGGREGATED) {
                continue;
            }
            unset($items[$gid]);
        }
    }
    asort_by_key($items, 'sortorder');
    $group_gid = get_request('group_gid', array());
    $frmGraph->addVar('ymin_itemid', $ymin_itemid);
    $frmGraph->addVar('ymax_itemid', $ymax_itemid);
    $frmGraph->addRow(S_NAME, new CTextBox('name', $name, 32));
    $g_width = new CNumericBox('width', $width, 5);
    $g_width->setAttribute('onblur', 'javascript: submit();');
    $frmGraph->addRow(S_WIDTH, $g_width);
    $g_height = new CNumericBox('height', $height, 5);
//.........這裏部分代碼省略.........
開發者ID:phedders,項目名稱:zabbix,代碼行數:101,代碼來源:forms.inc.php

示例13: bar_report_form3

function bar_report_form3()
{
    $config = get_request('config', 1);
    $title = get_request('title', _('Report 3'));
    $xlabel = get_request('xlabel', '');
    $ylabel = get_request('ylabel', '');
    $scaletype = get_request('scaletype', TIMEPERIOD_TYPE_WEEKLY);
    $avgperiod = get_request('avgperiod', TIMEPERIOD_TYPE_DAILY);
    $report_timesince = get_request('report_timesince', date('YmdHis', time() - SEC_PER_DAY));
    $report_timetill = get_request('report_timetill', date('YmdHis'));
    $items = get_request('items', array());
    $hostids = get_request('hostids', array());
    $hostids = zbx_toHash($hostids);
    $showlegend = get_request('showlegend', 0);
    $palette = get_request('palette', 0);
    $palettetype = get_request('palettetype', 0);
    $reportForm = new CFormTable(null, null, 'get');
    //,'events.php?report_set=1','POST',null,'sform');
    $reportForm->setAttribute('name', 'zbx_report');
    $reportForm->setAttribute('id', 'zbx_report');
    //	$reportForm->setMethod('post');
    if (isset($_REQUEST['report_show']) && !empty($items)) {
        $reportForm->addVar('report_show', 'show');
    }
    $reportForm->addVar('config', $config);
    $reportForm->addVar('report_timesince', date('YmdHis', $report_timesince));
    $reportForm->addVar('report_timetill', date('YmdHis', $report_timetill));
    //	$reportForm->addVar('items',$items); 				//params are set later!!
    //	$reportForm->addVar('periods',$periods);
    $reportForm->addRow(_('Title'), new CTextBox('title', $title, 40));
    $reportForm->addRow(_('X label'), new CTextBox('xlabel', $xlabel, 40));
    $reportForm->addRow(_('Y label'), new CTextBox('ylabel', $ylabel, 40));
    $reportForm->addRow(_('Legend'), new CCheckBox('showlegend', $showlegend, null, 1));
    $reportForm->addVar('sortorder', 0);
    // GROUPS
    $groupids = get_request('groupids', array());
    $group_tb = new CTweenBox($reportForm, 'groupids', $groupids, 10);
    $options = array('real_hosts' => 1, 'output' => 'extend');
    $db_groups = API::HostGroup()->get($options);
    order_result($db_groups, 'name');
    foreach ($db_groups as $gnum => $group) {
        $groupids[$group['groupid']] = $group['groupid'];
        $group_tb->addItem($group['groupid'], $group['name']);
    }
    $reportForm->addRow(_('Groups'), $group_tb->Get(_('Selected groups'), _('Other groups')));
    // ----------
    // HOSTS
    //	validate_group(PERM_READ_ONLY,array('real_hosts'),'web.last.conf.groupid');
    $groupid = get_request('groupid', 0);
    $cmbGroups = new CComboBox('groupid', $groupid, 'submit()');
    $cmbGroups->addItem(0, _('All'));
    foreach ($db_groups as $gnum => $group) {
        $cmbGroups->addItem($group['groupid'], $group['name']);
    }
    $td_groups = new CCol(array(_('Group'), SPACE, $cmbGroups));
    $td_groups->setAttribute('style', 'text-align: right;');
    $host_tb = new CTweenBox($reportForm, 'hostids', $hostids, 10);
    $options = array('real_hosts' => 1, 'output' => array('hostid', 'name'));
    if ($groupid > 0) {
        $options['groupids'] = $groupid;
    }
    $db_hosts = API::Host()->get($options);
    $db_hosts = zbx_toHash($db_hosts, 'hostid');
    order_result($db_hosts, 'name');
    foreach ($db_hosts as $hnum => $host) {
        $host_tb->addItem($host['hostid'], $host['name']);
    }
    $options = array('real_hosts' => 1, 'output' => array('hostid', 'name'), 'hostids' => $hostids);
    $db_hosts2 = API::Host()->get($options);
    order_result($db_hosts2, 'name');
    foreach ($db_hosts2 as $hnum => $host) {
        if (!isset($db_hosts[$host['hostid']])) {
            $host_tb->addItem($host['hostid'], $host['name']);
        }
    }
    $reportForm->addRow(_('Hosts'), $host_tb->Get(_('Selected hosts'), array(_('Other hosts | Group') . SPACE, $cmbGroups)));
    // ----------
    //*/
    // PERIOD
    $clndr_icon = new CImg('images/general/bar/cal.gif', 'calendar', 16, 12, 'pointer');
    $clndr_icon->addAction('onclick', 'javascript: ' . 'var pos = getPosition(this); ' . 'pos.top+=10; ' . 'pos.left+=16; ' . "CLNDR['avail_report_since'].clndr.clndrshow(pos.top,pos.left);");
    $reporttimetab = new CTable(null, 'calendar');
    $reporttimetab->setAttribute('width', '10%');
    $reporttimetab->setCellPadding(0);
    $reporttimetab->setCellSpacing(0);
    $reporttimetab->addRow(array(_('From'), new CNumericBox('report_since_day', $report_timesince > 0 ? date('d', $report_timesince) : '', 2), '/', new CNumericBox('report_since_month', $report_timesince > 0 ? date('m', $report_timesince) : '', 2), '/', new CNumericBox('report_since_year', $report_timesince > 0 ? date('Y', $report_timesince) : '', 4), SPACE, new CNumericBox('report_since_hour', $report_timesince > 0 ? date('H', $report_timesince) : '', 2), ':', new CNumericBox('report_since_minute', $report_timesince > 0 ? date('i', $report_timesince) : '', 2), $clndr_icon));
    zbx_add_post_js('create_calendar(null,' . '["report_since_day","report_since_month","report_since_year","report_since_hour","report_since_minute"],' . '"avail_report_since",' . '"report_timesince");');
    $clndr_icon->addAction('onclick', 'javascript: ' . 'var pos = getPosition(this); ' . 'pos.top+=10; ' . 'pos.left+=16; ' . "CLNDR['avail_report_till'].clndr.clndrshow(pos.top,pos.left);");
    $reporttimetab->addRow(array(_('Till'), new CNumericBox('report_till_day', $report_timetill > 0 ? date('d', $report_timetill) : '', 2), '/', new CNumericBox('report_till_month', $report_timetill > 0 ? date('m', $report_timetill) : '', 2), '/', new CNumericBox('report_till_year', $report_timetill > 0 ? date('Y', $report_timetill) : '', 4), SPACE, new CNumericBox('report_till_hour', $report_timetill > 0 ? date('H', $report_timetill) : '', 2), ':', new CNumericBox('report_till_minute', $report_timetill > 0 ? date('i', $report_timetill) : '', 2), $clndr_icon));
    zbx_add_post_js('create_calendar(null,' . '["report_till_day","report_till_month","report_till_year","report_till_hour","report_till_minute"],' . '"avail_report_till",' . '"report_timetill");');
    zbx_add_post_js('addListener($("filter_icon"),' . '"click",' . 'CLNDR[\'avail_report_since\'].clndr.clndrhide.bindAsEventListener(CLNDR[\'avail_report_since\'].clndr));' . 'addListener($("filter_icon"),' . '"click",' . 'CLNDR[\'avail_report_till\'].clndr.clndrhide.bindAsEventListener(CLNDR[\'avail_report_till\'].clndr));');
    $reportForm->addRow(_('Period'), $reporttimetab);
    $scale = new CComboBox('scaletype', $scaletype);
    $scale->addItem(TIMEPERIOD_TYPE_HOURLY, _('Hourly'));
    $scale->addItem(TIMEPERIOD_TYPE_DAILY, _('Daily'));
    $scale->addItem(TIMEPERIOD_TYPE_WEEKLY, _('Weekly'));
    $scale->addItem(TIMEPERIOD_TYPE_MONTHLY, _('Monthly'));
    $scale->addItem(TIMEPERIOD_TYPE_YEARLY, _('Yearly'));
    $reportForm->addRow(_('Scale'), $scale);
    $avgcmb = new CComboBox('avgperiod', $avgperiod);
//.........這裏部分代碼省略.........
開發者ID:quanta-computing,項目名稱:debian-packages,代碼行數:101,代碼來源:reports.inc.php

示例14: get_macros_widget

function get_macros_widget($hostid = null)
{
    if (isset($_REQUEST['form_refresh'])) {
        $macros = get_request('macros', array());
    } else {
        if ($hostid > 0) {
            $macros = CUserMacro::get(array('output' => API_OUTPUT_EXTEND, 'hostids' => $hostid));
            order_result($macros, 'macro');
        } else {
            if ($hostid === null) {
                $macros = CUserMacro::get(array('output' => API_OUTPUT_EXTEND, 'globalmacro' => 1));
                order_result($macros, 'macro');
            } else {
                $macros = array();
            }
        }
    }
    if (empty($macros)) {
        $macros = array(0 => array('macro' => '', 'value' => ''));
    }
    $macros_tbl = new CTable(SPACE, 'formElementTable');
    $macros_tbl->setAttribute('id', 'tbl_macros');
    $macros_tbl->addRow(array(SPACE, S_MACRO, SPACE, S_VALUE));
    insert_js('
			function addMacroRow(){

				if(typeof(addMacroRow.macro_count) == "undefined"){
					addMacroRow.macro_count = ' . count($macros) . ';
				}

				var tr = document.createElement("tr");
				tr.className = (addMacroRow.macro_count % 2) ? "form_even_row" : "form_odd_row";

				var td1 = document.createElement("td");
				tr.appendChild(td1);

				var cb = document.createElement("input");
				cb.setAttribute("type", "checkbox");
				cb.className = "checkbox";
				td1.appendChild(cb);
				td1.appendChild(document.createTextNode(" "));

				var td2 = document.createElement("td");
				tr.appendChild(td2);

				var text1 = document.createElement("input");
				text1.setAttribute("type", "text");
				text1.setAttribute("name", "macros["+addMacroRow.macro_count+"][macro]");
				text1.className = "biginput";
				text1.setAttribute("size",30);
				text1.setAttribute("placeholder","{$MACRO}");
				td2.appendChild(text1);
				td2.appendChild(document.createTextNode(" "));

				var td3 = document.createElement("td");
				tr.appendChild(td3);

				var span = document.createElement("span");
				span.innerHTML = "&rArr;";
				span.setAttribute("style", "vertical-align:top;");
				td3.appendChild(span);

				var td4 = document.createElement("td");
				tr.appendChild(td4);

				var text2 = document.createElement("input");
				text2.setAttribute("type", "text");
				text2.setAttribute("placeholder","<' . S_VALUE . '>");
				text2.setAttribute("name","macros["+addMacroRow.macro_count+"][value]");
				text2.className = "biginput";
				text2.setAttribute("size",40);
				td4.appendChild(text2);

				var sd = $("row_new_macro").insert({before : tr});
				addMacroRow.macro_count++;
			}
		');
    $macros = array_values($macros);
    foreach ($macros as $macroid => $macro) {
        $text1 = new CTextBox('macros[' . $macroid . '][macro]', $macro['macro'], 30);
        $text1->setAttribute('placeholder', '{$MACRO}');
        $text2 = new CTextBox('macros[' . $macroid . '][value]', $macro['value'], 40);
        $text2->setAttribute('placeholder', '<' . S_VALUE . '>');
        $span = new CSpan(RARR);
        $span->addStyle('vertical-align:top;');
        $macros_tbl->addRow(array(new CCheckBox(), $text1, $span, $text2));
    }
    $script = '$$("#tbl_macros input:checked").each(function(obj){ $(obj.parentNode.parentNode).remove(); if (typeof(deleted_macro_cnt) == \'undefined\') deleted_macro_cnt=1; else deleted_macro_cnt++; });';
    $delete_btn = new CButton('macros_del', S_DELETE_SELECTED, $script);
    $delete_btn->setType('button');
    $add_button = new CButton('macro_add', S_ADD, 'javascript: addMacroRow()');
    $add_button->setType('button');
    $buttonRow = new CRow();
    $buttonRow->setAttribute('id', 'row_new_macro');
    $col = new CCol(array($add_button, SPACE, $delete_btn));
    $col->setAttribute('colspan', 4);
    $buttonRow->addItem($col);
    $macros_tbl->addRow($buttonRow);
    $footer = null;
    if ($hostid === null) {
//.........這裏部分代碼省略.........
開發者ID:songyuanjie,項目名稱:zabbix-stats,代碼行數:101,代碼來源:forms.inc.php

示例15: CDiv

$headerDiv = new CDiv(_('Colour'), 'inlineblock trigger_displaying_form_col');
$headerDiv->addStyle('margin-left: 2px;');
$triggerDOFormList->addRow(SPACE, array($headerDiv, _('Blinking')));
// Unacknowledged problem events
$triggerDOFormList->addRow(_('Unacknowledged PROBLEM events'), array(new CDiv(new CColor('problem_unack_color', $this->data['problem_unack_color']), 'inlineblock trigger_displaying_form_col'), new CCheckBox('problem_unack_style', $this->data['problem_unack_style'] == 1, null, 1)));
// Acknowledged problem events
$triggerDOFormList->addRow(_('Acknowledged PROBLEM events'), array(new CDiv(new CColor('problem_ack_color', $this->data['problem_ack_color']), 'inlineblock trigger_displaying_form_col'), new CCheckBox('problem_ack_style', $this->data['problem_ack_style'] == 1, null, 1)));
// Unacknowledged recovery events
$triggerDOFormList->addRow(_('Unacknowledged OK events'), array(new CDiv(new CColor('ok_unack_color', $this->data['ok_unack_color']), 'inlineblock trigger_displaying_form_col'), new CCheckBox('ok_unack_style', $this->data['ok_unack_style'] == 1, null, 1)));
// Acknowledged recovery events
$triggerDOFormList->addRow(_('Acknowledged OK events'), array(new CDiv(new CColor('ok_ack_color', $this->data['ok_ack_color']), 'inlineblock trigger_displaying_form_col'), new CCheckBox('ok_ack_style', $this->data['ok_ack_style'] == 1, null, 1)));
// some air between the sections
$triggerDOFormList->addRow(BR());
// Display OK triggers
$okPeriodTextBox = new CTextBox('ok_period', $this->data['ok_period']);
$okPeriodTextBox->addStyle('width: 4em;');
$okPeriodTextBox->setAttribute('maxlength', '6');
$triggerDOFormList->addRow(_('Display OK triggers for'), array($okPeriodTextBox, SPACE, _('seconds')));
// Triggers blink on status change
$okPeriodTextBox = new CTextBox('blink_period', $this->data['blink_period']);
$okPeriodTextBox->addStyle('width: 4em;');
$okPeriodTextBox->setAttribute('maxlength', '6');
$triggerDOFormList->addRow(_('On status change triggers blink for'), array($okPeriodTextBox, SPACE, _('seconds')));
$severityView = new CTabView();
$severityView->addTab('triggerdo', _('Trigger displaying options'), $triggerDOFormList);
$severityForm = new CForm();
$severityForm->setName('triggerDisplayOptions');
$severityForm->addVar('form_refresh', $this->data['form_refresh'] + 1);
$severityForm->addItem($severityView);
$severityForm->addItem(makeFormFooter(new CSubmit('save', _('Save')), new CButton('resetDefaults', _('Reset defaults'))));
return $severityForm;
開發者ID:itnihao,項目名稱:zatree-2.2,代碼行數:31,代碼來源:administration.general.triggerDisplayOptions.edit.php


注:本文中的CTextBox::setAttribute方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。