当前位置: 首页>>代码示例>>PHP>>正文


PHP CForm::addVar方法代码示例

本文整理汇总了PHP中CForm::addVar方法的典型用法代码示例。如果您正苦于以下问题:PHP CForm::addVar方法的具体用法?PHP CForm::addVar怎么用?PHP CForm::addVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CForm的用法示例。


在下文中一共展示了CForm::addVar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show_report2_header

function show_report2_header($config, &$PAGE_GROUPS, &$PAGE_HOSTS)
{
    global $USER_DETAILS;
    $available_groups = $PAGE_GROUPS['groupids'];
    $available_hosts = $PAGE_HOSTS['hostids'];
    //	$available_groups = $PAGE_GROUPS['groupids'];
    //	$available_hosts = $PAGE_HOSTS['hostids'];
    $r_form = new CForm();
    $r_form->setMethod('get');
    $cmbConf = new CComboBox('config', $config, 'submit()');
    $cmbConf->addItem(0, S_BY_HOST);
    $cmbConf->addItem(1, S_BY_TRIGGER_TEMPLATE);
    $r_form->addItem(array(S_MODE . SPACE, $cmbConf, SPACE));
    $cmbGroups = new CComboBox('groupid', $PAGE_GROUPS['selected'], 'javascript: submit();');
    $cmbHosts = new CComboBox('hostid', $PAGE_HOSTS['selected'], 'javascript: submit();');
    foreach ($PAGE_GROUPS['groups'] as $groupid => $name) {
        $cmbGroups->addItem($groupid, get_node_name_by_elid($groupid) . $name);
    }
    foreach ($PAGE_HOSTS['hosts'] as $hostid => $name) {
        $cmbHosts->addItem($hostid, get_node_name_by_elid($hostid) . $name);
    }
    $r_form->addItem(array(S_GROUP . SPACE, $cmbGroups));
    $r_form->addItem(array(SPACE . S_HOST . SPACE, $cmbHosts));
    if (1 == $config) {
        $cmbTrigs = new CComboBox('tpl_triggerid', get_request('tpl_triggerid', 0), 'submit()');
        $cmbHGrps = new CComboBox('hostgroupid', get_request('hostgroupid', 0), 'submit()');
        $cmbTrigs->addItem(0, S_ALL_SMALL);
        $cmbHGrps->addItem(0, S_ALL_SMALL);
    }
    if (0 == $config) {
        show_table_header(S_AVAILABILITY_REPORT_BIG, $r_form);
    } else {
        $sql_cond = ' AND h.hostid=ht.hostid ';
        if ($_REQUEST['hostid'] > 0) {
            $sql_cond .= ' AND ht.templateid=' . $_REQUEST['hostid'];
        }
        if (isset($_REQUEST['tpl_triggerid']) && $_REQUEST['tpl_triggerid'] > 0) {
            $sql_cond .= ' AND t.templateid=' . $_REQUEST['tpl_triggerid'];
        }
        $result = DBselect('SELECT DISTINCT g.groupid,g.name ' . ' FROM triggers t,hosts h,items i,functions f, hosts_templates ht, groups g, hosts_groups hg ' . ' WHERE f.itemid=i.itemid ' . ' AND h.hostid=i.hostid ' . ' AND hg.hostid=h.hostid' . ' AND g.groupid=hg.groupid ' . ' AND ' . DBcondition('h.hostid', $available_hosts) . ' AND t.status=' . TRIGGER_STATUS_ENABLED . ' AND t.triggerid=f.triggerid ' . ' AND ' . DBin_node('t.triggerid') . ' AND i.status=' . ITEM_STATUS_ACTIVE . ' AND h.status=' . HOST_STATUS_MONITORED . $sql_cond . ' ORDER BY g.name');
        while ($row = DBfetch($result)) {
            $cmbHGrps->addItem($row['groupid'], get_node_name_by_elid($row['groupid']) . $row['name']);
        }
        $sql_cond = $_REQUEST['hostid'] > 0 ? ' AND h.hostid=' . $_REQUEST['hostid'] : ' AND ' . DBcondition('h.hostid', $available_hosts);
        $sql = 'SELECT DISTINCT t.triggerid,t.description ' . ' FROM triggers t,hosts h,items i,functions f ' . ' WHERE f.itemid=i.itemid ' . ' AND h.hostid=i.hostid ' . ' AND t.status=' . TRIGGER_STATUS_ENABLED . ' AND t.triggerid=f.triggerid ' . ' AND h.status=' . HOST_STATUS_TEMPLATE . ' AND ' . DBin_node('t.triggerid') . ' AND i.status=' . ITEM_STATUS_ACTIVE . $sql_cond . ' ORDER BY t.description';
        $result = DBselect($sql);
        while ($row = DBfetch($result)) {
            $cmbTrigs->addItem($row['triggerid'], get_node_name_by_elid($row['triggerid']) . expand_trigger_description($row['triggerid']));
        }
        $rr_form = new CForm();
        $rr_form->setMethod('get');
        $rr_form->addVar('config', $config);
        $rr_form->addVar('groupid', $_REQUEST['groupid']);
        $rr_form->addVar('hostid', $_REQUEST['hostid']);
        $rr_form->addItem(array(S_TRIGGER . SPACE, $cmbTrigs, BR(), S_FILTER, SPACE, S_HOST_GROUP . SPACE, $cmbHGrps));
        show_table_header(S_AVAILABILITY_REPORT_BIG, array($r_form, $rr_form));
    }
}
开发者ID:rennhak,项目名称:zabbix,代码行数:58,代码来源:reports.inc.php

示例2: CWidget

**
** 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.
**/
$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);
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:configuration.hostgroups.edit.php

示例3: CWidget

$itemsWidget = new CWidget();
$discoveryRule = $this->data['discovery_rule'];
// create new item button
$createForm = new CForm('get');
$createForm->cleanItems();
$createForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']);
$createForm->addItem(new CSubmit('form', _('Create host prototype')));
$itemsWidget->addPageHeader(_('CONFIGURATION OF HOST PROTOTYPES'), $createForm);
// header
$itemsWidget->addHeader(array(_('Host prototypes of') . SPACE, new CSpan($this->data['discovery_rule']['name'], 'parent-discovery')));
$itemsWidget->addHeaderRowNumber();
$itemsWidget->addItem(get_header_host_table('hosts', $discoveryRule['hostid'], $this->data['parent_discoveryid']));
// create form
$itemForm = new CForm();
$itemForm->setName('hosts');
$itemForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']);
// create table
$hostTable = new CTableInfo(_('No host prototypes found.'));
$sortLink = new CUrl();
$sortLink->setArgument('parent_discoveryid', $this->data['parent_discoveryid']);
$sortLink = $sortLink->getUrl();
$hostTable->setHeader(array(new CCheckBox('all_hosts', null, "checkAll('" . $itemForm->getName() . "', 'all_hosts', 'group_hostid');"), make_sorting_header(_('Name'), 'name', $sortLink), _('Templates'), make_sorting_header(_('Status'), 'status', $sortLink)));
foreach ($this->data['hostPrototypes'] as $hostPrototype) {
    // name
    $name = array();
    if ($hostPrototype['templateid']) {
        $sourceTemplate = $hostPrototype['sourceTemplate'];
        $name[] = new CLink($sourceTemplate['name'], '?parent_discoveryid=' . $hostPrototype['sourceDiscoveryRuleId'], 'unknown');
        $name[] = NAME_DELIMITER;
    }
    $name[] = new CLink($hostPrototype['name'], '?form=update&parent_discoveryid=' . $discoveryRule['itemid'] . '&hostid=' . $hostPrototype['hostid']);
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:configuration.host.prototype.list.php

示例4: CForm

if (!empty($this->data['hostid'])) {
    if (!empty($this->data['parent_discoveryid'])) {
        $triggersWidget->addItem(get_header_host_table('triggers', $this->data['hostid'], $this->data['parent_discoveryid']));
    } else {
        $triggersWidget->addItem(get_header_host_table('triggers', $this->data['hostid']));
    }
}
if (!empty($this->data['parent_discoveryid'])) {
    $triggersWidget->addPageHeader(_('CONFIGURATION OF TRIGGER PROTOTYPES'));
} else {
    $triggersWidget->addPageHeader(_('CONFIGURATION OF TRIGGERS'));
}
// create form
$triggersForm = new CForm();
$triggersForm->setName('triggersForm');
$triggersForm->addVar('hostid', $this->data['hostid']);
$triggersForm->addVar('action', $this->data['action']);
if ($this->data['parent_discoveryid']) {
    $triggersForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']);
}
foreach ($this->data['g_triggerid'] as $triggerid) {
    $triggersForm->addVar('g_triggerid[' . $triggerid . ']', $triggerid);
}
// create form list
$triggersFormList = new CFormList('triggersFormList');
// append severity to form list
$severityDiv = new CSeverity(array('id' => 'priority_div', 'name' => 'priority', 'value' => $this->data['priority']));
$triggersFormList->addRow(array(_('Severity'), SPACE, new CVisibilityBox('visible[priority]', isset($this->data['visible']['priority']), 'priority_div', _('Original'))), $severityDiv);
// append dependencies to form list
if (empty($this->data['parent_discoveryid'])) {
    $dependenciesTable = new CTable(_('No dependencies defined.'), 'formElementTable');
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:configuration.triggers.massupdate.php

示例5: array

$spand->addStyle('vertical-align: middle;');
$filterForm->addRow(S_AGE_LESS_THAN, array($cbd, $sts_change_days_cb, $spand));
$filterForm->addRow(S_SHOW_DETAILS, new CCheckBox('show_details', $_REQUEST['show_details'], null, 1));
$filterForm->addRow(S_FILTER_BY_NAME, new CTextBox('txt_select', $_REQUEST['txt_select'], 40));
$filterForm->addItemToBottomRow(new CButton('filter_set', S_FILTER));
$filterForm->addItemToBottomRow(new CButton('filter_rst', S_RESET));
$trigg_wdgt->addFlicker($filterForm, CProfile::get('web.tr_status.filter.state', 0));
/*************** FILTER END ******************/
if ($_REQUEST['fullscreen']) {
    $triggerInfo = new CTriggersInfo($_REQUEST['groupid'], $_REQUEST['hostid']);
    $triggerInfo->HideHeader();
    $triggerInfo->show();
}
$m_form = new CForm('acknow.php');
$m_form->setName('tr_status');
$m_form->addVar('backurl', $page['file']);
$admin_links = $USER_DETAILS['type'] == USER_TYPE_ZABBIX_ADMIN || $USER_DETAILS['type'] == USER_TYPE_SUPER_ADMIN;
$show_event_col = $config['event_ack_enable'] && $_REQUEST['show_events'] != EVENTS_OPTION_NOEVENT;
$table = new CTableInfo();
$switcherName = 'trigger_switchers';
$header_cb = $show_event_col ? new CCheckBox('all_events', false, "checkAll('" . $m_form->GetName() . "','all_events','events');") : new CCheckBox('all_triggers', false, "checkAll('" . $m_form->GetName() . "','all_triggers', 'triggers');");
if ($show_events != EVENTS_OPTION_NOEVENT) {
    $whow_hide_all = new CDiv(SPACE, 'filterclosed');
    $whow_hide_all->setAttribute('id', $switcherName);
} else {
    $whow_hide_all = NULL;
}
$table->setHeader(array($whow_hide_all, $config['event_ack_enable'] ? $header_cb : null, make_sorting_header(S_SEVERITY, 'priority'), S_STATUS, make_sorting_header(S_LAST_CHANGE, 'lastchange'), S_AGE, $show_event_col ? S_DURATION : NULL, $config['event_ack_enable'] ? S_ACKNOWLEDGED : NULL, is_show_all_nodes() ? S_NODE : null, S_HOST, make_sorting_header(S_NAME, 'description'), S_COMMENTS));
$sortfield = getPageSortField('description');
$sortorder = getPageSortOrder();
$options = array('nodeids' => get_current_nodeid(), 'filter' => array(), 'monitored' => 1, 'output' => API_OUTPUT_EXTEND, 'skipDependent' => 1, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'limit' => $config['search_limit'] + 1);
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:tr_status.php

示例6: 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.
**/
$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']);
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:configuration.item.copy.php

示例7: dirname

** 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.action.edit.js.php';
$actionWidget = new CWidget(null, 'action-edit');
$actionWidget->addPageHeader(_('CONFIGURATION OF ACTIONS'));
// create form
$actionForm = new CForm();
$actionForm->setName('action.edit');
$actionForm->addVar('form', $this->data['form']);
$actionForm->addVar('form_refresh', $this->data['form_refresh']);
$actionForm->addVar('eventsource', $this->data['eventsource']);
if (!empty($this->data['actionid'])) {
    $actionForm->addVar('actionid', $this->data['actionid']);
}
/*
 * Action tab
 */
$actionFormList = new CFormList('actionlist');
$nameTextBox = new CTextBox('name', $this->data['action']['name'], ZBX_TEXTBOX_STANDARD_SIZE);
$nameTextBox->attr('autofocus', 'autofocus');
$actionFormList->addRow(_('Name'), $nameTextBox);
$actionFormList->addRow(_('Default subject'), new CTextBox('def_shortdata', $this->data['action']['def_shortdata'], ZBX_TEXTBOX_STANDARD_SIZE));
$actionFormList->addRow(_('Default message'), new CTextArea('def_longdata', $this->data['action']['def_longdata']));
if ($this->data['eventsource'] == EVENT_SOURCE_TRIGGERS || $this->data['eventsource'] == EVENT_SOURCE_INTERNAL) {
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:configuration.action.edit.php

示例8: dirname

** 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.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) {
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:configuration.slideconf.edit.php

示例9: CWidget

** 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.
**/
include 'include/views/js/configuration.services.edit.js.php';
$servicesParentWidget = new CWidget();
$servicesParentWidget->addPageHeader(_('IT service parent'));
// create form
$servicesParentForm = new CForm();
$servicesParentForm->setName('servicesForm');
if (!empty($this->data['service'])) {
    $servicesParentForm->addVar('serviceid', $this->data['service']['serviceid']);
}
// create table
$servicesParentTable = new CTableInfo();
$servicesParentTable->setHeader(array(_('Service'), _('Status calculation'), _('Trigger')));
$prefix = null;
// root
$description = new CLink(_('root'), '#', null, 'javascript:
	jQuery(\'#parent_name\', window.opener.document).val(' . zbx_jsvalue(_('root')) . ');
	jQuery(\'#parentname\', window.opener.document).val(' . zbx_jsvalue(_('root')) . ');
	jQuery(\'#parentid\', window.opener.document).val(' . zbx_jsvalue(0) . ');
	self.close();
	return false;');
$servicesParentTable->addRow(array(array($prefix, $description), _('Note'), '-'));
// others
foreach ($this->data['db_pservices'] as $db_service) {
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:configuration.services.parent.list.php

示例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.
**/
$discoveryWidget = new CWidget('hat_discovery');
// create header form
$discoveryHeaderForm = new CForm('get');
$discoveryHeaderForm->setName('slideHeaderForm');
$discoveryHeaderForm->addVar('fullscreen', $this->data['fullscreen']);
$discoveryWidget->addPageHeader(_('STATUS OF DISCOVERY'), get_icon('fullscreen', array('fullscreen' => $this->data['fullscreen'])));
$discoveryRulesComboBox = $this->data['pageFilter']->getDiscoveryCB();
$discoveryHeaderForm->addItem(array(_('Discovery rule') . SPACE, $discoveryRulesComboBox));
$discoveryWidget->addHeader(_('Discovery rules'), $discoveryHeaderForm);
// create table
$discoveryTable = new CTableInfo(_('No discovered devices found.'));
$discoveryTable->makeVerticalRotation();
$discoveredDeviceCol = make_sorting_header(_('Discovered device'), 'ip', $this->data['sort'], $this->data['sortorder']);
$discoveredDeviceCol->addClass('left');
$header = array($discoveredDeviceCol, new CCol(_('Monitored host'), 'left'), new CCol(array(_('Uptime') . '/', _('Downtime')), 'left'));
foreach ($this->data['services'] as $name => $foo) {
    $header[] = new CCol($name, 'vertical_rotation');
}
$discoveryTable->setHeader($header, 'vertical_header');
foreach ($this->data['drules'] as $drule) {
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:monitoring.discovery.php

示例11: CWidget

**
** 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.
**/
$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) {
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:administration.usergroups.edit.php

示例12: 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'])) {
    if (!empty($this->data['parent_discoveryid'])) {
        $itemWidget->addItem(get_header_host_table(!empty($this->data['is_discovery_rule']) ? 'discoveries' : 'items', $this->data['hostid'], $this->data['parent_discoveryid']));
    } else {
        $itemWidget->addItem(get_header_host_table(!empty($this->data['is_discovery_rule']) ? 'discoveries' : 'items', $this->data['hostid']));
    }
}
$itemWidget->addPageHeader($this->data['page_header']);
// create form
$itemForm = new CForm();
$itemForm->setName('itemForm');
$itemForm->addVar('form', $this->data['form']);
$itemForm->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'])) {
    if ($this->data['is_discovery_rule']) {
        $itemFormList->addRow(_('Parent discovery rules'), $this->data['templates']);
    } else {
        $itemFormList->addRow(_('Parent items'), $this->data['templates']);
    }
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:configuration.item.edit.php

示例13: CForm

            if (!($itemInterfaceType === false || $itemInterfaceType === INTERFACE_TYPE_ANY)) {
                $locked = 1;
                break;
            }
        }
        $interfaces[$hinum]['locked'] = $locked;
    }
}
$clear_templates = array_intersect($clear_templates, array_keys($original_templates));
$clear_templates = array_diff($clear_templates, array_keys($templateIds));
natcasesort($templateIds);
// whether this is a discovered host
$isDiscovered = get_request('hostid') && $dbHost['flags'] == ZBX_FLAG_DISCOVERY_CREATED && get_request('form') == 'update';
$frmHost = new CForm();
$frmHost->setName('web.hosts.host.php.');
$frmHost->addVar('form', get_request('form', 1));
$frmHost->addVar('clear_templates', $clear_templates);
$hostList = new CFormList('hostlist');
if ($_REQUEST['hostid'] > 0 && get_request('form') != 'clone') {
    $frmHost->addVar('hostid', $_REQUEST['hostid']);
}
if ($_REQUEST['groupid'] > 0) {
    $frmHost->addVar('groupid', $_REQUEST['groupid']);
}
// LLD rule link
if ($isDiscovered) {
    $hostList->addRow(_('Discovered by'), new CLink($dbHost['discoveryRule']['name'], 'host_prototypes.php?parent_discoveryid=' . $dbHost['discoveryRule']['itemid'], 'highlight underline weight_normal'));
}
$hostTB = new CTextBox('host', $host, ZBX_TEXTBOX_STANDARD_SIZE, $isDiscovered);
$hostTB->setAttribute('maxlength', 64);
$hostTB->setAttribute('autofocus', 'autofocus');
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:configuration.host.edit.php

示例14: CWidget

**
** 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.
**/
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);
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:administration.script.edit.php

示例15: CWidget

**
** 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.
**/
$maintenanceWidget = new CWidget();
$maintenanceWidget->addPageHeader(_('CONFIGURATION OF MAINTENANCE PERIODS'));
// create form
$maintenanceForm = new CForm();
$maintenanceForm->setName('maintenanceForm');
$maintenanceForm->addVar('form', $this->data['form']);
if (isset($this->data['maintenanceid'])) {
    $maintenanceForm->addVar('maintenanceid', $this->data['maintenanceid']);
}
/*
 * Maintenance tab
 */
$maintenanceFormList = new CFormList('maintenanceFormList');
$nameTextBox = new CTextBox('mname', $this->data['mname'], ZBX_TEXTBOX_STANDARD_SIZE);
$nameTextBox->attr('autofocus', 'autofocus');
$maintenanceFormList->addRow(_('Name'), $nameTextBox);
$typeComboBox = new CComboBox('maintenance_type', $this->data['maintenance_type']);
$typeComboBox->addItem(MAINTENANCE_TYPE_NORMAL, _('With data collection'));
$typeComboBox->addItem(MAINTENANCE_TYPE_NODATA, _('No data collection'));
$maintenanceFormList->addRow(_('Maintenance type'), $typeComboBox);
// active since
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:configuration.maintenance.edit.php


注:本文中的CForm::addVar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。