本文整理汇总了PHP中CFormList类的典型用法代码示例。如果您正苦于以下问题:PHP CFormList类的具体用法?PHP CFormList怎么用?PHP CFormList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CFormList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: dirname
** 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/configuration.slideconf.edit.js.php';
$slideWidget = new CWidget();
$slideWidget->addPageHeader(_('CONFIGURATION OF SLIDE SHOWS'));
// create form
$slideForm = new CForm();
$slideForm->setName('slideForm');
$slideForm->addVar('form', $this->data['form']);
$slideForm->addVar('slides', $this->data['slides_without_delay']);
if (!empty($this->data['slideshowid'])) {
$slideForm->addVar('slideshowid', $this->data['slideshowid']);
}
// create slide form list
$slideFormList = new CFormList('slideFormList');
$nameTextBox = new CTextBox('name', $this->data['name'], ZBX_TEXTBOX_STANDARD_SIZE);
$nameTextBox->attr('autofocus', 'autofocus');
$slideFormList->addRow(_('Name'), $nameTextBox);
$slideFormList->addRow(_('Default delay (in seconds)'), new CNumericBox('delay', $this->data['delay'], 5, 'no', false, false));
// append slide table
$slideTable = new CTableInfo(null, 'formElementTable');
$slideTable->setAttribute('style', 'min-width: 312px;');
$slideTable->setAttribute('id', 'slideTable');
$slideTable->setHeader(array(new CCol(SPACE, null, null, '15'), new CCol(SPACE, null, null, '15'), _('Screen'), new CCol(_('Delay'), null, null, '70'), new CCol(_('Action'), null, null, '50')));
$i = 1;
foreach ($this->data['slides'] as $step => $slides) {
$name = '';
if (!empty($slides['screenid'])) {
$screen = get_screen_by_screenid($slides['screenid']);
if (!empty($screen['name'])) {
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:configuration.slideconf.edit.php
示例2: CWidget
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
$itemWidget = new CWidget();
if (!empty($this->data['hostid'])) {
$itemWidget->addItem(get_header_host_table('items', $this->data['hostid']));
}
$itemWidget->addPageHeader(_('CONFIGURATION OF ITEMS'));
// create form
$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()));
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:configuration.item.copy.php
示例3: CWidget
** 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.
**/
$proxyWidget = new CWidget();
$proxyWidget->addPageHeader(_('CONFIGURATION OF PROXIES'));
// create form
$proxyForm = new CForm();
$proxyForm->setName('proxyForm');
$proxyForm->addVar('form', $this->data['form']);
$proxyForm->addVar('form_refresh', $this->data['form_refresh']);
if (!empty($this->data['proxyid'])) {
$proxyForm->addVar('proxyid', $this->data['proxyid']);
}
// create form list
$proxyFormList = new CFormList('proxyFormList');
$nameTextBox = new CTextBox('host', $this->data['name'], ZBX_TEXTBOX_STANDARD_SIZE, 'no', 64);
$nameTextBox->attr('autofocus', 'autofocus');
$proxyFormList->addRow(_('Proxy name'), $nameTextBox);
// append status to form list
$statusBox = new CComboBox('status', $this->data['status'], 'submit()');
$statusBox->addItem(HOST_STATUS_PROXY_ACTIVE, _('Active'));
$statusBox->addItem(HOST_STATUS_PROXY_PASSIVE, _('Passive'));
$proxyFormList->addRow(_('Proxy mode'), $statusBox);
if ($this->data['status'] == HOST_STATUS_PROXY_PASSIVE) {
if (isset($this->data['interface']['interfaceid'])) {
$proxyForm->addVar('interface[interfaceid]', $this->data['interface']['interfaceid']);
$proxyForm->addVar('interface[hostid]', $this->data['interface']['hostid']);
}
$interfaceTable = new CTable(null, 'formElementTable');
$interfaceTable->addRow(array(_('IP address'), _('DNS name'), _('Connect to'), _('Port')));
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:administration.proxy.edit.php
示例4: dirname
** 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/configuration.slideconf.edit.js.php';
$slideWidget = new CWidget();
$slideWidget->addPageHeader(_('CONFIGURATION OF SLIDE SHOWS'));
// create form
$slideForm = new CForm();
$slideForm->setName('slideForm');
$slideForm->addVar('form', $this->data['form']);
$slideForm->addVar('slides', $this->data['slides_without_delay']);
if (!empty($this->data['slideshowid'])) {
$slideForm->addVar('slideshowid', $this->data['slideshowid']);
}
// create slide form list
$slideFormList = new CFormList('slideFormList');
$slideFormList->addRow(_('Name'), new CTextBox('name', $this->data['name'], ZBX_TEXTBOX_STANDARD_SIZE));
$slideFormList->addRow(_('Default delay (in seconds)'), new CNumericBox('delay', $this->data['delay'], 5, 'no', false, false));
// append slide table
$slideTable = new CTableInfo(_('No slides defined.'), 'formElementTable');
$slideTable->setAttribute('style', 'min-width: 500px;');
$slideTable->setAttribute('id', 'slideTable');
$slideTable->setHeader(array(new CCol(SPACE, null, null, '15'), new CCol(SPACE, null, null, '15'), new CCol(_('Screen'), null, null, '140'), new CCol(_('Delay'), null, null, '70'), new CCol(_('Action'), null, null, '50')));
$i = 1;
foreach ($this->data['slides'] as $step => $slides) {
$name = '';
if (!empty($slides['screenid'])) {
$screen = get_screen_by_screenid($slides['screenid']);
if (!empty($screen['name'])) {
$name = $screen['name'];
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:configuration.slideconf.edit.php
示例5: CComboBox
$condition = new CComboBox('new_condition[value]', null, null, eventType());
break;
case CONDITION_TYPE_HOST_METADATA:
$condition = new CTextBox('new_condition[value]', '', ZBX_TEXTBOX_STANDARD_SIZE);
break;
default:
$condition = null;
}
$conditionTable = new CTable(null, 'newActionConditionTable');
$conditionTable->addRow(array($conditionTypeComboBox, $conditionOperatorsComboBox, $condition));
$conditionTable->addRow(array(new CSubmit('add_condition', _('Add'), null, 'link_menu'), SPACE, SPACE));
$conditionFormList->addRow(_('New condition'), new CDiv($conditionTable, 'objectgroup inlineblock border_dotted ui-corner-all'));
/*
* Operation tab
*/
$operationFormList = new CFormList('operationlist');
if ($this->data['eventsource'] == EVENT_SOURCE_TRIGGERS || $this->data['eventsource'] == EVENT_SOURCE_INTERNAL) {
$operationFormList->addRow(_('Default operation step duration'), array(new CNumericBox('esc_period', $this->data['action']['esc_period'], 6, 'no'), ' (' . _('minimum 60 seconds') . ')'));
}
// create operation table
$operationsTable = new CTable(_('No operations defined.'), 'formElementTable');
$operationsTable->attr('style', 'min-width: 600px;');
if ($this->data['action']['eventsource'] == EVENT_SOURCE_TRIGGERS || $this->data['eventsource'] == EVENT_SOURCE_INTERNAL) {
$operationsTable->setHeader(array(_('Steps'), _('Details'), _('Start in'), _('Duration (sec)'), _('Action')));
$delay = count_operations_delay($this->data['action']['operations'], $this->data['action']['esc_period']);
} else {
$operationsTable->setHeader(array(_('Details'), _('Action')));
}
foreach ($this->data['action']['operations'] as $operationid => $operation) {
if (!str_in_array($operation['operationtype'], $this->data['allowedOperations'])) {
continue;
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:configuration.action.edit.php
示例6: dirname
** 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.
**/
require_once dirname(__FILE__) . '/js/monitoring.triggerComment.js.php';
$commentWidget = new CWidget('triggerComment');
$commentWidget->addPageHeader(_('TRIGGER DESCRIPTION'));
// create form
$commentForm = new CForm();
$commentForm->setName('commentForm');
$commentForm->addVar('triggerid', $this->data['triggerid']);
// create form list
$commentFormList = new CFormList('commentFormList');
$commentTextArea = new CTextArea('comments', CMacrosResolverHelper::resolveTriggerDescription($this->data['trigger']), array('rows' => 25, 'width' => ZBX_TEXTAREA_BIG_WIDTH, 'readonly' => $this->data['isCommentExist']));
$commentTextArea->attr('autofocus', 'autofocus');
$commentFormList->addRow(_('Description'), $commentTextArea);
// append tabs to form
$commentTab = new CTabView();
$commentTab->addTab('commentTab', _s('Description for "%s".', $this->data['trigger']['description']), $commentFormList);
$commentForm->addItem($commentTab);
// append buttons to form
$updateButton = new CSubmit('update', _('Update'));
$updateButton->setEnabled(!$this->data['isCommentExist']);
if ($this->data['isCommentExist']) {
$editButton = new CButton('edit', _('Edit'));
$editButton->setEnabled($this->data['isTriggerEditable']);
} else {
$editButton = null;
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:monitoring.triggerComment.php
示例7: insert_js
}
if (isset($_REQUEST['save']) && $result) {
if (!isset($_REQUEST['stepid'])) {
insert_js('add_httpstep(' . zbx_jsvalue($_REQUEST['dstfrm']) . ',' . zbx_jsvalue($_REQUEST['name']) . ',' . zbx_jsvalue($_REQUEST['timeout']) . ',' . zbx_jsvalue($_REQUEST['url']) . ',' . zbx_jsvalue($_REQUEST['posts']) . ',' . zbx_jsvalue($_REQUEST['variables']) . ',' . zbx_jsvalue($_REQUEST['required']) . ',' . zbx_jsvalue($_REQUEST['status_codes']) . ");\n");
} else {
insert_js('update_httpstep(' . zbx_jsvalue($_REQUEST['dstfrm']) . ',' . zbx_jsvalue($_REQUEST['list_name']) . ',' . zbx_jsvalue($_REQUEST['stepid']) . ',' . zbx_jsvalue($_REQUEST['name']) . ',' . zbx_jsvalue($_REQUEST['timeout']) . ',' . zbx_jsvalue($_REQUEST['url']) . ',' . zbx_jsvalue($_REQUEST['posts']) . ',' . zbx_jsvalue($_REQUEST['variables']) . ',' . zbx_jsvalue($_REQUEST['required']) . ',' . zbx_jsvalue($_REQUEST['status_codes']) . ");\n");
}
} else {
$httpPopupForm = new CForm();
$httpPopupForm->addVar('dstfrm', get_request('dstfrm', null));
$httpPopupForm->addVar('stepid', get_request('stepid', null));
$httpPopupForm->addVar('list_name', get_request('list_name', null));
$httpPopupForm->addVar('templated', get_request('templated', null));
$httpPopupForm->addVar('old_name', get_request('old_name', null));
$httpPopupForm->addVar('steps_names', get_request('steps_names', null));
$httpPopupFormList = new CFormList('httpPopupFormList');
$httpPopupFormList->addRow(_('Name'), new CTextBox('name', get_request('name', ''), ZBX_TEXTBOX_STANDARD_SIZE, get_request('templated', null), 64));
$httpPopupFormList->addRow(_('URL'), new CTextBox('url', get_request('url', ''), ZBX_TEXTBOX_STANDARD_SIZE));
$httpPopupFormList->addRow(_('Post'), new CTextArea('posts', get_request('posts', '')));
$httpPopupFormList->addRow(_('Variables'), new CTextArea('variables', get_request('variables', '')));
$httpPopupFormList->addRow(_('Timeout'), new CNumericBox('timeout', get_request('timeout', 15), 5));
$httpPopupFormList->addRow(_('Required string'), new CTextBox('required', get_request('required', ''), ZBX_TEXTBOX_STANDARD_SIZE));
$httpPopupFormList->addRow(_('Required status codes'), new CTextBox('status_codes', get_request('status_codes', ''), ZBX_TEXTBOX_STANDARD_SIZE));
// append tabs to form
$httpPopupTab = new CTabView();
$httpPopupTab->addTab('scenarioStepTab', _('Step of scenario'), $httpPopupFormList);
$httpPopupForm->addItem($httpPopupTab);
// append buttons to form
$stepid = get_request('stepid', null);
$httpPopupForm->addItem(makeFormFooter(new CSubmit('save', isset($stepid) ? _('Update') : _('Add')), new CButtonCancel(null, 'close_window();')));
$httpPopupWidget->addItem($httpPopupForm);
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:configuration.httpconf.popup.php
示例8: CWidget
**
** 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.
**/
$widget = (new CWidget())->setTitle(_('Discovery rules'))->addItem(get_header_host_table('discoveries', $this->data['hostid'], isset($this->data['parent_discoveryid']) ? $this->data['parent_discoveryid'] : 0));
// create form
$itemForm = (new CForm())->setName('itemForm')->addVar('form', $this->data['form'])->addVar('hostid', $this->data['hostid']);
if (!empty($this->data['parent_discoveryid'])) {
$itemForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']);
}
if (!empty($this->data['itemid'])) {
$itemForm->addVar('itemid', $this->data['itemid']);
}
// create form list
$itemFormList = new CFormList('itemFormList');
if (!empty($this->data['templates'])) {
$itemFormList->addRow(_('Parent discovery rules'), $this->data['templates']);
}
$itemFormList->addRow(_('Name'), (new CTextBox('name', $this->data['name'], $this->data['limited']))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)->setAttribute('autofocus', 'autofocus'));
// append type to form list
if ($this->data['limited']) {
$itemForm->addVar('type', $this->data['type']);
$itemFormList->addRow(_('Type'), (new CTextBox('typename', item_type2str($this->data['type']), true))->setWidth(ZBX_TEXTAREA_SMALL_WIDTH));
} else {
$typeComboBox = (new CComboBox('type', $this->data['type']))->addItems($this->data['types']);
$itemFormList->addRow(_('Type'), $typeComboBox);
}
// append key to form list
$itemFormList->addRow(_('Key'), [(new CTextBox('key', $this->data['key'], $this->data['limited']))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)]);
// append interfaces to form list
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:configuration.host.discovery.edit.php
示例9: CWidget
**
** 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.
**/
$hostGroupWidget = new CWidget();
$hostGroupWidget->addPageHeader(_('CONFIGURATION OF HOST GROUPS'));
// create form
$hostGroupForm = new CForm();
$hostGroupForm->setName('hostgroupForm');
$hostGroupForm->addVar('form', $this->data['form']);
if (isset($this->data['groupid'])) {
$hostGroupForm->addVar('groupid', $this->data['groupid']);
}
// create hostgroup form list
$hostGroupFormList = new CFormList('hostgroupFormList');
$nameTextBox = new CTextBox('name', $this->data['name'], ZBX_TEXTBOX_STANDARD_SIZE, $this->data['groupid'] && $this->data['group']['flags'] == ZBX_FLAG_DISCOVERY_CREATED, 64);
$nameTextBox->attr('autofocus', 'autofocus');
$hostGroupFormList->addRow(_('Group name'), $nameTextBox);
// append groups and hosts to form list
$groupsComboBox = new CComboBox('twb_groupid', $this->data['twb_groupid'], 'submit()');
$groupsComboBox->addItem('0', _('All'));
foreach ($this->data['db_groups'] as $group) {
$groupsComboBox->addItem($group['groupid'], $group['name']);
}
$hostsComboBox = new CTweenBox($hostGroupForm, 'hosts', $this->data['hosts'], 25);
foreach ($this->data['db_hosts'] as $host) {
if (!isset($this->data['hosts'][$host['hostid']])) {
$hostsComboBox->addItem($host['hostid'], $host['name']);
}
}
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:configuration.hostgroups.edit.php
示例10: CWidget
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
$widget = (new CWidget())->setTitle(_('Web monitoring'));
// append host summary to widget header
if (!empty($this->data['hostid'])) {
$widget->addItem(get_header_host_table('web', $this->data['hostid']));
}
// create form
$httpForm = (new CForm())->setName('httpForm')->addVar('form', $this->data['form'])->addVar('hostid', $this->data['hostid'])->addVar('steps', $this->data['steps'])->addVar('templated', $this->data['templated']);
if (!empty($this->data['httptestid'])) {
$httpForm->addVar('httptestid', $this->data['httptestid']);
}
/*
* Scenario tab
*/
$httpFormList = new CFormList('httpFormList');
// Parent http tests
if (!empty($this->data['templates'])) {
$httpFormList->addRow(_('Parent web scenarios'), $this->data['templates']);
}
// Name
$nameTextBox = (new CTextBox('name', $this->data['name'], $this->data['templated'], 64))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH);
if (!$this->data['templated']) {
$nameTextBox->setAttribute('autofocus', 'autofocus');
}
$httpFormList->addRow(_('Name'), $nameTextBox);
// Application
if ($this->data['application_list']) {
$applications = zbx_array_merge([''], $this->data['application_list']);
$httpFormList->addRow(_('Application'), new CComboBox('applicationid', $this->data['applicationid'], null, $applications));
} else {
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:configuration.httpconf.edit.php
示例11: CWidget
** 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.
**/
$proxyWidget = new CWidget();
$proxyWidget->addPageHeader(_('CONFIGURATION OF PROXIES'));
// create form
$proxyForm = new CForm();
$proxyForm->setName('proxyForm');
$proxyForm->addVar('form', $this->data['form']);
$proxyForm->addVar('form_refresh', $this->data['form_refresh']);
if (!empty($this->data['proxyid'])) {
$proxyForm->addVar('proxyid', $this->data['proxyid']);
}
// create form list
$proxyFormList = new CFormList('proxyFormList');
$proxyFormList->addRow(_('Proxy name'), new CTextBox('host', $this->data['name'], ZBX_TEXTBOX_STANDARD_SIZE, 'no', 64));
// append status to form list
$statusBox = new CComboBox('status', $this->data['status'], 'submit()');
$statusBox->addItem(HOST_STATUS_PROXY_ACTIVE, _('Active'));
$statusBox->addItem(HOST_STATUS_PROXY_PASSIVE, _('Passive'));
$proxyFormList->addRow(_('Proxy mode'), $statusBox);
if ($this->data['status'] == HOST_STATUS_PROXY_PASSIVE) {
if (isset($this->data['interface']['interfaceid'])) {
$proxyForm->addVar('interfaces[0][interfaceid]', $this->data['interface']['interfaceid']);
$proxyForm->addVar('interfaces[0][hostid]', $this->data['interface']['hostid']);
}
$interfaceTable = new CTable(_('No interfaces defined.'), 'formElementTable');
$interfaceTable->addRow(array(_('IP address'), _('DNS name'), _('Connect to'), _('Port')));
$connectByComboBox = new CRadioButtonList('interfaces[0][useip]', $this->data['interface']['useip']);
$connectByComboBox->addValue(_('IP'), 1);
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:administration.proxy.edit.php
示例12: CForm
// append host summary to widget header
if (!empty($this->data['hostid'])) {
$hostTableElement = $this->data['elements_field'] == 'group_graphid' ? 'graphs' : 'trigger';
$triggersWidget->addItem(get_header_host_table($hostTableElement, $this->data['hostid']));
}
if (!empty($this->data['title'])) {
$triggersWidget->addPageHeader($this->data['title']);
}
// create form
$triggersForm = new CForm();
$triggersForm->setName('triggersForm');
$triggersForm->addVar($this->data['elements_field'], $this->data['elements']);
$triggersForm->addVar('hostid', $this->data['hostid']);
$triggersForm->addVar('go', 'copy_to');
// create form list
$triggersFormList = new CFormList('triggersFormList');
// append copy types to form list
$copyTypeComboBox = new CComboBox('copy_type', $this->data['copy_type'], 'submit()');
$copyTypeComboBox->addItem(0, _('Hosts'));
$copyTypeComboBox->addItem(1, _('Host groups'));
$triggersFormList->addRow(_('Target type'), $copyTypeComboBox);
// append groups to form list
if ($this->data['copy_type'] == 0) {
$groupComboBox = new CComboBox('filter_groupid', $this->data['filter_groupid'], 'submit()');
foreach ($this->data['groups'] as $group) {
if (empty($this->data['filter_groupid'])) {
$this->data['filter_groupid'] = $group['groupid'];
}
$groupComboBox->addItem($group['groupid'], $group['name']);
}
$triggersFormList->addRow(_('Group'), $groupComboBox);
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:configuration.copy.elements.php
示例13: CTextBox
$text2 = new CTextBox('macros[' . $i . '][value]', $macro['value'], 40, $readonly, 255);
$text2->setAttribute('placeholder', _('value'));
$span = new CSpan('⇒');
$span->addStyle('vertical-align:top;');
$deleteButtonCell = null;
if (!$readonly) {
$deleteButtonCell = array(new CButton('macros_' . $i . '_remove', _('Remove'), null, 'link_menu element-table-remove'));
if (isset($macro['globalmacroid'])) {
$deleteButtonCell[] = new CVar('macros[' . $i . '][globalmacroid]', $macro['globalmacroid'], 'macros_' . $i . '_id');
}
if (isset($macro['hostmacroid'])) {
$deleteButtonCell[] = new CVar('macros[' . $i . '][hostmacroid]', $macro['hostmacroid'], 'macros_' . $i . '_id');
}
}
$row = array($text1, $span, $text2, $deleteButtonCell);
$macrosTable->addRow($row, 'form_row');
}
// buttons
if (!$readonly) {
$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);
$macrosTable->addRow($buttonRow);
}
// form list
$macrosFormList = new CFormList('macrosFormList');
$macrosFormList->addRow($macrosTable);
return $macrosFormList;
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:common.macros.php
示例14: foreach
foreach ($titles as $key => $title) {
$cbExist = $cbMissed = SPACE;
if (isset($rules[$key]['updateExisting'])) {
$cbExist = new CCheckBox('rules[' . $key . '][updateExisting]', $rules[$key]['updateExisting'], null, 1);
if ($key == 'images') {
if (CWebUser::$data['type'] != USER_TYPE_SUPER_ADMIN) {
continue;
}
$cbExist->setAttribute('onclick', 'if (this.checked) return confirm(\'' . _('Images for all maps will be updated!') . '\')');
}
}
if (isset($rules[$key]['createMissing'])) {
$cbMissed = new CCheckBox('rules[' . $key . '][createMissing]', $rules[$key]['createMissing'], null, 1);
}
$rulesTable->addRow(array($title, new CCol($cbExist, 'center'), new CCol($cbMissed, 'center')));
}
// form list
$importFormList = new CFormList('proxyFormList');
$importFormList->addRow(_('Import file'), new CFile('import_file'));
$importFormList->addRow(_('Rules'), new CDiv($rulesTable, 'border_dotted objectgroup inlineblock'));
// tab
$importTab = new CTabView();
$importTab->addTab('importTab', _('Import'), $importFormList);
// form
$importForm = new CForm('post', null, 'multipart/form-data');
$importForm->addItem($importTab);
$importForm->addItem(makeFormFooter(new CSubmit('import', _('Import')), new CButtonCancel()));
// widget
$importWidget = new CWidget();
$importWidget->addItem($importForm);
return $importWidget;
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:conf.import.php
示例15: CWidget
** (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.
**/
$widget = (new CWidget())->setTitle(_('Authentication'));
// create form
$authenticationForm = (new CForm())->setName('authenticationForm');
// create form list
$authenticationFormList = new CFormList('authenticationList');
// append config radio buttons to form list
$authenticationFormList->addRow(_('Default authentication'), (new CRadioButtonList('config', (int) $this->data['config']['authentication_type']))->addValue(_x('Internal', 'authentication'), ZBX_AUTH_INTERNAL, null, 'submit()')->addValue(_('LDAP'), ZBX_AUTH_LDAP, null, 'submit()')->addValue(_('HTTP'), ZBX_AUTH_HTTP, null, 'submit()')->setModern(true));
// append LDAP fields to form list
if ($this->data['config']['authentication_type'] == ZBX_AUTH_LDAP) {
if ($this->data['user_list']) {
$userComboBox = new CComboBox('user', $this->data['user']);
foreach ($this->data['user_list'] as $user) {
if (check_perm2login($user['userid']) && check_perm2system($user['userid'])) {
$userComboBox->addItem($user['alias'], $user['alias']);
}
}
} else {
$userComboBox = (new CTextBox('user', $this->data['user'], true))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH);
}
$authenticationFormList->addRow(_('LDAP host'), (new CTextBox('ldap_host', $this->data['config']['ldap_host']))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH));
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:administration.authentication.edit.php
示例16: CSubmit
$periodsDiv->addItem(new CSubmit('new_timeperiod', _('New'), null, 'link_menu'));
}
$maintenancePeriodFormList->addRow(_('Periods'), $periodsDiv);
if (isset($_REQUEST['new_timeperiod'])) {
if (is_array($_REQUEST['new_timeperiod']) && isset($_REQUEST['new_timeperiod']['id'])) {
$saveLabel = _('Save');
} else {
$saveLabel = _('Add');
}
$footer = array(new CSubmit('add_timeperiod', $saveLabel, null, 'link_menu'), SPACE . SPACE, new CSubmit('cancel_new_timeperiod', _('Cancel'), null, 'link_menu'));
$maintenancePeriodFormList->addRow(_('Maintenance period'), new CDiv(array(get_timeperiod_form(), $footer), 'objectgroup inlineblock border_dotted'));
}
/*
* Hosts & groups tab
*/
$hostsAndGroupsFormList = new CFormList('hostsAndGroupsFormList');
$hostTweenBox = new CTweenBox($maintenanceForm, 'hostids', $this->data['hostids'], 10);
foreach ($this->data['hosts'] as $host) {
$hostTweenBox->addItem($host['hostid'], $host['name']);
}
$groupsComboBox = new CComboBox('twb_groupid', $this->data['twb_groupid'], 'submit()');
foreach ($this->data['all_groups'] as $group) {
$groupsComboBox->addItem($group['groupid'], $group['name']);
}
$hostTable = new CTable(null, 'formElementTable');
$hostTable->addRow($hostTweenBox->get(_('In maintenance'), array(_('Other hosts | Group') . SPACE, $groupsComboBox)));
$hostsAndGroupsFormList->addRow(_('Hosts in maintenance'), $hostTable);
$groupTable = new CTable(null, 'formElementTable');
$groupTweenBox = new CTweenBox($maintenanceForm, 'groupids', $this->data['groupids'], 10);
foreach ($this->data['all_groups'] as $group) {
$groupTweenBox->addItem($group['groupid'], $group['name']);
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:configuration.maintenance.edit.php
示例17: dirname
** 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/configuration.triggers.expression.js.php';
$expressionWidget = new CWidget();
// create form
$expressionForm = new CForm();
$expressionForm->setName('expression');
$expressionForm->addVar('dstfrm', $this->data['dstfrm']);
$expressionForm->addVar('dstfld1', $this->data['dstfld1']);
$expressionForm->addVar('itemid', $this->data['itemid']);
if (!empty($this->data['parent_discoveryid'])) {
$expressionForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']);
}
// create form list
$expressionFormList = new CFormList('expressionFormList');
// append item to form list
$item = array(new CTextBox('description', $this->data['description'], ZBX_TEXTBOX_STANDARD_SIZE, 'yes'), new CButton('select', _('Select'), 'return PopUp(\'popup.php?writeonly=1&dstfrm=' . $expressionForm->getName() . '&dstfld1=itemid&dstfld2=description&submitParent=1' . (!empty($this->data['parent_discoveryid']) ? '&normal_only=1' : '') . '&srctbl=items&srcfld1=itemid&srcfld2=name\', 0, 0, \'zbx_popup_item\');', 'formlist'));
if (!empty($this->data['parent_discoveryid'])) {
$item[] = new CButton('select', _('Select prototype'), 'return PopUp(\'popup.php?dstfrm=' . $expressionForm->getName() . '&dstfld1=itemid&dstfld2=description&submitParent=1' . url_param('parent_discoveryid', true) . '&srctbl=prototypes&srcfld1=itemid&srcfld2=name\', 0, 0, \'zbx_popup_item\');', 'formlist');
}
$expressionFormList->addRow(_('Item'), $item);
// append function to form list
$functionComboBox = new CComboBox('expr_type', $this->data['expr_type'], 'submit()');
$functionComboBox->addStyle('width: 605px;');
foreach ($this->data['functions'] as $id => $f) {
// if user has selected an item, we are filtering out the triggers that can't work with it
if (empty($this->data['itemValueType']) || !empty($f['allowed_types'][$this->data['itemValueType']])) {
$functionComboBox->addItem($id, $f['description']);
}
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:configuration.triggers.expression.php
示例18: CWidget
**
** 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.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);
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:administration.script.edit.php
示例19: getPermissionsFormList
function getPermissionsFormList($rights = array(), $user_type = USER_TYPE_ZABBIX_USER, $rightsFormList = null)
{
// group
$lists['group']['label'] = _('Host groups');
$lists['group']['read_write'] = new CListBox('groups_write', null, 15);
$lists['group']['read_only'] = new CListBox('groups_read', null, 15);
$lists['group']['deny'] = new CListBox('groups_deny', null, 15);
$groups = get_accessible_groups_by_rights($rights, $user_type, PERM_DENY);
foreach ($groups as $group) {
switch ($group['permission']) {
case PERM_READ:
$list_name = 'read_only';
break;
case PERM_READ_WRITE:
$list_name = 'read_write';
break;
default:
$list_name = 'deny';
}
$lists['group'][$list_name]->addItem($group['groupid'], $group['name']);
}
unset($groups);
// host
$lists['host']['label'] = _('Hosts');
$lists['host']['read_write'] = new CListBox('hosts_write', null, 15);
$lists['host']['read_only'] = new CListBox('hosts_read', null, 15);
$lists['host']['deny'] = new CListBox('hosts_deny', null, 15);
$hosts = get_accessible_hosts_by_rights($rights, $user_type, PERM_DENY);
foreach ($hosts as $host) {
switch ($host['permission']) {
case PERM_READ:
$list_name = 'read_only';
break;
case PERM_READ_WRITE:
$list_name = 'read_write';
break;
default:
$list_name = 'deny';
}
if (HOST_STATUS_PROXY_ACTIVE == $host['status'] || HOST_STATUS_PROXY_PASSIVE == $host['status']) {
$host['host_name'] = $host['host'];
}
$lists['host'][$list_name]->addItem($host['hostid'], $host['host_name']);
}
unset($hosts);
// display
if (empty($rightsFormList)) {
$rightsFormList = new CFormList('rightsFormList');
}
$isHeaderDisplayed = false;
foreach ($lists as $list) {
$sLabel = '';
$row = new CRow();
foreach ($list as $class => $item) {
if (is_string($item)) {
$sLabel = $item;
} else {
$row->addItem(new CCol($item, $class));
}
}
$table = new CTable(_('No accessible resources'), 'right_table calculated');
if (!$isHeaderDisplayed) {
$table->setHeader(array(_('Read-write'), _('Read only'), _('Deny')), 'header');
$isHeaderDisplayed = true;
}
$table->addRow($row);
$rightsFormList->addRow($sLabel, $table);
}
return $rightsFormList;
}
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:70,代码来源:forms.inc.php
示例20: CTextBox
$ipmiList->addRow(_('Authentication algorithm'), $cmbIPMIAuthtype);
$cmbIPMIPrivilege = new CTextBox('ipmi_privilege_name', ipmiPrivileges($dbHost['ipmi_privilege']), ZBX_TEXTBOX_SMALL_SIZE, true);
$ipmiList->addRow(_('Privilege level'), $cmbIPMIPrivilege);
}
$ipmiList->addRow(_('Username'), new CTextBox('ipmi_username', $ipmi_username, ZBX_TEXTBOX_SMALL_SIZE, $isDiscovered));
$ipmiList->addRow(_('Password'), new CTextBox('ipmi_password', $ipmi_password, ZBX_TEXTBOX_SMALL_SIZE, $isDiscovered));
$divTabs->addTab('ipmiTab', _('IPMI'), $ipmiList);
/*
* Macros
*/
if (empty($macros)) {
$macros = array(array('macro' => '', 'value' => ''));
}
$macrosView = new CView('common.macros', array('macros' => $macros, 'readonly' => $isDiscovered));
$divTabs->addTab('macroTab', _('Macros'), $macrosView->render());
$inventoryFormList = new CFormList('inventorylist');
// radio buttons for inventory type choice
$inventoryMode = isset($dbHost['inventory']['inventory_mode']) ? $dbHost['inventory']['inventory_mode'] : HOST_INVENTORY_DISABLED;
$inventoryDisabledBtn = new CRadioButton('inventory_mode', HOST_INVENTORY_DISABLED, null, 'host_inventory_radio_' . HOST_INVENTORY_DISABLED, $inventoryMode == HOST_INVENTORY_DISABLED);
$inventoryDisabledBtn->setEnabled(!$isDiscovered);
$inventoryManualBtn = new CRadioButton('inventory_mode', HOST_INVENTORY_MANUAL, null, 'host_inventory_radio_' . HOST_INVENTORY_MANUAL, $inventoryMode == HOST_INVENTORY_MANUAL);
$inventoryManualBtn->setEnabled(!$isDiscovered);
$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']])) {
|
请发表评论