本文整理汇总了PHP中CTextBox类的典型用法代码示例。如果您正苦于以下问题:PHP CTextBox类的具体用法?PHP CTextBox怎么用?PHP CTextBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CTextBox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: __construct
public function __construct($name, $value)
{
parent::__construct();
$txt = new CTextBox($name, $value);
$txt->addStyle('width: 6em;');
$txt->attr('maxlength', 6);
$txt->attr('id', zbx_formatDomId($name));
$txt->addAction('onchange', 'set_color_by_name("' . $name . '", this.value)');
$txt->addStyle('style', 'margin-top: 0px; margin-bottom: 0px;');
$lbl = new CColorCell('lbl_' . $name, $value, 'javascript: show_color_picker("' . $name . '")');
$this->addItem(array($txt, $lbl));
insert_show_color_picker_javascript();
}
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:13,代码来源:class.ccolor.php
示例3: CCombobox
$host_groups = new CCombobox('groupid', $this->get('groupid'));
$host_groups->addItem(0, _('All'));
$groups = $this->getArray('groups');
foreach ($groups as $gnum => $group) {
$host_groups->addItem($group['groupid'], $group['name']);
}
$scriptTab->addRow(_('Host groups'), $host_groups);
// permissions
$select_acc = new CCombobox('access', $this->get('access'));
$select_acc->addItem(PERM_READ_ONLY, _('Read'));
$select_acc->addItem(PERM_READ_WRITE, _('Write'));
$scriptTab->addRow(_('Required host permissions'), $select_acc);
// confirmation
$enableQuestCB = new CCheckBox('enableConfirmation', $this->get('enableConfirmation'));
$scriptTab->addRow(new CLabel(_('Enable confirmation'), 'enableConfirmation'), array($enableQuestCB, SPACE));
$confirmationTB = new CTextBox('confirmation', $this->get('confirmation'));
$confirmationTB->addStyle('width: 50em;');
$confirmationTB->setAttribute('maxlength', 255);
$testLink = new CButton('testConfirmation', _('Test confirmation'), null, 'link_menu');
$confirmationLabel = new CLabel(_('Confirmation text'), 'confirmation');
$confirmationLabel->setAttribute('id', 'confirmationLabel');
$scriptTab->addRow($confirmationLabel, array($confirmationTB, SPACE, $testLink));
$scriptView = new CTabView();
$scriptView->addTab('scripts', _('Script'), $scriptTab);
$frmScr->addItem($scriptView);
// footer
$main = array(new CSubmit('save', _('Save')));
$others = array();
if (isset($_REQUEST['scriptid'])) {
$others[] = new CButton('clone', _('Clone'));
$others[] = new CButtonDelete(_('Delete script?'), url_param('form') . url_param('scriptid'));
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:administration.script.edit.php
示例4: CWidget
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
include 'include/views/js/administration.script.edit.js.php';
$scriptsWidget = new CWidget();
$scriptsWidget->addPageHeader(_('CONFIGURATION OF SCRIPTS'));
$scriptForm = new CForm();
$scriptForm->setName('scripts');
$scriptForm->addVar('form', $this->get('form'));
$scriptForm->addVar('form_refresh', $this->get('form_refresh') + 1);
if ($this->get('scriptid')) {
$scriptForm->addVar('scriptid', $this->get('scriptid'));
}
$scriptFormList = new CFormList('scriptsTab');
// name
$nameTextBox = new CTextBox('name', $this->get('name'), ZBX_TEXTBOX_STANDARD_SIZE);
$nameTextBox->attr('autofocus', 'autofocus');
$nameTextBox->attr('placeholder', _('<Sub-menu/Sub-menu.../>Script'));
$scriptFormList->addRow(_('Name'), $nameTextBox);
// type
$typeComboBox = new CComboBox('type', $this->get('type'));
$typeComboBox->addItem(ZBX_SCRIPT_TYPE_IPMI, _('IPMI'));
$typeComboBox->addItem(ZBX_SCRIPT_TYPE_CUSTOM_SCRIPT, _('Script'));
$scriptFormList->addRow(_('Type'), $typeComboBox);
// execute on
$typeRadioButton = new CRadioButtonList('execute_on', $this->get('execute_on'));
$typeRadioButton->makeVertical();
$typeRadioButton->addValue(_('Zabbix agent'), ZBX_SCRIPT_EXECUTE_ON_AGENT);
$typeRadioButton->addValue(_('Zabbix server'), ZBX_SCRIPT_EXECUTE_ON_SERVER);
$scriptFormList->addRow(_('Execute on'), new CDiv($typeRadioButton, 'objectgroup inlineblock border_dotted ui-corner-all'), $this->get('type') == ZBX_SCRIPT_TYPE_IPMI);
$scriptFormList->addRow(_('Commands'), new CTextArea('command', $this->get('command')), $this->get('type') == ZBX_SCRIPT_TYPE_IPMI);
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:administration.script.edit.php
示例5: 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
示例6: array
$rplcts = array();
$allowedTesting = true;
$expressionData = new CTriggerExpression();
if ($expressionData->parse($expression)) {
$macrosData = array();
$expressions = array_merge($expressionData->expressions, $expressionData->macros, $expressionData->usermacros);
foreach ($expressions as $exprPart) {
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']);
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:tr_testexpr.php
示例7: CWidget
** 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.
**/
$mediaTypeWidget = new CWidget();
$mediaTypeWidget->addPageHeader(_('CONFIGURATION OF MEDIA TYPES'));
// create form
$mediaTypeForm = new CForm();
$mediaTypeForm->setName('mediaTypeForm');
$mediaTypeForm->addVar('form', $this->data['form']);
$mediaTypeForm->addVar('mediatypeid', $this->data['mediatypeid']);
// create form list
$mediaTypeFormList = new CFormList('mediaTypeFormList');
$nameTextBox = new CTextBox('description', $this->data['description'], ZBX_TEXTBOX_STANDARD_SIZE, false, 100);
$nameTextBox->attr('autofocus', 'autofocus');
$mediaTypeFormList->addRow(_('Name'), $nameTextBox);
// append type to form list
$cmbType = new CComboBox('type', $this->data['type'], 'submit()');
$cmbType->addItems(array(MEDIA_TYPE_EMAIL => _('Email'), MEDIA_TYPE_EXEC => _('Script'), MEDIA_TYPE_SMS => _('SMS'), MEDIA_TYPE_JABBER => _('Jabber')));
$cmbType->addItemsInGroup(_('Commercial'), array(MEDIA_TYPE_EZ_TEXTING => _('Ez Texting')));
$cmbTypeRow = array($cmbType);
if ($this->data['type'] == MEDIA_TYPE_EZ_TEXTING) {
$ez_texting_link = new CLink('https://app.eztexting.com', 'https://app.eztexting.com/', null, null, 'nosid');
$ez_texting_link->setTarget('_blank');
$cmbTypeRow[] = $ez_texting_link;
}
$mediaTypeFormList->addRow(_('Type'), $cmbTypeRow);
// append others fields to form list
if ($this->data['type'] == MEDIA_TYPE_EMAIL) {
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:administration.mediatypes.edit.php
示例8: _
$authTypeComboBox->addItem(ITEM_AUTHTYPE_PUBLICKEY, _('Public key'));
$newOperationsTable->addRow(array(_('Authentication method'), $authTypeComboBox), 'class_authentication_method hidden');
$newOperationsTable->addRow(array(_('User name'), new CTextBox('new_operation[opcommand][username]', $this->data['new_operation']['opcommand']['username'], ZBX_TEXTBOX_SMALL_SIZE)), 'class_authentication_username hidden indent_both');
$newOperationsTable->addRow(array(_('Public key file'), new CTextBox('new_operation[opcommand][publickey]', $this->data['new_operation']['opcommand']['publickey'], ZBX_TEXTBOX_SMALL_SIZE)), 'class_authentication_publickey hidden indent_both');
$newOperationsTable->addRow(array(_('Private key file'), new CTextBox('new_operation[opcommand][privatekey]', $this->data['new_operation']['opcommand']['privatekey'], ZBX_TEXTBOX_SMALL_SIZE)), 'class_authentication_privatekey hidden indent_both');
$newOperationsTable->addRow(array(_('Password'), new CTextBox('new_operation[opcommand][password]', $this->data['new_operation']['opcommand']['password'], ZBX_TEXTBOX_SMALL_SIZE)), 'class_authentication_password hidden indent_both');
// set custom id because otherwise they are set based on name (sick!) and produce duplicate ids
$passphraseCB = new CTextBox('new_operation[opcommand][password]', $this->data['new_operation']['opcommand']['password'], ZBX_TEXTBOX_SMALL_SIZE);
$passphraseCB->attr('id', 'new_operation_opcommand_passphrase');
$newOperationsTable->addRow(array(_('Key passphrase'), $passphraseCB), 'class_authentication_passphrase hidden');
// ssh && telnet
$newOperationsTable->addRow(array(_('Port'), new CTextBox('new_operation[opcommand][port]', $this->data['new_operation']['opcommand']['port'], ZBX_TEXTBOX_SMALL_SIZE)), 'class_opcommand_port hidden indent_both');
// command
$commandTextArea = new CTextArea('new_operation[opcommand][command]', $this->data['new_operation']['opcommand']['command']);
$newOperationsTable->addRow(array(_('Commands'), $commandTextArea), 'class_opcommand_command hidden indent_both');
$commandIpmiTextBox = new CTextBox('new_operation[opcommand][command]', $this->data['new_operation']['opcommand']['command'], ZBX_TEXTBOX_STANDARD_SIZE);
$commandIpmiTextBox->attr('id', 'opcommand_command_ipmi');
$newOperationsTable->addRow(array(_('Commands'), $commandIpmiTextBox), 'class_opcommand_command_ipmi hidden indent_both');
break;
case OPERATION_TYPE_HOST_ADD:
case OPERATION_TYPE_HOST_REMOVE:
case OPERATION_TYPE_HOST_ENABLE:
case OPERATION_TYPE_HOST_DISABLE:
$newOperationsTable->addItem(new CVar('new_operation[object]', 0));
$newOperationsTable->addItem(new CVar('new_operation[objectid]', 0));
$newOperationsTable->addItem(new CVar('new_operation[shortdata]', ''));
$newOperationsTable->addItem(new CVar('new_operation[longdata]', ''));
break;
case OPERATION_TYPE_GROUP_ADD:
case OPERATION_TYPE_GROUP_REMOVE:
if (!isset($this->data['new_operation']['opgroup'])) {
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:configuration.action.edit.php
示例9: CForm
** 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.
**/
include 'include/views/js/administration.general.valuemapping.edit.js.php';
$valueMappingForm = new CForm();
$valueMappingForm->setName('valueMappingForm');
$valueMappingForm->addVar('form', $this->data['form']);
$valueMappingForm->addVar('form_refresh', $this->data['form_refresh'] + 1);
$valueMappingForm->addVar('valuemapid', $this->data['valuemapid']);
// create form list
$valueMappingFormList = new CFormList('valueMappingFormList');
// name
$nameTextBox = new CTextBox('mapname', $this->data['mapname'], 40, null, 64);
$nameTextBox->attr('autofocus', 'autofocus');
$valueMappingFormList->addRow(_('Name'), $nameTextBox);
// mappings
$mappingsTable = new CTable(SPACE, 'formElementTable');
$mappingsTable->setAttribute('id', 'mappingsTable');
$mappingsTable->addRow(array(_('Value'), SPACE, _('Mapped to'), SPACE));
$mappingsTable->addRow(new CCol(new CButton('addMapping', _('Add'), '', 'link_menu'), null, 4));
$valueMappingFormList->addRow(_('Mappings'), new CDiv($mappingsTable, 'border_dotted inlineblock objectgroup'));
// add mappings to form by js
if (empty($this->data['mappings'])) {
zbx_add_post_js('mappingsManager.addNew();');
} else {
zbx_add_post_js('mappingsManager.addExisting(' . zbx_jsvalue($this->data['mappings']) . ');');
}
// append tab
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:administration.general.valuemapping.edit.php
示例10: CWidget
**/
$userGroupWidget = new CWidget();
$userGroupWidget->addPageHeader(_('CONFIGURATION OF USER GROUPS'));
// create form
$userGroupForm = new CForm();
$userGroupForm->setName('userGroupsForm');
$userGroupForm->addVar('form', $this->data['form']);
$userGroupForm->addVar('group_rights', $this->data['group_rights']);
if (isset($this->data['usrgrpid'])) {
$userGroupForm->addVar('usrgrpid', $this->data['usrgrpid']);
}
/*
* User group tab
*/
$userGroupFormList = new CFormList('userGroupFormList');
$nameTextBox = new CTextBox('gname', $this->data['name'], ZBX_TEXTBOX_STANDARD_SIZE);
$nameTextBox->attr('autofocus', 'autofocus');
$userGroupFormList->addRow(_('Group name'), $nameTextBox);
// append groups to form list
$groupsComboBox = new CComboBox('selusrgrp', $this->data['selected_usrgrp'], 'submit()');
$groupsComboBox->addItem(0, _('All'));
foreach ($this->data['usergroups'] as $group) {
$groupsComboBox->addItem($group['usrgrpid'], $group['name']);
}
// append user tweenbox to form list
$usersTweenBox = new CTweenBox($userGroupForm, 'group_users', $this->data['group_users'], 10);
foreach ($this->data['users'] as $user) {
$usersTweenBox->addItem($user['userid'], getUserFullname($user));
}
$userGroupFormList->addRow(_('Users'), $usersTweenBox->get(_('In group'), array(_('Other groups'), SPACE, $groupsComboBox)));
// append frontend and user status to from list
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:administration.usergroups.edit.php
示例11: dirname
**
** 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.
**/
require_once dirname(__FILE__) . '/js/adm.regexprs.edit.js.php';
zbx_add_post_js('zabbixRegExp.addExpressions(' . CJs::encodeJson(array_values($this->get('expressions'))) . ');');
$form = new CForm();
$form->attr('id', 'zabbixRegExpForm');
$form->addVar('form', 1);
$form->addVar('regexpid', $this->data['regexpid']);
/*
* Expressions tab
*/
$exprTab = new CFormList('exprTab');
$nameTextBox = new CTextBox('name', $this->get('name'), ZBX_TEXTBOX_STANDARD_SIZE, false, 128);
$nameTextBox->attr('autofocus', 'autofocus');
$exprTab->addRow(_('Name'), $nameTextBox);
$exprTable = new CTable(null, 'formElementTable formWideTable');
$exprTable->attr('id', 'exprTable');
$exprTable->setHeader(array(_('Expression'), new CCol(_('Expression type'), 'nowrap'), new CCol(_('Case sensitive'), 'nowrap'), SPACE));
$exprTable->setFooter(new CButton('add', _('Add'), null, 'link_menu exprAdd'));
$exprTab->addRow(_('Expressions'), new CDiv($exprTable, 'inlineblock border_dotted objectgroup'));
$exprForm = new CTable(null, 'formElementTable');
$exprForm->addRow(array(_('Expression'), new CTextBox('expressionNew', null, ZBX_TEXTBOX_STANDARD_SIZE)));
$exprForm->addRow(array(_('Expression type'), new CComboBox('typeNew', null, null, expression_type2str())));
$exprForm->addRow(array(_('Delimiter'), new CComboBox('delimiterNew', null, null, expressionDelimiters())), null, 'delimiterNewRow');
$exprForm->addRow(array(_('Case sensitive'), new CCheckBox('case_sensitiveNew')));
$exprFormFooter = array(new CButton('saveExpression', _('Add'), null, 'link_menu'), SPACE, new CButton('cancelExpression', _('Cancel'), null, 'link_menu'));
$exprTab->addRow(null, new CDiv(array($exprForm, $exprFormFooter), 'objectgroup inlineblock border_dotted'), true, 'exprForm');
/*
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:administration.general.regularexpressions.edit.php
示例12: CWidget
$applicationWidget = new CWidget();
$applicationWidget->addPageHeader(_('CONFIGURATION OF APPLICATIONS'));
// append host summary to widget header
$applicationWidget->addItem(get_header_host_table('applications', $this->data['hostid']));
// create form
$applicationForm = new CForm();
$applicationForm->setName('applicationForm');
$applicationForm->addVar('form', $this->data['form']);
$applicationForm->addVar('groupid', $this->data['groupid']);
$applicationForm->addVar('hostid', $this->data['hostid']);
if (!empty($this->data['applicationid'])) {
$applicationForm->addVar('applicationid', $this->data['applicationid']);
}
// create form list
$applicationFormList = new CFormList('applicationFormList');
$nameTextBox = new CTextBox('appname', $this->data['appname'], ZBX_TEXTBOX_STANDARD_SIZE);
$nameTextBox->attr('autofocus', 'autofocus');
$applicationFormList->addRow(_('Name'), $nameTextBox);
// append tabs to form
$applicationTab = new CTabView();
$applicationTab->addTab('applicationTab', _('Application'), $applicationFormList);
$applicationForm->addItem($applicationTab);
// append buttons to form
if (!empty($this->data['applicationid'])) {
$applicationForm->addItem(makeFormFooter(new CSubmit('save', _('Save')), array(new CSubmit('clone', _('Clone')), new CButtonDelete(_('Delete application?'), url_params(array('config', 'hostid', 'groupid', 'form', 'applicationid'))), new CButtonCancel(url_param('config') . url_param('hostid') . url_param('groupid')))));
} else {
$applicationForm->addItem(makeFormFooter(new CSubmit('save', _('Save')), new CButtonCancel(url_param('config') . url_param('hostid') . url_param('groupid'))));
}
// append form to widget
$applicationWidget->addItem($applicationForm);
return $applicationWidget;
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:configuration.application.edit.php
示例13: CForm
<?php
/*
** Zabbix
** Copyright (C) 2001-2013 Zabbix SIA
**
** 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.
**/
$searchForm = new CForm('get', 'search.php');
$searchBox = new CTextBox('search', get_request('search'));
$searchBox->setAttribute('autocomplete', 'off');
$searchBox->addClass('search');
$searchForm->addItem($searchBox);
$searchBtn = new CSubmit('searchbttn', _('Search'), null, 'input button ui-button ui-widget ui-state-default ui-corner-all');
$searchForm->addItem($searchBtn);
return new CDiv($searchForm, 'zbx_search', 'zbx_search');
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:28,代码来源:general.search.php
示例14: dirname
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
require_once dirname(__FILE__) . '/js/configuration.discovery.edit.js.php';
$discoveryWidget = new CWidget();
$discoveryWidget->addPageHeader(_('CONFIGURATION OF DISCOVERY RULES'));
// create form
$discoveryForm = new CForm();
$discoveryForm->setName('discoveryForm');
$discoveryForm->addVar('form', $this->data['form']);
$discoveryForm->addVar('form_refresh', $this->data['form_refresh'] + 1);
if (!empty($this->data['druleid'])) {
$discoveryForm->addVar('druleid', $this->data['druleid']);
}
// create form list
$discoveryFormList = new CFormList('discoveryFormList');
$nameTextBox = new CTextBox('name', $this->data['drule']['name'], ZBX_TEXTBOX_STANDARD_SIZE);
$nameTextBox->attr('autofocus', 'autofocus');
$discoveryFormList->addRow(_('Name'), $nameTextBox);
// append proxy to form list
$proxyComboBox = new CComboBox('proxy_hostid', $this->data['drule']['proxy_hostid']);
$proxyComboBox->addItem(0, _('No proxy'));
foreach ($this->data['proxies'] as $proxy) {
$proxyComboBox->addItem($proxy['proxyid'], $proxy['host']);
}
$discoveryFormList->addRow(_('Discovery by proxy'), $proxyComboBox);
$discoveryFormList->addRow(_('IP range'), new CTextBox('iprange', $this->data['drule']['iprange'], ZBX_TEXTBOX_SMALL_SIZE));
$discoveryFormList->addRow(_('Delay (in sec)'), new CNumericBox('delay', $this->data['drule']['delay'], 8));
// append checks to form list
$checkTable = new CTable(null, 'formElementTable');
$checkTable->addRow(new CRow(new CCol(new CButton('newCheck', _('New'), null, 'link_menu'), null, 2), null, 'dcheckListFooter'));
$discoveryFormList->addRow(_('Checks'), new CDiv($checkTable, 'objectgroup inlineblock border_dotted ui-corner-all', 'dcheckList'));
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:configuration.discovery.edit.php
示例15: 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'])) {
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:configuration.httpconf.edit.php
示例16: CRadioButton
$inventoryAutomaticBtn = new CRadioButton('inventory_mode', HOST_INVENTORY_AUTOMATIC, null, 'host_inventory_radio_' . HOST_INVENTORY_AUTOMATIC, $inventoryMode == HOST_INVENTORY_AUTOMATIC);
$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) {
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:configuration.host.edit.php
示例17: CForm
$userWidget->addPageHeader(_('CONFIGURATION OF USERS'));
}
// create form
$userForm = new CForm();
$userForm->setName('userForm');
$userForm->addVar('config', getRequest('config', 0));
$userForm->addVar('form', $this->data['form']);
if (isset($_REQUEST['userid'])) {
$userForm->addVar('userid', $this->data['userid']);
}
/*
* User tab
*/
$userFormList = new CFormList('userFormList');
if (!$data['is_profile']) {
$nameTextBox = new CTextBox('alias', $this->data['alias'], ZBX_TEXTBOX_STANDARD_SIZE);
$nameTextBox->attr('autofocus', 'autofocus');
$userFormList->addRow(_('Alias'), $nameTextBox);
$userFormList->addRow(_x('Name', 'user first name'), new CTextBox('name', $this->data['name'], ZBX_TEXTBOX_STANDARD_SIZE));
$userFormList->addRow(_('Surname'), new CTextBox('surname', $this->data['surname'], ZBX_TEXTBOX_STANDARD_SIZE));
}
// append user groups to form list
if (!$this->data['is_profile']) {
$userForm->addVar('user_groups', $this->data['user_groups']);
$lstGroups = new CListBox('user_groups_to_del[]', null, 10);
$lstGroups->attributes['style'] = 'width: 320px';
foreach ($this->data['groups'] as $group) {
$lstGroups->addItem($group['usrgrpid'], $group['name']);
}
$userFormList->addRow(_('Groups'), array($lstGroups, new CButton('add_group', _('Add'), 'return PopUp("popup_usrgrp.php?dstfrm=' . $userForm->getName() . '&list_name=user_groups_to_del[]&var_name=user_groups", 450, 450);', 'formlist'), BR(), count($this->data['user_groups']) > 0 ? new CSubmit('del_user_group', _('Delete selected'), null, 'formlist') : null));
}
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:administration.users.edit.php
示例18: array
// append multiplier to form list
$multiplier = array();
if ($this->data['limited']) {
$itemForm->addVar('multiplier', $this->data['multiplier']);
$multiplierCheckBox = new CCheckBox('multiplier', $this->data['multiplier'] == 1 ? 'yes' : 'no');
$multiplierCheckBox->setAttribute('disabled', 'disabled');
$multiplier[] = $multiplierCheckBox;
$multiplier[] = SPACE;
$formulaTextBox = new CTextBox('formula', $this->data['formula'], ZBX_TEXTBOX_SMALL_SIZE, 1);
$formulaTextBox->setAttribute('style', 'text-align: right;');
$multiplier[] = $formulaTextBox;
} else {
$multiplierCheckBox = new CCheckBox('multiplier', $this->data['multiplier'] == 1 ? 'yes' : 'no', 'var editbx = document.getElementById(\'formula\'); if (editbx) { editbx.disabled = !this.checked; }', 1);
$multiplier[] = $multiplierCheckBox;
$multiplier[] = SPACE;
$formulaTextBox = new CTextBox('formula', $this->data['formula'], ZBX_TEXTBOX_SMALL_SIZE);
$formulaTextBox->setAttribute('style', 'text-align: right;');
$multiplier[] = $formulaTextBox;
}
$itemFormList->addRow(_('Use custom multiplier'), $multiplier, false, 'row_multiplier');
}
$itemFormList->addRow(_('Update interval (in sec)'), new CNumericBox('delay', $this->data['delay'], 5), false, 'row_delay');
// append delay flex to form list
$delayFlexTable = new CTable(_('No flexible intervals defined.'), 'formElementTable');
$delayFlexTable->setAttribute('style', 'min-width: 310px;');
$delayFlexTable->setAttribute('id', 'delayFlexTable');
$delayFlexTable->setHeader(array(_('Interval'), _('Period'), _('Action')));
$i = 0;
$this->data['maxReached'] = false;
foreach ($this->data['delay_flex'] as $delayFlex) {
if (!isset($delayFlex['delay']) && !isset($delayFlex['period'])) {
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:configuration.item.edit.php
示例19: insert_js
insert_js('MMenu.def_label = ' . zbx_jsvalue($label));
} 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')) {
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:page_head |
请发表评论