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


PHP CWidget::setRootClass方法代码示例

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


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

示例1: 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.
**/
include 'include/views/js/configuration.services.edit.js.php';
global $ZBX_MESSAGES;
$service = $this->data['service'];
$servicesWidget = new CWidget();
$servicesWidget->setRootClass('services-edit');
$servicesWidget->addPageHeader(_('CONFIGURATION OF IT SERVICES'));
// create form
$servicesForm = new CForm();
$servicesForm->setName('servicesForm');
$servicesForm->addVar('form', $this->data['form']);
$servicesForm->addVar('parentid', $this->data['parentid']);
$servicesForm->addVar('parentname', $this->data['parentname']);
$servicesForm->addVar('triggerid', $this->data['triggerid']);
if (isset($this->data['service'])) {
    $servicesForm->addVar('serviceid', $this->data['service']['serviceid']);
}
// create form list
$servicesFormList = new CFormList('servicesFormList');
$nameTextBox = new CTextBox('name', $this->data['name'], ZBX_TEXTBOX_STANDARD_SIZE, false, 128);
$nameTextBox->attr('autofocus', 'autofocus');
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:configuration.services.edit.php

示例2: array

    $hostsWidget->addPageHeader(_('CONFIGURATION OF HOSTS'));
    $data = array();
    if ($hostId = get_request('hostid', 0)) {
        $hostsWidget->addItem(get_header_host_table('', $_REQUEST['hostid']));
        $dbHosts = API::Host()->get(array('hostids' => $hostId, 'selectGroups' => API_OUTPUT_EXTEND, 'selectParentTemplates' => array('templateid', 'name'), 'selectMacros' => API_OUTPUT_EXTEND, 'selectInventory' => true, 'selectDiscoveryRule' => array('name', 'itemid'), 'output' => API_OUTPUT_EXTEND));
        $dbHost = reset($dbHosts);
        $dbHost['interfaces'] = API::HostInterface()->get(array('hostids' => $hostId, 'output' => API_OUTPUT_EXTEND, 'selectItems' => array('type'), 'sortfield' => 'interfaceid', 'preservekeys' => true));
        $data['dbHost'] = $dbHost;
    }
    $hostForm = new CView('configuration.host.edit', $data);
    $hostsWidget->addItem($hostForm->render());
    $rootClass = 'host-edit';
    if (get_request('hostid') && $dbHost['flags'] == ZBX_FLAG_DISCOVERY_CREATED) {
        $rootClass .= ' host-edit-discovered';
    }
    $hostsWidget->setRootClass($rootClass);
} else {
    $displayNodes = is_array(get_current_nodeid()) && $pageFilter->groupid == 0;
    $frmForm = new CForm();
    $frmForm->cleanItems();
    $frmForm->addItem(new CDiv(array(new CSubmit('form', _('Create host')), new CButton('form', _('Import'), 'redirect("conf.import.php?rules_preset=host")'))));
    $frmForm->addItem(new CVar('groupid', $_REQUEST['groupid'], 'filter_groupid_id'));
    $hostsWidget->addPageHeader(_('CONFIGURATION OF HOSTS'), $frmForm);
    $frmGroup = new CForm('get');
    $frmGroup->addItem(array(_('Group') . SPACE, $pageFilter->getGroupsCB(true)));
    $hostsWidget->addHeader(_('Hosts'), $frmGroup);
    $hostsWidget->addHeaderRowNumber();
    $hostsWidget->setRootClass('host-list');
    // filter
    $filterTable = new CTable('', 'filter');
    $filterTable->addRow(array(array(array(bold(_('Name')), SPACE . _('like') . NAME_DELIMITER), new CTextBox('filter_host', $_REQUEST['filter_host'], 20)), array(array(bold(_('DNS')), SPACE . _('like') . NAME_DELIMITER), new CTextBox('filter_dns', $_REQUEST['filter_dns'], 20)), array(array(bold(_('IP')), SPACE . _('like') . NAME_DELIMITER), new CTextBox('filter_ip', $_REQUEST['filter_ip'], 20)), array(bold(_('Port') . NAME_DELIMITER), new CTextBox('filter_port', $_REQUEST['filter_port'], 20))));
开发者ID:micromachine,项目名称:RackTables-ZABBIX-bridge,代码行数:31,代码来源:hosts.php

示例3: DBfetchArray

    $data['proxies'] = DBfetchArray(DBselect('SELECT h.hostid,h.host' . ' FROM hosts h' . ' WHERE h.status IN (' . HOST_STATUS_PROXY_ACTIVE . ',' . HOST_STATUS_PROXY_PASSIVE . ')' . ' AND ' . DBin_node('h.hostid') . ' ORDER BY h.host'));
    // get inventories
    if ($data['inventory_mode'] != HOST_INVENTORY_DISABLED) {
        $data['inventories'] = getHostInventories();
        $data['inventories'] = zbx_toHash($data['inventories'], 'db_field');
    }
    $hostForm = new CView('configuration.host.massupdate', $data);
    $hosts_wdgt->addItem($hostForm->render());
} elseif (isset($_REQUEST['form'])) {
    $hosts_wdgt->addPageHeader(_('CONFIGURATION OF HOSTS'));
    if ($hostid = get_request('hostid', 0)) {
        $hosts_wdgt->addItem(get_header_host_table('', $_REQUEST['hostid']));
    }
    $hostForm = new CView('configuration.host.edit');
    $hosts_wdgt->addItem($hostForm->render());
    $hosts_wdgt->setRootClass('host-edit');
} else {
    $frmForm = new CForm();
    $frmForm->cleanItems();
    $buttons = new CDiv(array(new CSubmit('form', _('Create host')), new CButton('form', _('Import'), 'redirect("conf.import.php?rules_preset=host")')));
    $frmForm->addItem($buttons);
    $frmForm->addItem(new CVar('groupid', $_REQUEST['groupid'], 'filter_groupid_id'));
    $hosts_wdgt->addPageHeader(_('CONFIGURATION OF HOSTS'), $frmForm);
    $frmGroup = new CForm('get');
    $frmGroup->addItem(array(_('Group') . SPACE, $pageFilter->getGroupsCB()));
    $hosts_wdgt->addHeader(_('Hosts'), $frmGroup);
    $hosts_wdgt->addHeaderRowNumber();
    $hosts_wdgt->setRootClass('host-list');
    // filter
    $filter_table = new CTable('', 'filter');
    $filter_table->addRow(array(array(array(bold(_('Name')), SPACE . _('like') . ': '), new CTextBox('filter_host', $_REQUEST['filter_host'], 20)), array(array(bold(_('DNS')), SPACE . _('like') . ': '), new CTextBox('filter_dns', $_REQUEST['filter_dns'], 20)), array(array(bold(_('IP')), SPACE . _('like') . ': '), new CTextBox('filter_ip', $_REQUEST['filter_ip'], 20)), array(bold(_('Port') . ': '), new CTextBox('filter_port', $_REQUEST['filter_port'], 20))));
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:hosts.php


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