本文整理汇总了PHP中CSubmit::setEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP CSubmit::setEnabled方法的具体用法?PHP CSubmit::setEnabled怎么用?PHP CSubmit::setEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSubmit
的用法示例。
在下文中一共展示了CSubmit::setEnabled方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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/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;
}
$commentForm->addItem(makeFormFooter($updateButton, array($editButton, new CButtonCancel('&triggerid=' . $this->data['triggerid']))));
$commentWidget->addItem($commentForm);
return $commentWidget;
示例2: bodyToString
function bodyToString($destroy = true)
{
$left = new CDiv(null, 'left');
$left->addItem(new CDiv($this->getList(), 'left_menu'));
$link1 = new CLink('www.zabbix.com', 'http://www.zabbix.com/', null, null, true);
$link1->setAttribute('target', '_blank');
$link2 = new CLink('GPL v2', 'http://www.zabbix.com/license.php', null, null, true);
$link2->setAttribute('target', '_blank');
$licence = new CDiv(array($link1, BR(), ' Licensed under ', $link2), 'setup_wizard_licence');
$left->addItem($licence);
$right = new CDiv(null, 'right');
if ($this->getStep() == 0) {
$right->addItem(new CDiv(null, 'blank_title'));
$right->addItem(new CDiv($this->getState(), 'blank_under_title'));
$container = new CDiv(array($left, $right), 'setup_wizard setup_wizard_welcome');
} else {
$right->addItem(new CDiv($this->stage[$this->getStep()]['title'], 'setup_title'));
$right->addItem(new CDiv($this->getState(), 'under_title'));
$container = new CDiv(array($left, $right), 'setup_wizard');
}
if (isset($this->stage[$this->getStep() + 1])) {
$next = new CSubmit('next[' . $this->getStep() . ']', _('Next') . SPACE . '»');
} else {
$next = new CSubmit('finish', _('Finish'));
}
if (isset($this->HIDE_CANCEL_BUTTON) && $this->HIDE_CANCEL_BUTTON) {
$cancel = null;
} else {
$cancel = new CDiv(new CSubmit('cancel', _('Cancel')), 'footer_left');
}
if ($this->DISABLE_NEXT_BUTTON) {
$next->setEnabled(false);
}
// if the user is not logged in (first setup run) hide the "previous" button on the final step
if ($this->getStep() && (CWebUser::$data && CWebUser::getType() == USER_TYPE_SUPER_ADMIN || $this->getStep() < 5)) {
$back = new CSubmit('back[' . $this->getStep() . ']', '«' . SPACE . _('Previous'));
} else {
$back = null;
}
$footer = new CDiv(array($cancel, new CDiv(array($back, $next), 'footer_right')), 'footer');
$container->addItem($footer);
return parent::bodyToString($destroy) . $container->ToString();
}
示例3: dirname
** 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.item.list.js.php';
$itemsWidget = new CWidget(null, 'item-list');
// create new item button
$createForm = new CForm('get');
$createForm->cleanItems();
if (empty($this->data['hostid'])) {
$createButton = new CSubmit('form', _('Create item (select host first)'));
$createButton->setEnabled(false);
$createForm->addItem($createButton);
} else {
$createForm->addVar('hostid', $this->data['hostid']);
$createForm->addItem(new CSubmit('form', _('Create item')));
}
$itemsWidget->addPageHeader(_('CONFIGURATION OF ITEMS'), $createForm);
// header
$itemsWidget->addHeader(_('Items'));
$itemsWidget->addHeaderRowNumber();
if (!empty($this->data['hostid'])) {
$itemsWidget->addItem(get_header_host_table('items', $this->data['hostid']));
}
$itemsWidget->addFlicker($this->data['flicker'], CProfile::get('web.items.filter.state', 0));
// create form
$itemForm = new CForm();
示例4: CSubmit
$createForm->cleanItems();
if (!empty($this->data['parent_discoveryid'])) {
$createForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']);
$createForm->addItem(new CSubmit('form', _('Create graph prototype')));
$graphWidget->addPageHeader(_('CONFIGURATION OF GRAPH PROTOTYPES'), $createForm);
$graphWidget->addHeader(array(_('Graph prototypes of') . SPACE, new CSpan($this->data['discovery_rule']['name'], 'parent-discovery')));
if (!empty($this->data['hostid'])) {
$graphWidget->addItem(get_header_host_table('graphs', $this->data['hostid'], $this->data['parent_discoveryid']));
}
} else {
$createForm->addVar('hostid', $this->data['hostid']);
if (!empty($this->data['hostid'])) {
$createForm->addItem(new CSubmit('form', _('Create graph')));
} else {
$createGraphButton = new CSubmit('form', _('Create graph (select host first)'));
$createGraphButton->setEnabled(false);
$createForm->addItem($createGraphButton);
}
$graphWidget->addPageHeader(_('CONFIGURATION OF GRAPHS'), $createForm);
$filterForm = new CForm('get');
$filterForm->addItem(array(_('Group') . SPACE, $this->data['pageFilter']->getGroupsCB(true)));
$filterForm->addItem(array(SPACE . _('Host') . SPACE, $this->data['pageFilter']->getHostsCB(true)));
$graphWidget->addHeader(_('Graphs'), $filterForm);
if (!empty($this->data['hostid'])) {
$graphWidget->addItem(get_header_host_table('graphs', $this->data['hostid']));
}
}
$graphWidget->addHeaderRowNumber();
// create form
$graphForm = new CForm();
$graphForm->setName('graphForm');
示例5: empty
}
$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, 'graph');
$graphPreviewTable->addRow(new CDiv($chartImage, null, 'previewChar'));
$graphTab->addTab('previewTab', _('Preview'), $graphPreviewTable);
$graphForm->addItem($graphTab);
// append buttons to form
$saveButton = new CSubmit('save', _('Save'));
$cancelButton = new CButtonCancel(url_param('parent_discoveryid'));
if (!empty($this->data['graphid'])) {
$deleteButton = new CButtonDelete($this->data['parent_discoveryid'] ? _('Delete graph prototype?') : _('Delete graph?'), url_params(array('graphid', 'parent_discoveryid', 'hostid')));
$cloneButton = new CSubmit('clone', _('Clone'));
if (!empty($this->data['templateid'])) {
$saveButton->setEnabled(false);
$deleteButton->setEnabled(false);
}
$graphForm->addItem(makeFormFooter($saveButton, array($cloneButton, $deleteButton, $cancelButton)));
} else {
$graphForm->addItem(makeFormFooter($saveButton, $cancelButton));
}
// insert js (depended from some variables inside the file)
insert_show_color_picker_javascript();
require_once dirname(__FILE__) . '/js/configuration.graph.edit.js.php';
// append form to widget
$graphWidget->addItem($graphForm);
return $graphWidget;
示例6: empty
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')));
if (!empty($this->data['templateid'])) {
$updateButton->setEnabled(false);
$deleteButton->setEnabled(false);
}
$graphForm->addItem(makeFormFooter($updateButton, array(new CSubmit('clone', _('Clone')), $deleteButton, new CButtonCancel(url_param('parent_discoveryid')))));
} else {
$graphForm->addItem(makeFormFooter(new CSubmit('add', _('Add')), new CButtonCancel(url_param('parent_discoveryid'))));
}
// insert js (depended from some variables inside the file)
insert_show_color_picker_javascript();
require_once dirname(__FILE__) . '/js/configuration.graph.edit.js.php';
// append form to widget
$graphWidget->addItem($graphForm);
return $graphWidget;
示例7: CWidget
** 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.
**/
$hostGroupWidget = new CWidget();
// create new hostgroup button
$createForm = new CForm('get');
$createForm->cleanItems();
if (CWebUser::getType() == USER_TYPE_SUPER_ADMIN) {
$tmpItem = new CSubmit('form', _('Create host group'));
} else {
$tmpItem = new CSubmit('form', _('Create host group') . SPACE . _('(Only super admins can create groups)'));
$tmpItem->setEnabled(false);
}
$createForm->addItem($tmpItem);
$hostGroupWidget->addPageHeader(_('CONFIGURATION OF HOST GROUPS'), $createForm);
// header
$hostGroupWidget->addHeader(_('Host groups'));
$hostGroupWidget->addHeaderRowNumber();
// create form
$hostGroupForm = new CForm();
$hostGroupForm->setName('hostgroupForm');
// if any of the groups are about to be deleted, show the status column
$showStatus = false;
foreach ($this->data['groups'] as $hostGroup) {
if ($hostGroup['groupDiscovery'] && $hostGroup['groupDiscovery']['ts_delete']) {
$showStatus = true;
break;
示例8: 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.
**/
$httpWidget = new CWidget();
// create new scenario button
$createForm = new CForm('get');
$createForm->cleanItems();
$createForm->addVar('hostid', $this->data['hostid']);
if ($this->data['hostid'] > 0) {
$createScenarioButton = new CSubmit('form', _('Create scenario'));
} else {
$createScenarioButton = new CSubmit('form', _('Create scenario (select host first)'));
$createScenarioButton->setEnabled(false);
}
$createForm->addItem($createScenarioButton);
$httpWidget->addPageHeader(_('CONFIGURATION OF WEB MONITORING'), $createForm);
// header
$filterForm = new CForm('get');
$filterForm->addItem(array(_('Group') . SPACE, $this->data['pageFilter']->getGroupsCB()));
$filterForm->addItem(array(SPACE . _('Host') . SPACE, $this->data['pageFilter']->getHostsCB()));
$httpWidget->addHeader(_('Scenarios'), $filterForm);
$httpWidget->addHeaderRowNumber(array('[ ', new CLink($this->data['showDisabled'] ? _('Hide disabled scenarios') : _('Show disabled scenarios'), '?showdisabled=' . ($this->data['showDisabled'] ? 0 : 1), null), ' ]'));
// create form
$httpForm = new CForm('get');
$httpForm->setName('scenarios');
$httpForm->addVar('hostid', $this->data['hostid']);
if (!empty($this->data['showAllApps'])) {
$expandLink = new CLink(new CImg('images/general/minus.png'), '?close=1' . url_param('groupid') . url_param('hostid'));
示例9: CWidget
** 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.
**/
$hostgroupWidget = new CWidget();
// create new hostgroup button
$createForm = new CForm('get');
$createForm->cleanItems();
if (CWebUser::getType() == USER_TYPE_SUPER_ADMIN) {
$tmp_item = new CSubmit('form', _('Create host group'));
} else {
$tmp_item = new CSubmit('form', _('Create host group') . SPACE . _('(Only super admins can create groups)'));
$tmp_item->setEnabled(false);
}
$createForm->addItem($tmp_item);
$hostgroupWidget->addPageHeader(_('CONFIGURATION OF HOST GROUPS'), $createForm);
// header
$hostgroupWidget->addHeader(_('Host groups'));
$hostgroupWidget->addHeaderRowNumber();
// create form
$hostgroupForm = new CForm();
$hostgroupForm->setName('hostgroupForm');
// create table
$hostgroupTable = new CTableInfo(_('No host groups defined.'));
$hostgroupTable->setHeader(array(new CCheckBox('all_groups', null, "checkAll('" . $hostgroupForm->getName() . "', 'all_groups', 'groups');"), make_sorting_header(_('Name'), 'name'), ' # ', _('Members')));
foreach ($this->data['groups'] as $group) {
$tpl_count = 0;
$host_count = 0;
示例10: bodyToString
function bodyToString($destroy = true)
{
$left = new CDiv(null, 'left');
$left->addItem(new CDiv(null, 'setup_logo'));
$left->addItem(new CDiv(ZABBIX_VERSION, 'setup_version'));
$left->addItem(new CDiv($this->getList(), 'left_menu'));
$link1 = new CLink('www.zabbix.com', 'http://www.zabbix.com/', null, null, true);
$link1->setAttribute('target', '_blank');
$link2 = new CLink('GPL v2', 'http://www.zabbix.com/license.php', null, null, true);
$link2->setAttribute('target', '_blank');
$licence = new CDiv(array($link1, BR(), ' Licensed under ', $link2), 'setup_wizard_licence');
$left->addItem($licence);
$right = new CDiv(null, 'right');
if ($this->getStep() == 0) {
$right->addItem(new CDiv(null, 'blank_title'));
$right->addItem(new CDiv($this->getState(), 'blank_under_title'));
$container = new CDiv(array($left, $right), 'setup_wizard setup_wizard_welcome');
} else {
$right->addItem(new CDiv($this->stage[$this->getStep()]['title'], 'setup_title'));
$right->addItem(new CDiv($this->getState(), 'under_title'));
$container = new CDiv(array($left, $right), 'setup_wizard');
}
if (isset($this->stage[$this->getStep() + 1])) {
$next = new CSubmit('next[' . $this->getStep() . ']', _('Next') . ' >>');
} else {
$next = new CSubmit('finish', _('Finish'));
}
if (isset($this->HIDE_CANCEL_BUTTON) && $this->HIDE_CANCEL_BUTTON) {
$cancel = null;
} else {
$cancel = new CDiv(new CSubmit('cancel', _('Cancel')), 'footer_left');
}
if ($this->DISABLE_NEXT_BUTTON) {
$next->setEnabled(false);
}
$footer = new CDiv(array($cancel, new CDiv(array($this->getStep() != 0 ? new CSubmit('back[' . $this->getStep() . ']', '<< ' . _('Previous')) : null, $next), 'footer_right')), 'footer');
$container->addItem($footer);
return parent::bodyToString($destroy) . $container->ToString();
}
示例11: unset
}
unset($group);
$sortFields = array(array('field' => 'nodename', 'order' => ZBX_SORT_UP), array('field' => 'name', 'order' => ZBX_SORT_UP));
CArrayHelper::sort($groups, $sortFields);
$lstGroups = new CListBox('del_groups[]', null, 15);
$lstGroups->setAttribute('style', 'width: 200px;');
foreach ($groups as $gnum => $group) {
$lstGroups->addItem($group['groupid'], $group['nodename'] . $group['name']);
}
if (!$filterEnable) {
$lstGroups->setAttribute('disabled', 'disabled');
}
$addButton = new CButton('add', _('Add'), "return PopUp('popup_right.php?dstfrm=" . $dashForm->getName() . "&permission=" . PERM_READ_WRITE . "',450,450);");
$addButton->setEnabled($filterEnable);
$delButton = new CSubmit('delete', _('Delete selected'));
$delButton->setEnabled($filterEnable);
$dashList->addRow(_('Groups'), array($lstGroups, BR(), $addButton, $delButton));
}
//HOSTS
// SPACE added to extend CB width in Chrome
$cbMain = new CCheckBox('maintenance', $maintenance, null, '1');
if (!$filterEnable) {
$cbMain->setAttribute('disabled', 'disabled');
}
$dashList->addRow(_('Hosts'), array($cbMain, _('Show hosts in maintenance')));
// Trigger
$severity = zbx_toHash($severity);
$trgSeverities = array();
$severities = array(TRIGGER_SEVERITY_NOT_CLASSIFIED, TRIGGER_SEVERITY_INFORMATION, TRIGGER_SEVERITY_WARNING, TRIGGER_SEVERITY_AVERAGE, TRIGGER_SEVERITY_HIGH, TRIGGER_SEVERITY_DISASTER);
foreach ($severities as $snum => $sever) {
$cb = new CCheckBox('trgSeverity[' . $sever . ']', isset($severity[$sever]), '', 1);