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


PHP get_header_host_table函数代码示例

本文整理汇总了PHP中get_header_host_table函数的典型用法代码示例。如果您正苦于以下问题:PHP get_header_host_table函数的具体用法?PHP get_header_host_table怎么用?PHP get_header_host_table使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: 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.triggers.edit.js.php';
$triggersWidget = new CWidget();
// append host summary to widget header
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']);
}
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:configuration.triggers.massupdate.php

示例2: count

 if (isset($_REQUEST['filter_with_triggers']) && !zbx_empty($_REQUEST['filter_with_triggers']) && $_REQUEST['filter_with_triggers'] != -1) {
     $options['with_triggers'] = $_REQUEST['filter_with_triggers'];
 }
 if (isset($_REQUEST['filter_ipmi_sensor']) && !zbx_empty($_REQUEST['filter_ipmi_sensor'])) {
     $options['filter']['ipmi_sensor'] = $_REQUEST['filter_ipmi_sensor'];
 }
 $afterFilter = count($options, COUNT_RECURSIVE);
 //} Items Filter
 if ($preFilter == $afterFilter) {
     $items = array();
 } else {
     $items = CItem::get($options);
 }
 // Header Host
 if ($hostid > 0) {
     $tbl_header_host = get_header_host_table($hostid, array('triggers', 'applications', 'graphs'));
     $items_wdgt->addItem($tbl_header_host);
     $show_host = false;
 }
 $form = new CForm();
 $form->setName('items');
 $form->addVar('hostid', $hostid);
 $table = new CTableInfo();
 // Table Header //
 $table->setHeader(array(new CCheckBox('all_items', null, "checkAll('" . $form->GetName() . "','all_items','group_itemid');"), S_WIZARD, $show_host ? S_HOST : null, make_sorting_header(S_DESCRIPTION, 'description'), S_TRIGGERS, make_sorting_header(S_KEY, 'key_'), make_sorting_header(S_INTERVAL, 'delay'), make_sorting_header(S_HISTORY, 'history'), make_sorting_header(S_TRENDS, 'trends'), make_sorting_header(S_TYPE, 'type'), make_sorting_header(S_STATUS, 'status'), S_APPLICATIONS, S_ERROR));
 // SET VALUES FOR SUBFILTERS {
 // if any of subfilters = false then item shouldnt be shown
 foreach ($items as $num => $item) {
     $item['hostids'] = zbx_objectValues($item['hosts'], 'hostid');
     $item['subfilters'] = array();
     $item['subfilters']['subfilter_hosts'] = empty($_REQUEST['subfilter_hosts']) || (bool) array_intersect($_REQUEST['subfilter_hosts'], $item['hostids']);
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:items.php

示例3: 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.
**/
$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
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:configuration.item.edit.php

示例4: CWidget

**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** 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.
**/
$widget = (new CWidget())->setTitle(_('Item prototypes'))->setControls((new CForm('get'))->cleanItems()->addVar('parent_discoveryid', $this->data['parent_discoveryid'])->addItem((new CList())->addItem(new CSubmit('form', _('Create item prototype')))))->addItem(get_header_host_table('items', $this->data['hostid'], $this->data['parent_discoveryid']));
// create form
$itemForm = (new CForm())->setName('items')->addVar('hostid', $this->data['hostid'])->addVar('parent_discoveryid', $this->data['parent_discoveryid']);
// create table
$itemTable = (new CTableInfo())->setHeader([(new CColHeader((new CCheckBox('all_items'))->onClick("checkAll('" . $itemForm->getName() . "', 'all_items', 'group_itemid');")))->addClass(ZBX_STYLE_CELL_WIDTH), make_sorting_header(_('Name'), 'name', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Key'), 'key_', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Interval'), 'delay', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('History'), 'history', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Trends'), 'trends', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Type'), 'type', $this->data['sort'], $this->data['sortorder']), _('Applications'), make_sorting_header(_('Status'), 'status', $this->data['sort'], $this->data['sortorder'])]);
foreach ($this->data['items'] as $item) {
    $description = [];
    if (!empty($item['templateid'])) {
        $template_host = get_realhost_by_itemid($item['templateid']);
        $templateDiscoveryRuleId = get_realrule_by_itemid_and_hostid($this->data['parent_discoveryid'], $template_host['hostid']);
        $description[] = (new CLink($template_host['name'], '?parent_discoveryid=' . $templateDiscoveryRuleId))->addClass(ZBX_STYLE_LINK_ALT)->addClass(ZBX_STYLE_GREY);
        $description[] = NAME_DELIMITER;
    }
    $description[] = new CLink($item['name_expanded'], '?form=update&itemid=' . $item['itemid'] . '&parent_discoveryid=' . $this->data['parent_discoveryid']);
    $status = (new CLink(itemIndicator($item['status']), '?group_itemid=' . $item['itemid'] . '&parent_discoveryid=' . $this->data['parent_discoveryid'] . '&action=' . ($item['status'] == ITEM_STATUS_DISABLED ? 'itemprototype.massenable' : 'itemprototype.massdisable')))->addClass(ZBX_STYLE_LINK_ACTION)->addClass(itemIndicatorStyle($item['status']))->addSID();
    if (!empty($item['applications'])) {
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:configuration.item.prototype.list.php

示例5: CWidget

** 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.
**/
$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
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:configuration.httpconf.edit.php

示例6: CSubmit

} 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');
$graphForm->addVar('hostid', $this->data['hostid']);
if (!empty($this->data['parent_discoveryid'])) {
    $graphForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']);
}
// create table
$graphTable = new CTableInfo(!empty($this->data['parent_discoveryid']) ? _('No graph prototypes found.') : _('No graphs found.'));
$graphTable->setHeader(array(new CCheckBox('all_graphs', null, "checkAll('" . $graphForm->getName() . "', 'all_graphs', 'group_graphid');"), $this->data['displayNodes'] ? _('Node') : null, !empty($this->data['hostid']) ? null : _('Hosts'), make_sorting_header(_('Name'), 'name'), _('Width'), _('Height'), make_sorting_header(_('Graph type'), 'graphtype')));
foreach ($this->data['graphs'] as $graph) {
    $graphid = $graph['graphid'];
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:configuration.graph.list.php

示例7: CWidget

** it under the terms of the GNU General Public License as published by
** 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.
**/
$itemWidget = new CWidget();
if (!empty($this->data['hostid'])) {
    $itemWidget->addItem(get_header_host_table('discoveries', $this->data['hostid'], isset($this->data['parent_discoveryid']) ? $this->data['parent_discoveryid'] : null));
}
$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');
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:configuration.host.discovery.edit.php

示例8: 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.
**/
$discoveryRule = $data['discovery_rule'];
$hostPrototype = $data['host_prototype'];
$parentHost = $data['parent_host'];
require_once dirname(__FILE__) . '/js/configuration.host.edit.js.php';
require_once dirname(__FILE__) . '/js/configuration.host.prototype.edit.js.php';
$widget = new CWidget(null, 'hostprototype-edit');
$widget->addPageHeader(_('CONFIGURATION OF HOST PROTOTYPES'));
$widget->addItem(get_header_host_table('hosts', $discoveryRule['hostid'], $discoveryRule['itemid']));
$divTabs = new CTabView();
if (!isset($_REQUEST['form_refresh'])) {
    $divTabs->setSelected(0);
}
$frmHost = new CForm();
$frmHost->setName('hostPrototypeForm.');
$frmHost->addVar('form', get_request('form', 1));
$frmHost->addVar('parent_discoveryid', $discoveryRule['itemid']);
$hostList = new CFormList('hostlist');
if ($hostPrototype['templateid'] && $data['parents']) {
    $parents = array();
    foreach (array_reverse($data['parents']) as $parent) {
        $parents[] = new CLink($parent['parentHost']['name'], '?form=update&hostid=' . $parent['hostid'] . '&parent_discoveryid=' . $parent['discoveryRule']['itemid'], 'highlight underline weight_normal');
        $parents[] = SPACE . RARR . SPACE;
    }
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:configuration.host.prototype.edit.php

示例9: CWidget

**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** 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.
**/
$widget = (new CWidget())->setTitle(_('Discovery rules'))->setControls((new CForm('get'))->cleanItems()->addVar('hostid', $this->data['hostid'])->addItem((new CList())->addItem(new CSubmit('form', _('Create discovery rule')))))->addItem(get_header_host_table('discoveries', $this->data['hostid']));
// create form
$discoveryForm = (new CForm())->setName('discovery')->addVar('hostid', $this->data['hostid']);
// create table
$discoveryTable = (new CTableInfo())->setHeader([(new CColHeader((new CCheckBox('all_items'))->onClick("checkAll('" . $discoveryForm->getName() . "', 'all_items', 'g_hostdruleid');")))->addClass(ZBX_STYLE_CELL_WIDTH), make_sorting_header(_('Name'), 'name', $this->data['sort'], $this->data['sortorder']), _('Items'), _('Triggers'), _('Graphs'), $data['host']['flags'] == ZBX_FLAG_DISCOVERY_NORMAL ? _('Hosts') : null, make_sorting_header(_('Key'), 'key_', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Interval'), 'delay', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Type'), 'type', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Status'), 'status', $this->data['sort'], $this->data['sortorder']), $data['showInfoColumn'] ? _('Info') : null]);
foreach ($data['discoveries'] as $discovery) {
    // description
    $description = [];
    if ($discovery['templateid']) {
        $dbTemplate = get_realhost_by_itemid($discovery['templateid']);
        $description[] = (new CLink($dbTemplate['name'], '?hostid=' . $dbTemplate['hostid']))->addClass(ZBX_STYLE_LINK_ALT)->addClass(ZBX_STYLE_GREY);
        $description[] = NAME_DELIMITER;
    }
    $description[] = new CLink($discovery['name_expanded'], '?form=update&itemid=' . $discovery['itemid']);
    // status
    $status = (new CLink(itemIndicator($discovery['status'], $discovery['state']), '?hostid=' . $_REQUEST['hostid'] . '&g_hostdruleid=' . $discovery['itemid'] . '&action=' . ($discovery['status'] == ITEM_STATUS_DISABLED ? 'discoveryrule.massenable' : 'discoveryrule.massdisable')))->addClass(ZBX_STYLE_LINK_ACTION)->addClass(itemIndicatorStyle($discovery['status'], $discovery['state']))->addSID();
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:configuration.host.discovery.list.php

示例10: 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.triggers.edit.js.php';
$triggersWidget = (new CWidget())->setTitle(_('Trigger prototypes'));
// append host summary to widget header
$triggersWidget->addItem(get_header_host_table('trigger_prototypes', $data['hostid'], $data['parent_discoveryid']));
$triggersForm = (new CForm())->setName('triggersForm')->addVar('action', $data['action'])->addVar('parent_discoveryid', $data['parent_discoveryid']);
foreach ($data['g_triggerid'] as $triggerid) {
    $triggersForm->addVar('g_triggerid[' . $triggerid . ']', $triggerid);
}
$triggersFormList = (new CFormList('triggersFormList'))->addRow([_('Severity'), SPACE, (new CVisibilityBox('visible[priority]', 'priority_div', _('Original')))->setChecked(isset($data['visible']['priority']))], (new CDiv(new CSeverity(['name' => 'priority', 'value' => $data['priority']])))->setId('priority_div'));
// append dependencies to form list
$dependenciesTable = (new CTable())->setAttribute('style', 'width: 100%;')->setHeader([_('Name'), _('Action')]);
foreach ($data['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_PROTOTYPE) {
        $description = (new CLink($depTriggerDescription, 'trigger_prototypes.php?form=update' . url_param('parent_discoveryid') . '&triggerid=' . $dependency['triggerid']))->setAttribute('target', '_blank');
    } elseif ($dependency['flags'] == ZBX_FLAG_DISCOVERY_NORMAL) {
        $description = (new CLink($depTriggerDescription, 'triggers.php?form=update&triggerid=' . $dependency['triggerid']))->setAttribute('target', '_blank');
    }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:configuration.trigger.prototype.massupdate.php

示例11: 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.
**/
$widget = (new CWidget())->setTitle(_('Screens'));
$controls = new CList();
if (!$data['templateid']) {
    $controls->addItem(new CComboBox('config', 'screens.php', 'redirect(this.options[this.selectedIndex].value);', ['screens.php' => _('Screens'), 'slides.php' => _('Slide shows')]));
}
$controls->addItem(new CSubmit('form', _('Create screen')));
$createForm = (new CForm('get'))->cleanItems();
if ($data['templateid']) {
    $createForm->addVar('templateid', $data['templateid']);
    $widget->addItem(get_header_host_table('screens', $data['templateid']));
} else {
    $controls->addItem((new CButton('form', _('Import')))->onClick('redirect("screen.import.php?rules_preset=screen")'));
}
$createForm->addItem($controls);
$widget->setControls($createForm);
// filter
if (!$data['templateid']) {
    $widget->addItem((new CFilter('web.screenconf.filter.state'))->addColumn((new CFormList())->addRow(_('Name like'), (new CTextBox('filter_name', $data['filter']['name']))->setWidth(ZBX_TEXTAREA_FILTER_STANDARD_WIDTH))));
}
// create form
$screenForm = (new CForm())->setName('screenForm')->addVar('templateid', $data['templateid']);
// create table
$screenTable = (new CTableInfo())->setHeader([(new CColHeader((new CCheckBox('all_screens'))->onClick("checkAll('" . $screenForm->getName() . "', 'all_screens', 'screens');")))->addClass(ZBX_STYLE_CELL_WIDTH), make_sorting_header(_('Name'), 'name', $data['sort'], $data['sortorder']), _('Dimension (cols x rows)'), _('Actions')]);
foreach ($data['screens'] as $screen) {
    $user_type = CWebUser::getType();
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:monitoring.screen.list.php

示例12: CSubmit

**
** 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.
**/
if ($this->data['hostid'] == 0) {
    $create_button = (new CSubmit('form', _('Create application (select host first)')))->setEnabled(false);
} else {
    $create_button = new CSubmit('form', _('Create application'));
}
$widget = (new CWidget())->setTitle(_('Applications'))->setControls((new CForm('get'))->cleanItems()->addItem((new CList())->addItem([_('Group'), SPACE, $this->data['pageFilter']->getGroupsCB()])->addItem([_('Host'), SPACE, $this->data['pageFilter']->getHostsCB()])->addItem($create_button)))->addItem(get_header_host_table('applications', $this->data['hostid']));
// create form
$form = (new CForm())->setName('application_form');
// create table
$applicationTable = (new CTableInfo())->setHeader([(new CColHeader((new CCheckBox('all_applications'))->onClick("checkAll('" . $form->getName() . "', 'all_applications', 'applications');")))->addClass(ZBX_STYLE_CELL_WIDTH), $this->data['hostid'] > 0 ? null : _('Host'), make_sorting_header(_('Application'), 'name', $this->data['sort'], $this->data['sortorder']), _('Items'), $data['showInfoColumn'] ? _('Info') : null]);
$current_time = time();
foreach ($this->data['applications'] as $application) {
    $info_icons = [];
    // inherited app, display the template list
    if ($application['templateids'] && !empty($application['sourceTemplates'])) {
        $name = [];
        CArrayHelper::sort($application['sourceTemplates'], ['name']);
        foreach ($application['sourceTemplates'] as $template) {
            $name[] = (new CLink($template['name'], 'applications.php?hostid=' . $template['hostid']))->addClass(ZBX_STYLE_LINK_ALT)->addClass(ZBX_STYLE_GREY);
            $name[] = ', ';
        }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:configuration.application.list.php

示例13: 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.
**/
$discoveryRule = $data['discovery_rule'];
$hostPrototype = $data['host_prototype'];
$parentHost = $data['parent_host'];
require_once dirname(__FILE__) . '/js/configuration.host.edit.js.php';
require_once dirname(__FILE__) . '/js/configuration.host.prototype.edit.js.php';
$widget = (new CWidget())->setTitle(_('Host prototypes'))->addItem(get_header_host_table('hosts', $discoveryRule['hostid'], $discoveryRule['itemid']));
$divTabs = new CTabView();
if (!isset($_REQUEST['form_refresh'])) {
    $divTabs->setSelected(0);
}
$frmHost = (new CForm())->setName('hostPrototypeForm.')->addVar('form', getRequest('form', 1))->addVar('parent_discoveryid', $discoveryRule['itemid'])->addVar('tls_accept', $parentHost['tls_accept']);
$hostList = new CFormList('hostlist');
if ($hostPrototype['templateid'] && $data['parents']) {
    $parents = [];
    foreach (array_reverse($data['parents']) as $parent) {
        $parents[] = new CLink($parent['parentHost']['name'], '?form=update&hostid=' . $parent['hostid'] . '&parent_discoveryid=' . $parent['discoveryRule']['itemid']);
        $parents[] = SPACE . '⇒' . SPACE;
    }
    array_pop($parents);
    $hostList->addRow(_('Parent discovery rules'), $parents);
}
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:configuration.host.prototype.edit.php

示例14: DBend

    $result = DBend($result);
    if ($result) {
        uncheckTableRows();
    }
    show_messages($result, _('Template deleted'), _('Cannot delete template'));
}
/*
 * Display
 */
$templateWidget = new CWidget();
$pageFilter = new CPageFilter(array('config' => array('individual' => 1), 'groups' => array('templated_hosts' => true, 'editable' => true), 'groupid' => getRequest('groupid')));
$_REQUEST['groupid'] = $pageFilter->groupid;
if (isset($_REQUEST['form'])) {
    $templateWidget->addPageHeader(_('CONFIGURATION OF TEMPLATES'));
    if ($templateId = getRequest('templateid', 0)) {
        $templateWidget->addItem(get_header_host_table('', $templateId));
    }
    $data = array();
    if ($templateId) {
        $dbTemplates = API::Template()->get(array('templateids' => $templateId, 'selectGroups' => API_OUTPUT_EXTEND, 'selectParentTemplates' => array('templateid', 'name'), 'selectMacros' => API_OUTPUT_EXTEND, 'output' => API_OUTPUT_EXTEND));
        $data['dbTemplate'] = reset($dbTemplates);
        $data['original_templates'] = array();
        foreach ($data['dbTemplate']['parentTemplates'] as $parentTemplate) {
            $data['original_templates'][$parentTemplate['templateid']] = $parentTemplate['templateid'];
        }
    } else {
        $data['original_templates'] = array();
    }
    // description
    $data['description'] = $templateId && !hasRequest('form_refresh') ? $data['dbTemplate']['description'] : getRequest('description');
    $templateIds = getRequest('templates', hasRequest('form_refresh') ? array() : $data['original_templates']);
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:templates.php

示例15: dirname

** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** 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';
$widget = (new CWidget())->setTitle(_('Hosts'))->addItem(get_header_host_table('', $data['hostid']));
$divTabs = new CTabView();
if (!hasRequest('form_refresh')) {
    $divTabs->setSelected(0);
}
$frmHost = (new CForm())->setName('hostsForm')->addVar('form', $data['form'])->addVar('clear_templates', $data['clear_templates'])->addVar('flags', $data['flags'])->addVar('tls_connect', $data['tls_connect'])->addVar('tls_accept', $data['tls_accept'])->setAttribute('id', 'hostForm');
if ($data['hostid'] != 0) {
    $frmHost->addVar('hostid', $data['hostid']);
}
if ($data['clone_hostid'] != 0) {
    $frmHost->addVar('clone_hostid', $data['clone_hostid']);
}
if ($data['groupid'] != 0) {
    $frmHost->addVar('groupid', $data['groupid']);
}
$hostList = new CFormList('hostlist');
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:configuration.host.edit.php


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