本文整理汇总了PHP中CTabView::setSelected方法的典型用法代码示例。如果您正苦于以下问题:PHP CTabView::setSelected方法的具体用法?PHP CTabView::setSelected怎么用?PHP CTabView::setSelected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTabView
的用法示例。
在下文中一共展示了CTabView::setSelected方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CComboBox
$operationConditionValueComboBox = new CComboBox('new_opcondition[value]', $new_opcondition['value']);
$operationConditionValueComboBox->addItem(0, _('Not Ack'));
$operationConditionValueComboBox->addItem(1, _('Ack'));
$rowCondition[] = $operationConditionValueComboBox;
}
$newOperationConditionTable->addRow($rowCondition);
$newOperationConditionFooter = array(new CSubmit('add_opcondition', _('Add'), null, 'link_menu'), SPACE . SPACE, new CSubmit('cancel_new_opcondition', _('Cancel'), null, 'link_menu'));
$newOperationsTable->addRow(array(_('Operation condition'), new CDiv(array($newOperationConditionTable, $newOperationConditionFooter), 'objectgroup inlineblock border_dotted ui-corner-all')));
}
$footer = array(new CSubmit('add_operation', $this->data['new_operation']['action'] == 'update' ? _('Update') : _('Add'), null, 'link_menu'), SPACE . SPACE, new CSubmit('cancel_new_operation', _('Cancel'), null, 'link_menu'));
$operationFormList->addRow(_('Operation details'), new CDiv(array($newOperationsTable, $footer), 'objectgroup inlineblock border_dotted ui-corner-all'));
}
// append tabs to form
$actionTabs = new CTabView();
if (!isset($_REQUEST['form_refresh'])) {
$actionTabs->setSelected(0);
}
$actionTabs->addTab('actionTab', _('Action'), $actionFormList);
$actionTabs->addTab('conditionTab', _('Conditions'), $conditionFormList);
$actionTabs->addTab('operationTab', _('Operations'), $operationFormList);
$actionForm->addItem($actionTabs);
// append buttons to form
$others = array();
if (!empty($this->data['actionid'])) {
$others[] = new CButton('clone', _('Clone'));
$others[] = new CButtonDelete(_('Delete current action?'), url_param('form') . url_param('eventsource') . url_param('actionid'));
}
$others[] = new CButtonCancel(url_param('actiontype'));
$actionForm->addItem(makeFormFooter(new CSubmit('save', _('Save')), $others));
// append form to widget
$actionWidget->addItem($actionForm);
示例2: dirname
** 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.
**/
require_once dirname(__FILE__) . '/js/configuration.host.edit.js.php';
$divTabs = new CTabView();
if (!isset($_REQUEST['form_refresh'])) {
$divTabs->setSelected(0);
}
$host_groups = get_request('groups', array());
if (isset($_REQUEST['groupid']) && $_REQUEST['groupid'] > 0 && empty($host_groups)) {
array_push($host_groups, $_REQUEST['groupid']);
}
$newgroup = get_request('newgroup', '');
$host = get_request('host', '');
$visiblename = get_request('visiblename', '');
$status = get_request('status', HOST_STATUS_MONITORED);
$proxy_hostid = get_request('proxy_hostid', '');
$ipmi_authtype = get_request('ipmi_authtype', -1);
$ipmi_privilege = get_request('ipmi_privilege', 2);
$ipmi_username = get_request('ipmi_username', '');
$ipmi_password = get_request('ipmi_password', '');
$inventory_mode = get_request('inventory_mode', HOST_INVENTORY_DISABLED);
示例3: elseif
if ($rights['permission'] == PERM_DENY) {
$lstDeny->addItem($id, $rights['name']);
} elseif ($rights['permission'] == PERM_READ) {
$lstRead->addItem($id, $rights['name']);
} elseif ($rights['permission'] == PERM_READ_WRITE) {
$lstWrite->addItem($id, $rights['name']);
}
}
$permissionsTable->addRow(array(new CCol($lstWrite, 'read_write'), new CCol($lstRead, 'read_only'), new CCol($lstDeny, 'deny')));
$permissionsTable->addRow(array(array(new CButton('add_read_write', _('Add'), "return PopUp('popup_right.php?dstfrm=" . $userGroupForm->getName() . '&permission=' . PERM_READ_WRITE . "', 450, 450);", 'formlist'), new CSubmit('del_read_write', _('Delete selected'), null, 'formlist')), array(new CButton('add_read_only', _('Add'), "return PopUp('popup_right.php?dstfrm=" . $userGroupForm->getName() . '&permission=' . PERM_READ . "', 450, 450);", 'formlist'), new CSubmit('del_read_only', _('Delete selected'), null, 'formlist')), array(new CButton('add_deny', _('Add'), "return PopUp('popup_right.php?dstfrm=" . $userGroupForm->getName() . '&permission=' . PERM_DENY . "', 450, 450);", 'formlist'), new CSubmit('del_deny', _('Delete selected'), null, 'formlist'))));
$permissionsFormList->addRow(_('Composing permissions'), $permissionsTable);
$permissionsFormList->addRow(_('Calculated permissions'), '');
$permissionsFormList = getPermissionsFormList($this->data['group_rights'], null, $permissionsFormList);
// append form lists to tab
$userGroupTab = new CTabView();
if (!$this->data['form_refresh']) {
$userGroupTab->setSelected(0);
}
$userGroupTab->addTab('userGroupTab', _('User group'), $userGroupFormList);
$userGroupTab->addTab('permissionsTab', _('Permissions'), $permissionsFormList);
// append tab to form
$userGroupForm->addItem($userGroupTab);
// append buttons to form
if (isset($this->data['usrgrpid'])) {
$userGroupForm->addItem(makeFormFooter(new CSubmit('update', _('Update')), array(new CButtonDelete(_('Delete selected group?'), url_param('form') . url_param('usrgrpid') . url_param('config')), new CButtonCancel(url_param('config')))));
} else {
$userGroupForm->addItem(makeFormFooter(new CSubmit('add', _('Add')), new CButtonCancel(url_param('config'))));
}
// append form to widget
$userGroupWidget->addItem($userGroupForm);
return $userGroupWidget;
示例4: CLink
$graphsLink = new CLink(_('Graphs'), 'graphs.php?hostid=' . $this->data['host']['hostid'] . url_param('groupid'));
$discoveryLink = new CLink(_('Discovery'), 'host_discovery.php?hostid=' . $this->data['host']['hostid'] . url_param('groupid'));
$webLink = new CLink(_('Web'), 'httpconf.php?hostid=' . $this->data['host']['hostid'] . url_param('groupid'));
} else {
$hostLink = _('Host');
$applicationsLink = _('Application');
$itemsLink = _('Items');
$triggersLink = _('Triggers');
$graphsLink = _('Graphs');
$discoveryLink = _('Discovery');
$webLink = _('Web');
}
$configurationArray = array($hostLink, new CSpan(array($applicationsLink, SPACE, '(' . $this->data['host']['applications'] . ')'), 'overview-link'), new CSpan(array($itemsLink, SPACE, '(' . $this->data['host']['items'] . ')'), 'overview-link'), new CSpan(array($triggersLink, SPACE, '(' . $this->data['host']['triggers'] . ')'), 'overview-link'), new CSpan(array($graphsLink, SPACE, '(' . $this->data['host']['graphs'] . ')'), 'overview-link'), new CSpan(array($discoveryLink, SPACE, '(' . $this->data['host']['discoveries'] . ')'), 'overview-link'), new CSpan(array($webLink, SPACE, '(' . $this->data['host']['httpTests'] . ')'), 'overview-link'));
$overviewFormList->addRow(_('Configuration'), $configurationArray);
$hostInventoriesTab = new CTabView(array('remember' => true));
$hostInventoriesTab->setSelected(0);
$hostInventoriesTab->addTab('overviewTab', _('Overview'), $overviewFormList);
/*
* Details tab
*/
$detailsFormList = new CFormList();
$inventoryValues = false;
if ($this->data['host']['inventory']) {
foreach ($this->data['host']['inventory'] as $key => $value) {
if (!zbx_empty($value)) {
$detailsFormList->addRow($this->data['tableTitles'][$key]['title'], new CSpan(zbx_str2links($value), 'text-field'));
$inventoryValues = true;
}
}
}
if (!$inventoryValues) {
示例5: CComboBox
$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']);
}
$groupTable->addRow($groupTweenBox->get(_('In maintenance'), _('Other groups')));
$hostsAndGroupsFormList->addRow(_('Groups in maintenance'), $groupTable);
// append tabs to form
$maintenanceTab = new CTabView();
if (!$this->data['form_refresh']) {
$maintenanceTab->setSelected(0);
}
$maintenanceTab->addTab('maintenanceTab', _('Maintenance'), $maintenanceFormList);
$maintenanceTab->addTab('periodsTab', _('Periods'), $maintenancePeriodFormList);
$maintenanceTab->addTab('hostTab', _('Hosts & Groups'), $hostsAndGroupsFormList);
$maintenanceForm->addItem($maintenanceTab);
// append buttons to form
if (empty($this->data['maintenanceid'])) {
$maintenanceForm->addItem(makeFormFooter(new CSubmit('save', _('Save')), new CButtonCancel()));
} else {
$maintenanceForm->addItem(makeFormFooter(new CSubmit('save', _('Save')), array(new CSubmit('clone', _('Clone')), new CButtonDelete(_('Delete maintenance period?'), url_param('form') . url_param('maintenanceid')), new CButtonCancel())));
}
$maintenanceWidget->addItem($maintenanceForm);
return $maintenanceWidget;
示例6: CComboBox
$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');
/*
* Test tab
*/
$testTab = new CFormList('testTab');
$testTab->addRow(_('Test string'), new CTextArea('test_string', $this->get('test_string')));
$preloaderDiv = new CDiv(null, 'preloader', 'testPreloader');
$preloaderDiv->addStyle('display: none');
$testTab->addRow(SPACE, array(new CButton('testExpression', _('Test expressions')), $preloaderDiv));
$tabExp = new CTableInfo(null);
$tabExp->attr('id', 'testResultTable');
$tabExp->setHeader(array(_('Expression'), _('Expression type'), _('Result')));
$testTab->addRow(_('Result'), $tabExp);
$regExpView = new CTabView();
if (!$this->data['form_refresh']) {
$regExpView->setSelected(0);
}
$regExpView->addTab('expr', _('Expressions'), $exprTab);
$regExpView->addTab('test', _('Test'), $testTab);
$form->addItem($regExpView);
// footer
if (isset($this->data['regexpid'])) {
$form->addItem(makeFormFooter(new CSubmit('update', _('Update')), array(new CButton('clone', _('Clone')), new CButtonDelete(_('Delete regular expression?'), url_param('regexpid') . url_param('regexp.massdelete', false, 'action')), new CButtonCancel())));
} else {
$form->addItem(makeFormFooter(new CSubmit('add', _('Add')), new CButtonCancel()));
}
return $form;
示例7: foreach
foreach ($severities as $severity) {
$soundList = new CComboBox('messages[sounds.' . $severity . ']', $this->data['messages']['sounds.' . $severity]);
foreach ($zbxSounds as $filename => $file) {
$soundList->addItem($file, $filename);
}
$triggersTable->addRow(array(new CCheckBox('messages[triggers.severities][' . $severity . ']', isset($this->data['messages']['triggers.severities'][$severity]), null, 1), getSeverityCaption($severity), SPACE, $soundList, new CButton('start', _('Play'), "javascript: testUserSound('messages_sounds." . $severity . "');", 'formlist'), new CButton('stop', _('Stop'), 'javascript: AudioControl.stop();', 'formlist')));
zbx_subarray_push($msgVisibility, 1, 'messages[triggers.severities][' . $severity . ']');
zbx_subarray_push($msgVisibility, 1, 'messages[sounds.' . $severity . ']');
}
$userMessagingFormList->addRow(_('Trigger severity'), $triggersTable, false, 'triggers_row');
zbx_add_post_js("\n\t\tjQuery('#messages_enabled').bind('click', function() {\n\t\t\tif (this.checked\n\t\t\t\t\t&& !jQuery(\"input[id='messages_triggers.recovery']\").is(':checked')\n\t\t\t\t\t&& !jQuery(\"input[id='messages_triggers.severities_0']\").is(':checked')\n\t\t\t\t\t&& !jQuery(\"input[id='messages_triggers.severities_1']\").is(':checked')\n\t\t\t\t\t&& !jQuery(\"input[id='messages_triggers.severities_2']\").is(':checked')\n\t\t\t\t\t&& !jQuery(\"input[id='messages_triggers.severities_3']\").is(':checked')\n\t\t\t\t\t&& !jQuery(\"input[id='messages_triggers.severities_4']\").is(':checked')\n\t\t\t\t\t&& !jQuery(\"input[id='messages_triggers.severities_5']\").is(':checked')) {\n\t\t\t\tjQuery(\"input[id='messages_triggers.recovery']\").attr('checked', true);\n\t\t\t\tjQuery(\"input[id='messages_triggers.severities_0']\").attr('checked', true);\n\t\t\t\tjQuery(\"input[id='messages_triggers.severities_1']\").attr('checked', true);\n\t\t\t\tjQuery(\"input[id='messages_triggers.severities_2']\").attr('checked', true);\n\t\t\t\tjQuery(\"input[id='messages_triggers.severities_3']\").attr('checked', true);\n\t\t\t\tjQuery(\"input[id='messages_triggers.severities_4']\").attr('checked', true);\n\t\t\t\tjQuery(\"input[id='messages_triggers.severities_5']\").attr('checked', true);\n\t\t\t}\n\n\t\t\t// enable/disable childs fields\n\t\t\tif (this.checked) {\n\t\t\t\tjQuery('#messagingTab input, #messagingTab select').removeAttr('disabled');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tjQuery('#messagingTab input, #messagingTab select').attr('disabled', 'disabled');\n\t\t\t\tjQuery('#messages_enabled').removeAttr('disabled');\n\t\t\t}\n\t\t});\n\n\t\t// initial state: enable/disable childs fields\n\t\tif (jQuery('#messages_enabled').is(':checked')) {\n\t\t\tjQuery('#messagingTab input, #messagingTab select').removeAttr('disabled');\n\t\t}\n\t\telse {\n\t\t\tjQuery('#messagingTab input, #messagingTab select').attr('disabled', 'disabled');\n\t\t\tjQuery('#messages_enabled').removeAttr('disabled');\n\t\t}");
}
// append form lists to tab
$userTab = new CTabView();
if (!$this->data['form_refresh']) {
$userTab->setSelected(0);
}
$userTab->addTab('userTab', _('User'), $userFormList);
if (isset($userMediaFormList)) {
$userTab->addTab('mediaTab', _('Media'), $userMediaFormList);
}
if (!$this->data['is_profile']) {
/*
* Permissions tab
*/
$permissionsFormList = new CFormList('permissionsFormList');
$userTypeComboBox = new CComboBox('user_type', $this->data['user_type'], 'submit();');
$userTypeComboBox->addItem(USER_TYPE_ZABBIX_USER, user_type2str(USER_TYPE_ZABBIX_USER));
$userTypeComboBox->addItem(USER_TYPE_ZABBIX_ADMIN, user_type2str(USER_TYPE_ZABBIX_ADMIN));
$userTypeComboBox->addItem(USER_TYPE_SUPER_ADMIN, user_type2str(USER_TYPE_SUPER_ADMIN));
if (isset($this->data['userid']) && bccomp(CWebUser::$data['userid'], $this->data['userid']) == 0) {
示例8: CButton
if ($this->data['templated']) {
$removeButton = SPACE;
$dragHandler = SPACE;
} else {
$removeButton = new CButton('remove_' . $stepid, _('Remove'), 'javascript: removeStep(this);', 'link_menu');
$removeButton->setAttribute('remove_step', $stepid);
$dragHandler = new CSpan(null, 'ui-icon ui-icon-arrowthick-2-n-s move');
}
$row = new CRow(array($dragHandler, $numSpan, $name, $step['timeout'] . SPACE . _('sec'), $url, htmlspecialchars($step['required']), $step['status_codes'], $removeButton), 'sortable', 'steps_' . $stepid);
$stepsTable->addRow($row);
}
if (!$this->data['templated']) {
$stepsTable->addRow(new CCol(new CButton('add_step', _('Add'), null, 'link_menu'), null, 8));
}
$httpStepFormList->addRow(_('Steps'), new CDiv($stepsTable, 'objectgroup inlineblock border_dotted ui-corner-all'));
// append tabs to form
$httpTab = new CTabView();
if (!$this->data['form_refresh']) {
$httpTab->setSelected(0);
}
$httpTab->addTab('scenarioTab', _('Scenario'), $httpFormList);
$httpTab->addTab('stepTab', _('Steps'), $httpStepFormList);
$httpForm->addItem($httpTab);
// append buttons to form
if (!empty($this->data['httptestid'])) {
$httpForm->addItem(makeFormFooter(new CSubmit('save', _('Save')), array(new CSubmit('clone', _('Clone')), $this->data['templated'] ? null : new CButtonDelete(_('Delete scenario?'), url_param('form') . url_param('httptestid') . url_param('hostid')), new CButtonCancel(url_param('hostid')))));
} else {
$httpForm->addItem(makeFormFooter(new CSubmit('save', _('Save')), new CButtonCancel()));
}
$httpWidget->addItem($httpForm);
return $httpWidget;
示例9: BR
$triggersFormList->addRow(null, [$wrapOutline, BR(), BR(), (new CDiv([$expressionTable, $testButton]))->addClass(ZBX_STYLE_TABLE_FORMS_SEPARATOR)->setAttribute('style', 'min-width: ' . ZBX_TEXTAREA_BIG_WIDTH . 'px;')]);
$inputMethodToggle = (new CButton(null, _('Close expression constructor')))->addClass(ZBX_STYLE_BTN_LINK)->onClick('javascript: ' . 'document.getElementById("toggle_input_method").value=1;' . 'document.getElementById("input_method").value=' . IM_ESTABLISHED . ';' . 'document.forms["' . $triggersForm->getName() . '"].submit();');
$triggersFormList->addRow(null, [$inputMethodToggle, BR()]);
}
$triggersFormList->addRow(_('Multiple PROBLEM events generation'), (new CCheckBox('type'))->setChecked($this->data['type'] == TRIGGER_MULT_EVENT_ENABLED))->addRow(_('Description'), (new CTextArea('comments', $this->data['comments']))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH))->addRow(_('URL'), (new CTextBox('url', $this->data['url']))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH))->addRow(_('Severity'), new CSeverity(['name' => 'priority', 'value' => (int) $this->data['priority']]));
// append status to form list
if (empty($this->data['triggerid']) && empty($this->data['form_refresh'])) {
$status = true;
} else {
$status = $this->data['status'] == 0;
}
$triggersFormList->addRow(_('Enabled'), (new CCheckBox('status'))->setChecked($status));
// append tabs to form
$triggersTab = new CTabView();
if (!$this->data['form_refresh']) {
$triggersTab->setSelected(0);
}
$triggersTab->addTab('triggersTab', _('Trigger'), $triggersFormList);
/*
* Dependencies tab
*/
$dependenciesFormList = new CFormList('dependenciesFormList');
$dependenciesTable = (new CTable())->setAttribute('style', 'width: 100%;')->setHeader([_('Name'), _('Action')]);
foreach ($this->data['db_dependencies'] as $dependency) {
$triggersForm->addVar('dependencies[]', $dependency['triggerid'], 'dependencies_' . $dependency['triggerid']);
$depTriggerDescription = CHtml::encode(implode(', ', zbx_objectValues($dependency['hosts'], 'name')) . NAME_DELIMITER . $dependency['description']);
if ($dependency['flags'] == ZBX_FLAG_DISCOVERY_NORMAL) {
$description = (new CLink($depTriggerDescription, 'triggers.php?form=update&triggerid=' . $dependency['triggerid']))->setAttribute('target', '_blank');
} else {
$description = $depTriggerDescription;
}
示例10: 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.
**/
$this->includeJSfile('app/views/administration.proxy.edit.js.php');
$widget = (new CWidget())->setTitle(_('Proxies'));
$tabs = new CTabView();
if ($data['form_refresh'] == 0) {
$tabs->setSelected(0);
}
$proxyForm = (new CForm())->setId('proxyForm')->addVar('proxyid', $data['proxyid'])->addVar('tls_accept', $data['tls_accept']);
if ($data['status'] == HOST_STATUS_PROXY_PASSIVE && array_key_exists('interfaceid', $data)) {
$proxyForm->addVar('interfaceid', $data['interfaceid']);
}
$interfaceTable = (new CTable())->setHeader([_('IP address'), _('DNS name'), _('Connect to'), _('Port')])->addRow([(new CTextBox('ip', $data['ip'], false, 64))->setWidth(ZBX_TEXTAREA_INTERFACE_IP_WIDTH), (new CTextBox('dns', $data['dns'], false, 64))->setWidth(ZBX_TEXTAREA_INTERFACE_DNS_WIDTH), (new CRadioButtonList('useip', (int) $data['useip']))->addValue(_('IP'), INTERFACE_USE_IP)->addValue(_('DNS'), INTERFACE_USE_DNS)->setModern(true), (new CTextBox('port', $data['port'], false, 64))->setWidth(ZBX_TEXTAREA_INTERFACE_PORT_WIDTH)]);
// append hosts to form list
$hosts_tween_box = new CTweenBox($proxyForm, 'proxy_hostids', $data['proxy_hostids']);
foreach ($data['all_hosts'] as $host) {
// show only normal hosts, and discovered hosts monitored by the current proxy
// for new proxies display only normal hosts
if ($host['flags'] == ZBX_FLAG_DISCOVERY_NORMAL || $data['proxyid'] != 0 && bccomp($data['proxyid'], $host['proxy_hostid']) == 0) {
$hosts_tween_box->addItem($host['hostid'], $host['name'], null, $host['proxy_hostid'] == 0 || bccomp($host['proxy_hostid'], $data['proxyid']) == 0 && $host['flags'] == ZBX_FLAG_DISCOVERY_NORMAL);
}
}
示例11: CCol
$timeToMinuteTextBox->setAttribute('placeholder', _('mm'));
$serviceTimeTable->addRow(array(_('From'), $weekFromComboBox, new CCol(array(_('Time'), SPACE, $timeFromHourTextBox, ' : ', $timeFromMinuteTextBox))));
$serviceTimeTable->addRow(array(_('Till'), $weekToComboBox, new CCol(array(_('Time'), SPACE, $timeToHourTextBox, ' : ', $timeToMinuteTextBox))));
$servicesForm->addVar('new_service_time[note]', '');
}
$timeTypeComboBox = new CComboBox('new_service_time[type]', $this->data['new_service_time']['type'], 'javascript: document.forms[0].action += \'?form=1\'; submit();');
$timeTypeComboBox->addItem(SERVICE_TIME_TYPE_UPTIME, _('Uptime'));
$timeTypeComboBox->addItem(SERVICE_TIME_TYPE_DOWNTIME, _('Downtime'));
$timeTypeComboBox->addItem(SERVICE_TIME_TYPE_ONETIME_DOWNTIME, _('One-time downtime'));
$servicesTimeFormList->addRow(_('New service time'), new CDiv(array(new CDiv($timeTypeComboBox, 'time-type-combobox'), $serviceTimeTable, new CButton('add_service_time', _('Add'), null, 'link_menu')), 'objectgroup inlineblock border_dotted ui-corner-all'));
/*
* Append tabs to form
*/
$servicesTab = new CTabView();
if (!$this->data['form_refresh']) {
$servicesTab->setSelected(0);
}
$servicesTab->addTab('servicesTab', _('Service'), $servicesFormList);
$servicesTab->addTab('servicesDependenciesTab', _('Dependencies'), $servicesDependenciesFormList);
$servicesTab->addTab('servicesTimeTab', _('Time'), $servicesTimeFormList);
$servicesForm->addItem($servicesTab);
// append buttons to form
if ($service['serviceid']) {
if ($service['dependencies']) {
$btnDelete = null;
} else {
$btnDelete = new CButtonDelete('Delete selected service?', url_param('form') . url_param('serviceid') . '&saction=1');
}
$servicesForm->addItem(makeFormFooter(new CSubmit('update', _('Update'), 'javascript: document.forms[0].action += \'?saction=1\';'), array($btnDelete, new CButtonCancel())));
} else {
$servicesForm->addItem(makeFormFooter(new CSubmit('add', _('Add'), 'javascript: document.forms[0].action += \'?saction=1\';'), new CButtonCancel()));
示例12: CRow
$itemsTable->addRow(new CRow(new CCol(array($addButton, SPACE, SPACE, SPACE, $addPrototypeButton), null, 8), null, 'itemButtonsRow'));
foreach ($this->data['items'] as $n => $item) {
$name = $item['host'] . NAME_DELIMITER . $item['name_expanded'];
if (zbx_empty($item['drawtype'])) {
$item['drawtype'] = 0;
}
if (zbx_empty($item['yaxisside'])) {
$item['yaxisside'] = 0;
}
insert_js('loadItem(' . $n . ', ' . CJs::encodeJson($item['gitemid']) . ', ' . $this->data['graphid'] . ', ' . $item['itemid'] . ', ' . CJs::encodeJson($name) . ', ' . $item['type'] . ', ' . $item['calc_fnc'] . ', ' . $item['drawtype'] . ', ' . $item['yaxisside'] . ', \'' . $item['color'] . '\', ' . $item['flags'] . ');', true);
}
$graphFormList->addRow(_('Items'), new CDiv($itemsTable, 'objectgroup inlineblock border_dotted ui-corner-all'));
// append tabs to form
$graphTab = new CTabView();
if (!$this->data['form_refresh']) {
$graphTab->setSelected(0);
}
$graphTab->addTab('graphTab', empty($this->data['parent_discoveryid']) ? _('Graph') : _('Graph prototype'), $graphFormList);
/*
* Preview tab
*/
$chartImage = new CImg('chart3.php?period=3600');
$chartImage->preload();
$graphPreviewTable = new CTable(null, 'center maxwidth');
$graphPreviewTable->addRow(new CDiv($chartImage, null, 'previewChar'));
$graphTab->addTab('previewTab', _('Preview'), $graphPreviewTable);
$graphForm->addItem($graphTab);
// append buttons to form
if (!empty($this->data['graphid'])) {
$updateButton = new CSubmit('update', _('Update'));
$deleteButton = new CButtonDelete($this->data['parent_discoveryid'] ? _('Delete graph prototype?') : _('Delete graph?'), url_params(array('graphid', 'parent_discoveryid', 'hostid')));
示例13: foreach
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;');
}
$inventoryFormList->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();
// reset the tab when opening the form for the first time
if (!hasRequest('masssave')) {
$hostTab->setSelected(0);
}
$hostTab->addTab('hostTab', _('Host'), $hostFormList);
$hostTab->addTab('templatesTab', _('Templates'), $templatesFormList);
$hostTab->addTab('ipmiTab', _('IPMI'), $ipmiFormList);
$hostTab->addTab('inventoryTab', _('Inventory'), $inventoryFormList);
$hostForm->addItem($hostTab);
// append buttons to form
$hostForm->addItem(makeFormFooter(new CSubmit('masssave', _('Update')), new CButtonCancel(url_param('groupid'))));
return $hostForm;
示例14: array
$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();
if (!hasRequest('form_refresh')) {
$itemTab->setSelected(0);
}
$itemTab->addTab('itemTab', $this->data['caption'], $itemFormList);
$itemTab->addTab('macroTab', _('Filters'), $conditionFormList);
$itemForm->addItem($itemTab);
// append buttons to form
if (!empty($this->data['itemid'])) {
if (!$this->data['limited']) {
$btnDelete = new CButtonDelete(_('Delete discovery rule?'), url_params(array('form', 'groupid', 'itemid', 'parent_discoveryid', 'hostid')));
} else {
$btnDelete = null;
}
$itemForm->addItem(makeFormFooter(new CSubmit('update', _('Update')), array(new CSubmit('clone', _('Clone')), $btnDelete, new CButtonCancel(url_param('groupid') . url_param('parent_discoveryid') . url_param('hostid')))));
} else {
$itemForm->addItem(makeFormFooter(new CSubmit('add', _('Add')), new CButtonCancel(url_param('groupid') . url_param('parent_discoveryid') . url_param('hostid'))));
}