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


PHP make_sorting_header函数代码示例

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


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

示例1: CVar

// set an ID for the hidden input so that it wouldn't conflict with the ID of the "Go" button list
$form->addItem(new CVar('action', HISTORY_BATCH_GRAPH, 'action-hidden'));
// table
$table = new CTableInfo($filterSet ? _('No values found.') : _('Specify some filter condition to see the values.'));
if ($singleHostSelected) {
    $hostHeader = null;
    $hostColumn = null;
} else {
    $hostHeader = make_sorting_header(_('Host'), 'host', $sortField, $sortOrder);
    $hostHeader->addClass('latest-host');
    $hostHeader->setAttribute('title', _('Host'));
    $hostColumn = '';
}
$nameHeader = make_sorting_header(_('Name'), 'name', $sortField, $sortOrder);
$nameHeader->setAttribute('title', _('Name'));
$lastCheckHeader = make_sorting_header(_('Last check'), 'lastclock', $sortField, $sortOrder);
$lastCheckHeader->addClass('latest-lastcheck');
$lastCheckHeader->setAttribute('title', _('Last check'));
$lastValueHeader = new CCol(new CSpan(_('Last value')), 'latest-lastvalue');
$lastValueHeader->setAttribute('title', _('Last value'));
$lastDataHeader = new CCol(new CSpan(_x('Change', 'noun in latest data')), 'latest-data');
$lastDataHeader->setAttribute('title', _x('Change', 'noun in latest data'));
$checkAllCheckbox = new CCheckBox('all_items', null, "checkAll('" . $form->getName() . "', 'all_items', 'itemids');");
$checkAllCheckboxCol = new CCol($checkAllCheckbox, 'latest-checkbox');
if ($filter['showDetails']) {
    $intervalHeader = new CCol(new CSpan(_('Interval')), 'latest-interval');
    $intervalHeader->setAttribute('title', _('Interval'));
    $historyHeader = new CCol(new CSpan(_('History')), 'latest-history');
    $historyHeader->setAttribute('title', _('History'));
    $trendsHeader = new CCol(new CSpan(_('Trends')), 'latest-trends');
    $trendsHeader->setAttribute('title', _('Trends'));
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:latest.php

示例2: CForm

// append form header to widget
$userGroupListForm = new CForm('get');
$userGroupComboBox = new CComboBox('filter_usrgrpid', $_REQUEST['filter_usrgrpid'], 'submit()');
$userGroupComboBox->addItem(0, _('All'));
foreach ($this->data['userGroups'] as $userGroup) {
    $userGroupComboBox->addItem($userGroup['usrgrpid'], $userGroup['name']);
}
$userGroupListForm->addItem(array(_('User group') . SPACE, $userGroupComboBox));
$usersWidget->addHeader(_('Users'), $userGroupListForm);
$usersWidget->addHeaderRowNumber();
// create form
$usersForm = new CForm();
$usersForm->setName('userForm');
// create users table
$usersTable = new CTableInfo(_('No users found.'));
$usersTable->setHeader(array(new CCheckBox('all_users', null, "checkAll('" . $usersForm->getName() . "', 'all_users', 'group_userid');"), make_sorting_header(_('Alias'), 'alias', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_x('Name', 'user first name'), 'name', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Surname'), 'surname', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('User type'), 'type', $this->data['sort'], $this->data['sortorder']), _('Groups'), _('Is online?'), _('Login'), _('Frontend access'), _('Debug mode'), _('Status')));
foreach ($this->data['users'] as $user) {
    $userId = $user['userid'];
    $session = $this->data['usersSessions'][$userId];
    // online time
    if ($session['lastaccess']) {
        $onlineTime = $user['autologout'] == 0 || ZBX_USER_ONLINE_TIME < $user['autologout'] ? ZBX_USER_ONLINE_TIME : $user['autologout'];
        $online = $session['lastaccess'] + $onlineTime >= time() ? new CCol(_('Yes') . ' (' . zbx_date2str(DATE_TIME_FORMAT_SECONDS, $session['lastaccess']) . ')', 'enabled') : new CCol(_('No') . ' (' . zbx_date2str(DATE_TIME_FORMAT_SECONDS, $session['lastaccess']) . ')', 'disabled');
    } else {
        $online = new CCol(_('No'), 'disabled');
    }
    // blocked
    $blocked = $user['attempt_failed'] >= ZBX_LOGIN_ATTEMPTS ? new CLink(_('Blocked'), 'users.php?action=user.massunblock&group_userid[]=' . $userId, 'on') : new CSpan(_('Ok'), 'green');
    // user groups
    order_result($user['usrgrps'], 'name');
    $usersGroups = array();
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:administration.users.list.php

示例3: CSubmit

$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']);
    // template list
    if (empty($hostPrototype['templates'])) {
        $hostTemplates = '-';
    } else {
        $hostTemplates = array();
        order_result($hostPrototype['templates'], 'name');
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:configuration.host.prototype.list.php

示例4: CWidget

** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
$discoveryWidget = new CWidget();
// create new discovery rule button
$createForm = new CForm('get');
$createForm->cleanItems();
$createForm->addItem(new CSubmit('form', _('Create discovery rule')));
$discoveryWidget->addPageHeader(_('CONFIGURATION OF DISCOVERY RULES'), $createForm);
$discoveryWidget->addHeader(_('Discovery rules'));
$discoveryWidget->addHeaderRowNumber();
// create form
$discoveryForm = new CForm();
$discoveryForm->setName('druleForm');
// create table
$discoveryTable = new CTableInfo(_('No discovery rules found.'));
$discoveryTable->setHeader(array(new CCheckBox('all_drules', null, "checkAll('" . $discoveryForm->getName() . "', 'all_drules', 'g_druleid');"), make_sorting_header(_('Name'), 'name', $this->data['sort'], $this->data['sortorder']), _('IP range'), _('Delay'), _('Checks'), _('Status')));
foreach ($data['drules'] as $drule) {
    array_push($drule['description'], new CLink($drule['name'], '?form=update&druleid=' . $drule['druleid']));
    $status = new CCol(new CLink(discovery_status2str($drule['status']), '?g_druleid[]=' . $drule['druleid'] . '&action=' . ($drule['status'] == DRULE_STATUS_ACTIVE ? 'drule.massdisable' : 'drule.massenable'), discovery_status2style($drule['status'])));
    $discoveryTable->addRow(array(new CCheckBox('g_druleid[' . $drule['druleid'] . ']', null, null, $drule['druleid']), $drule['description'], $drule['iprange'], $drule['delay'], !empty($drule['checks']) ? implode(', ', $drule['checks']) : '', $status));
}
// create go buttons
$goComboBox = new CComboBox('action');
$goOption = new CComboItem('drule.massenable', _('Enable selected'));
$goOption->setAttribute('confirm', _('Enable selected discovery rules?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('drule.massdisable', _('Disable selected'));
$goOption->setAttribute('confirm', _('Disable selected discovery rules?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('drule.massdelete', _('Delete selected'));
$goOption->setAttribute('confirm', _('Delete selected discovery rules?'));
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:configuration.discovery.list.php

示例5: get

 /**
  * Process screen.
  *
  * @return CDiv (screen inside container)
  */
 public function get()
 {
     $this->dataId = 'discovery';
     $sort_field = $this->data['sort'];
     $sort_order = $this->data['sortorder'];
     $druleid = $this->data['druleid'];
     // discovery rules
     $options = ['output' => ['druleid', 'name'], 'selectDHosts' => ['dhostid', 'status', 'lastup', 'lastdown'], 'filter' => ['status' => DRULE_STATUS_ACTIVE]];
     if ($druleid > 0) {
         $options['druleids'] = $druleid;
         // set selected discovery rule id
     }
     $drules = API::DRule()->get($options);
     if ($drules) {
         order_result($drules, 'name');
     }
     // discovery services
     $options = ['selectHosts' => ['hostid', 'name', 'status'], 'output' => ['dserviceid', 'type', 'key_', 'port', 'status', 'lastup', 'lastdown', 'ip', 'dns'], 'sortfield' => $sort_field, 'sortorder' => $sort_order, 'limitSelects' => 1];
     if ($druleid > 0) {
         $options['druleids'] = $druleid;
     } else {
         $options['druleids'] = zbx_objectValues($drules, 'druleid');
     }
     $dservices = API::DService()->get($options);
     // user macros
     $macros = API::UserMacro()->get(['output' => ['macro', 'value'], 'globalmacro' => true]);
     $macros = zbx_toHash($macros, 'macro');
     // services
     $services = [];
     foreach ($dservices as $dservice) {
         $key_ = $dservice['key_'];
         if ($key_ !== '') {
             if (array_key_exists($key_, $macros)) {
                 $key_ = $macros[$key_]['value'];
             }
             $key_ = ': ' . $key_;
         }
         $service_name = discovery_check_type2str($dservice['type']) . discovery_port2str($dservice['type'], $dservice['port']) . $key_;
         $services[$service_name] = 1;
     }
     ksort($services);
     // discovery services to hash
     $dservices = zbx_toHash($dservices, 'dserviceid');
     // discovery hosts
     $dhosts = API::DHost()->get(['druleids' => zbx_objectValues($drules, 'druleid'), 'selectDServices' => ['dserviceid', 'ip', 'dns', 'type', 'status', 'key_'], 'output' => ['dhostid', 'lastdown', 'lastup', 'druleid']]);
     $dhosts = zbx_toHash($dhosts, 'dhostid');
     $header = [make_sorting_header(_('Discovered device'), 'ip', $sort_field, $sort_order, 'zabbix.php?action=discovery.view'), _('Monitored host'), _('Uptime') . '/' . _('Downtime')];
     foreach ($services as $name => $foo) {
         $header[] = (new CColHeader($name))->addClass('vertical_rotation');
     }
     // create table
     $table = (new CTableInfo())->makeVerticalRotation()->setHeader($header);
     foreach ($drules as $drule) {
         $discovery_info = [];
         foreach ($drule['dhosts'] as $dhost) {
             if ($dhost['status'] == DHOST_STATUS_DISABLED) {
                 $hclass = 'disabled';
                 $htime = $dhost['lastdown'];
             } else {
                 $hclass = 'enabled';
                 $htime = $dhost['lastup'];
             }
             // $primary_ip stores the primary host ip of the dhost
             $primary_ip = '';
             foreach ($dhosts[$dhost['dhostid']]['dservices'] as $dservice) {
                 $dservice = $dservices[$dservice['dserviceid']];
                 $hostName = '';
                 $host = reset($dservices[$dservice['dserviceid']]['hosts']);
                 if (!is_null($host)) {
                     $hostName = $host['name'];
                 }
                 if ($primary_ip !== '') {
                     if ($primary_ip === $dservice['ip']) {
                         $htype = 'primary';
                     } else {
                         $htype = 'slave';
                     }
                 } else {
                     $primary_ip = $dservice['ip'];
                     $htype = 'primary';
                 }
                 if (!array_key_exists($dservice['ip'], $discovery_info)) {
                     $discovery_info[$dservice['ip']] = ['ip' => $dservice['ip'], 'dns' => $dservice['dns'], 'type' => $htype, 'class' => $hclass, 'host' => $hostName, 'time' => $htime];
                 }
                 if ($dservice['status'] == DSVC_STATUS_DISABLED) {
                     $class = ZBX_STYLE_INACTIVE_BG;
                     $time = 'lastdown';
                 } else {
                     $class = ZBX_STYLE_ACTIVE_BG;
                     $time = 'lastup';
                 }
                 $key_ = $dservice['key_'];
                 if ($key_ !== '') {
                     if (array_key_exists($key_, $macros)) {
                         $key_ = $macros[$key_]['value'];
//.........这里部分代码省略.........
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:101,代码来源:CScreenDiscovery.php

示例6: CWidget

** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
$proxyWidget = new CWidget();
// create new proxy button
$createForm = new CForm('get');
$createForm->cleanItems();
$createForm->addItem(new CSubmit('form', _('Create proxy')));
$proxyWidget->addPageHeader(_('CONFIGURATION OF PROXIES'), $createForm);
$proxyWidget->addHeader(_('Proxies'));
$proxyWidget->addHeaderRowNumber();
// create form
$proxyForm = new CForm('get');
$proxyForm->setName('proxyForm');
// create table
$proxyTable = new CTableInfo(_('No proxies found.'));
$proxyTable->setHeader(array(new CCheckBox('all_hosts', null, "checkAll('" . $proxyForm->getName() . "', 'all_hosts', 'hosts');"), make_sorting_header(_('Name'), 'host', $this->data['sort'], $this->data['sortorder']), _('Mode'), _('Last seen (age)'), _('Host count'), _('Item count'), _('Required performance (vps)'), _('Hosts')));
foreach ($this->data['proxies'] as $proxy) {
    $hosts = array();
    if (!empty($proxy['hosts'])) {
        $i = 1;
        foreach ($proxy['hosts'] as $host) {
            if ($i > $this->data['config']['max_in_table']) {
                $hosts[] = ' &hellip;';
                break;
            }
            $i++;
            if ($host['status'] == HOST_STATUS_MONITORED) {
                $style = 'off';
            } elseif ($host['status'] == HOST_STATUS_TEMPLATE) {
                $style = 'unknown';
            } else {
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:administration.proxy.list.php

示例7: CComboBox

// 'true' means list should be ordered by title
$inventoryFieldsComboBox = new CComboBox('groupby', $_REQUEST['groupby'], 'submit()');
$inventoryFieldsComboBox->addItem('', _('not selected'));
foreach ($inventoryFields as $inventoryField) {
    $inventoryFieldsComboBox->addItem($inventoryField['db_field'], $inventoryField['title'], $_REQUEST['groupby'] === $inventoryField['db_field'] ? 'yes' : null);
    if ($_REQUEST['groupby'] === $inventoryField['db_field']) {
        $groupFieldTitle = $inventoryField['title'];
    }
}
$r_form = new CForm('get');
$r_form->addItem(array(_('Group'), SPACE, $pageFilter->getGroupsCB(true), SPACE));
$r_form->addItem(array(_('Grouping by'), SPACE, $inventoryFieldsComboBox));
$hostinvent_wdgt->addHeader(_('Hosts'), $r_form);
$hostinvent_wdgt->addItem(BR());
$table = new CTableInfo(_('No hosts defined.'));
$table->setHeader(array(make_sorting_header($groupFieldTitle === '' ? _('Field') : $groupFieldTitle, 'inventory_field'), make_sorting_header(_('Host count'), 'host_count')));
// to show a report, we will need a host group and a field to aggregate
if ($pageFilter->groupsSelected && $groupFieldTitle !== '') {
    $options = array('output' => array('hostid', 'name'), 'selectInventory' => array($_REQUEST['groupby']), 'withInventory' => true);
    if ($pageFilter->groupid > 0) {
        $options['groupids'] = $pageFilter->groupid;
    }
    $hosts = API::Host()->get($options);
    // aggregating data by chosen field value
    $report = array();
    foreach ($hosts as $host) {
        if ($host['inventory'][$_REQUEST['groupby']] !== '') {
            $lowerValue = zbx_strtolower($host['inventory'][$_REQUEST['groupby']]);
            if (!isset($report[$lowerValue])) {
                $report[$lowerValue] = array('inventory_field' => $host['inventory'][$_REQUEST['groupby']], 'host_count' => 1);
            } else {
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:hostinventoriesoverview.php

示例8: CWidget

** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
$slideWidget = new CWidget();
// create new hostgroup button
$createForm = new CForm('get');
$createForm->cleanItems();
$createForm->addItem(new CSubmit('form', _('Create slide show')));
$slideWidget->addPageHeader(_('CONFIGURATION OF SLIDE SHOWS'), $createForm);
$slideWidget->addHeader(_('Slide shows'));
$slideWidget->addHeaderRowNumber();
// create form
$slideForm = new CForm();
$slideForm->setName('slideForm');
// create table
$slidesTable = new CTableInfo(_('No slide shows found.'));
$slidesTable->setHeader(array(new CCheckBox('all_shows', null, "checkAll('" . $slideForm->getName() . "', 'all_shows', 'shows');"), $this->data['displayNodes'] ? _('Node') : null, make_sorting_header(_('Name'), 'name'), make_sorting_header(_('Delay'), 'delay'), make_sorting_header(_('Count of slides'), 'cnt')));
foreach ($this->data['slides'] as $slide) {
    $slidesTable->addRow(array(new CCheckBox('shows[' . $slide['slideshowid'] . ']', null, null, $slide['slideshowid']), $this->data['displayNodes'] ? $slide['nodename'] : null, new CLink($slide['name'], '?form=update&slideshowid=' . $slide['slideshowid'], 'action'), $slide['delay'], $slide['cnt']));
}
// create go button
$goComboBox = new CComboBox('go');
$goOption = new CComboItem('delete', _('Delete selected'));
$goOption->setAttribute('confirm', _('Delete selected slide shows?'));
$goComboBox->addItem($goOption);
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "shows";');
// append table to form
$slideForm->addItem(array($this->data['paging'], $slidesTable, $this->data['paging'], get_table_header(array($goComboBox, $goButton))));
// append form to widget
$slideWidget->addItem($slideForm);
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:configuration.slideconf.list.php

示例9: CComboBox

// create widget header
$sourceComboBox = new CComboBox('eventsource', $this->data['eventsource'], 'submit()');
$sourceComboBox->addItem(EVENT_SOURCE_TRIGGERS, _('Triggers'));
$sourceComboBox->addItem(EVENT_SOURCE_DISCOVERY, _('Discovery'));
$sourceComboBox->addItem(EVENT_SOURCE_AUTO_REGISTRATION, _('Auto registration'));
$sourceComboBox->addItem(EVENT_SOURCE_INTERNAL, _x('Internal', 'event source'));
$filterForm = new CForm('get');
$filterForm->addItem(array(_('Event source'), SPACE, $sourceComboBox));
$actionWidget->addHeader(_('Actions'), $filterForm);
$actionWidget->addHeaderRowNumber();
// create form
$actionForm = new CForm();
$actionForm->setName('actionForm');
// create table
$actionTable = new CTableInfo(_('No actions found.'));
$actionTable->setHeader(array(new CCheckBox('all_items', null, "checkAll('" . $actionForm->getName() . "', 'all_items', 'g_actionid');"), make_sorting_header(_('Name'), 'name', $this->data['sort'], $this->data['sortorder']), _('Conditions'), _('Operations'), make_sorting_header(_('Status'), 'status', $this->data['sort'], $this->data['sortorder'])));
foreach ($this->data['actions'] as $action) {
    $conditions = array();
    order_result($action['filter']['conditions'], 'conditiontype', ZBX_SORT_DOWN);
    foreach ($action['filter']['conditions'] as $condition) {
        $conditions[] = get_condition_desc($condition['conditiontype'], $condition['operator'], $condition['value']);
        $conditions[] = BR();
    }
    sortOperations($this->data['eventsource'], $action['operations']);
    $operations = array();
    foreach ($action['operations'] as $operation) {
        $operations[] = get_operation_descr(SHORT_DESCRIPTION, $operation);
    }
    if ($action['status'] == ACTION_STATUS_DISABLED) {
        $status = new CLink(_('Disabled'), 'actionconf.php?action=action.massenable&g_actionid[]=' . $action['actionid'] . url_param('eventsource'), 'disabled');
    } else {
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:configuration.action.list.php

示例10: CWidget

**
** 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.
**/
$scriptsWidget = new CWidget();
$createForm = new CForm('get');
$createForm->addItem(new CSubmit('form', _('Create script')));
$scriptsWidget->addPageHeader(_('CONFIGURATION OF SCRIPTS'), $createForm);
$scriptsWidget->addHeader(_('Scripts'));
$scriptsWidget->addHeaderRowNumber();
$scriptsForm = new CForm();
$scriptsForm->setName('scriptsForm');
$scriptsForm->setAttribute('id', 'scripts');
$scriptsTable = new CTableInfo(_('No scripts found.'));
$scriptsTable->setHeader(array(new CCheckBox('all_scripts', null, "checkAll('" . $scriptsForm->getName() . "', 'all_scripts', 'scripts');"), make_sorting_header(_('Name'), 'name', $this->data['sort'], $this->data['sortorder']), _('Type'), _('Execute on'), make_sorting_header(_('Commands'), 'command', $this->data['sort'], $this->data['sortorder']), _('User group'), _('Host group'), _('Host access')));
foreach ($this->data['scripts'] as $script) {
    switch ($script['type']) {
        case ZBX_SCRIPT_TYPE_CUSTOM_SCRIPT:
            $scriptType = _('Script');
            break;
        case ZBX_SCRIPT_TYPE_IPMI:
            $scriptType = _('IPMI');
            break;
        default:
            $scriptType = '';
            break;
    }
    if ($script['type'] == ZBX_SCRIPT_TYPE_CUSTOM_SCRIPT) {
        switch ($script['execute_on']) {
            case ZBX_SCRIPT_EXECUTE_ON_AGENT:
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:administration.script.list.php

示例11: CButton

    $createForm->addVar('templateid', $this->data['templateid']);
    $screenWidget->addItem(get_header_host_table('screens', $this->data['templateid']));
} else {
    $createForm->addItem(new CButton('form', _('Import'), 'redirect("conf.import.php?rules_preset=screen")'));
}
$screenWidget->addPageHeader(_('CONFIGURATION OF SCREENS'), $createForm);
// header
$screenWidget->addHeader(_('Screens'));
$screenWidget->addHeaderRowNumber();
// create form
$screenForm = new CForm();
$screenForm->setName('screenForm');
$screenForm->addVar('templateid', $this->data['templateid']);
// create table
$screenTable = new CTableInfo(_('No screens found.'));
$screenTable->setHeader(array(new CCheckBox('all_screens', null, "checkAll('" . $screenForm->getName() . "', 'all_screens', 'screens');"), make_sorting_header(_('Name'), 'name', $this->data['sort'], $this->data['sortorder']), _('Dimension (cols x rows)'), _('Screen')));
foreach ($this->data['screens'] as $screen) {
    $screenTable->addRow(array(new CCheckBox('screens[' . $screen['screenid'] . ']', null, null, $screen['screenid']), new CLink($screen['name'], 'screenedit.php?screenid=' . $screen['screenid'] . url_param('templateid')), $screen['hsize'] . ' x ' . $screen['vsize'], new CLink(_('Edit'), '?form=update&screenid=' . $screen['screenid'] . url_param('templateid'))));
}
// create go button
$goComboBox = new CComboBox('action');
if (empty($this->data['templateid'])) {
    $goComboBox->addItem('screen.export', _('Export selected'));
}
$goOption = new CComboItem('screen.massdelete', _('Delete selected'));
$goOption->setAttribute('confirm', _('Delete selected screens?'));
$goComboBox->addItem($goOption);
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "screens";');
// append table to form
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:configuration.screen.list.php

示例12: 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.
**/
$widget = (new CWidget())->setTitle(_('Maintenance periods'))->setControls((new CForm('get'))->cleanItems()->addItem((new CList())->addItem([_('Group'), SPACE, $this->data['pageFilter']->getGroupsCB()])->addItem(new CSubmit('form', _('Create maintenance period')))));
// create form
$maintenanceForm = (new CForm())->setName('maintenanceForm');
// create table
$maintenanceTable = (new CTableInfo())->setHeader([(new CColHeader((new CCheckBox('all_maintenances'))->onClick("checkAll('" . $maintenanceForm->getName() . "', 'all_maintenances', 'maintenanceids');")))->addClass(ZBX_STYLE_CELL_WIDTH), make_sorting_header(_('Name'), 'name', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Type'), 'maintenance_type', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Active since'), 'active_since', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Active till'), 'active_till', $this->data['sort'], $this->data['sortorder']), _('State'), _('Description')]);
foreach ($this->data['maintenances'] as $maintenance) {
    $maintenanceid = $maintenance['maintenanceid'];
    switch ($maintenance['status']) {
        case MAINTENANCE_STATUS_EXPIRED:
            $maintenanceStatus = (new CSpan(_x('Expired', 'maintenance status')))->addClass(ZBX_STYLE_RED);
            break;
        case MAINTENANCE_STATUS_APPROACH:
            $maintenanceStatus = (new CSpan(_x('Approaching', 'maintenance status')))->addClass(ZBX_STYLE_ORANGE);
            break;
        case MAINTENANCE_STATUS_ACTIVE:
            $maintenanceStatus = (new CSpan(_x('Active', 'maintenance status')))->addClass(ZBX_STYLE_GREEN);
            break;
    }
    $maintenanceTable->addRow([new CCheckBox('maintenanceids[' . $maintenanceid . ']', $maintenanceid), new CLink($maintenance['name'], 'maintenance.php?form=update&maintenanceid=' . $maintenanceid), $maintenance['maintenance_type'] ? _('No data collection') : _('With data collection'), zbx_date2str(DATE_TIME_FORMAT, $maintenance['active_since']), zbx_date2str(DATE_TIME_FORMAT, $maintenance['active_till']), $maintenanceStatus, $maintenance['description']]);
}
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:configuration.maintenance.list.php

示例13: array

    // adding javascript, so that auth fields would be hidden if they are not used in specific auth type
    $securityLevelVisibility = array();
    zbx_subarray_push($securityLevelVisibility, ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV, 'row_snmpv3_authpassphrase');
    zbx_subarray_push($securityLevelVisibility, ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV, 'row_snmpv3_authpassphrase');
    zbx_subarray_push($securityLevelVisibility, ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV, 'row_snmpv3_privpassphrase');
    zbx_add_post_js("var securityLevelSwitcher = new CViewSwitcher('new_check_snmpv3_securitylevel', 'change', " . zbx_jsvalue($securityLevelVisibility, true) . ");");
} else {
    $numrows = new CDiv();
    $numrows->setAttribute('name', 'numrows');
    $dscry_wdgt->addHeader(S_DISCOVERY_BIG);
    $dscry_wdgt->addHeader($numrows);
    /* table */
    $form = new CForm();
    $form->setName('frmdrules');
    $tblDiscovery = new CTableInfo(S_NO_DISCOVERY_RULES_DEFINED);
    $tblDiscovery->setHeader(array(new CCheckBox('all_drules', null, "checkAll('" . $form->GetName() . "','all_drules','g_druleid');"), make_sorting_header(S_NAME, 'd.name'), make_sorting_header(S_IP_RANGE, 'd.iprange'), make_sorting_header(S_DELAY, 'd.delay'), S_CHECKS, S_STATUS));
    $sql = 'SELECT d.* ' . ' FROM drules d' . ' WHERE ' . DBin_node('druleid') . order_by('d.name,d.iprange,d.delay', 'd.druleid');
    $db_rules = DBselect($sql);
    // Discovery rules will be gathered here, so we can feed this array to pagination function
    $rules_arr = array();
    while ($rule_data = DBfetch($db_rules)) {
        $rules_arr[] = $rule_data;
    }
    // getting paging element
    $paging = getPagingLine($rules_arr);
    foreach ($rules_arr as $rule_data) {
        $checks = array();
        $sql = 'SELECT type FROM dchecks WHERE druleid=' . $rule_data['druleid'] . ' ORDER BY type, ports';
        $db_checks = DBselect($sql);
        while ($check_data = DBfetch($db_checks)) {
            if (!isset($checks[$check_data['type']])) {
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:discoveryconf.php

示例14: getRequest

 $sortOrder = getRequest('sortorder', CProfile::get('web.' . $page['file'] . '.sortorder', ZBX_SORT_UP));
 CProfile::update('web.' . $page['file'] . '.sort', $sortField, PROFILE_TYPE_STR);
 CProfile::update('web.' . $page['file'] . '.sortorder', $sortOrder, PROFILE_TYPE_STR);
 $frmForm = new CForm();
 $frmForm->cleanItems();
 $frmForm->addItem(new CDiv(array(new CSubmit('form', _('Create template')), new CButton('form', _('Import'), 'redirect("conf.import.php?rules_preset=template")'))));
 $frmForm->addItem(new CVar('groupid', $_REQUEST['groupid'], 'filter_groupid_id'));
 $templateWidget->addPageHeader(_('CONFIGURATION OF TEMPLATES'), $frmForm);
 $frmGroup = new CForm('get');
 $frmGroup->addItem(array(_('Group') . SPACE, $pageFilter->getGroupsCB()));
 $templateWidget->addHeader(_('Templates'), $frmGroup);
 $templateWidget->addHeaderRowNumber();
 $form = new CForm();
 $form->setName('templates');
 $table = new CTableInfo(_('No templates found.'));
 $table->setHeader(array(new CCheckBox('all_templates', null, "checkAll('" . $form->getName() . "', 'all_templates', 'templates');"), make_sorting_header(_('Templates'), 'name', $sortField, $sortOrder), _('Applications'), _('Items'), _('Triggers'), _('Graphs'), _('Screens'), _('Discovery'), _('Web'), _('Linked templates'), _('Linked to')));
 // get templates
 $templates = array();
 if ($pageFilter->groupsSelected) {
     $templates = API::Template()->get(array('output' => array('templateid', 'name'), 'groupids' => $pageFilter->groupid > 0 ? $pageFilter->groupid : null, 'editable' => true, 'sortfield' => $sortField, 'limit' => $config['search_limit'] + 1));
 }
 // sorting && paging
 order_result($templates, $sortField, $sortOrder);
 $paging = getPagingLine($templates);
 $templates = API::Template()->get(array('templateids' => zbx_objectValues($templates, 'templateid'), 'editable' => true, 'output' => array('name', 'proxy_hostid'), 'selectHosts' => array('hostid', 'name', 'status'), 'selectTemplates' => array('hostid', 'name', 'status'), 'selectParentTemplates' => array('hostid', 'name', 'status'), 'selectItems' => API_OUTPUT_COUNT, 'selectTriggers' => API_OUTPUT_COUNT, 'selectGraphs' => API_OUTPUT_COUNT, 'selectApplications' => API_OUTPUT_COUNT, 'selectDiscoveries' => API_OUTPUT_COUNT, 'selectScreens' => API_OUTPUT_COUNT, 'selectHttpTests' => API_OUTPUT_COUNT, 'nopermissions' => true));
 order_result($templates, $sortField, $sortOrder);
 foreach ($templates as $template) {
     $templatesOutput = array();
     if ($template['proxy_hostid']) {
         $proxy = get_host_by_hostid($template['proxy_hostid']);
         $templatesOutput[] = $proxy['host'] . NAME_DELIMITER;
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:templates.php

示例15: CWidget

$groupFieldTitle = '';
$hostinvent_wdgt = (new CWidget())->setTitle(_('Host inventory overview'));
// getting inventory fields to make a drop down
$inventoryFields = getHostInventories(true);
// 'true' means list should be ordered by title
$inventoryFieldsComboBox = new CComboBox('groupby', $_REQUEST['groupby'], 'submit()');
$inventoryFieldsComboBox->addItem('', _('not selected'));
foreach ($inventoryFields as $inventoryField) {
    $inventoryFieldsComboBox->addItem($inventoryField['db_field'], $inventoryField['title'], $_REQUEST['groupby'] === $inventoryField['db_field'] ? 'yes' : null);
    if ($_REQUEST['groupby'] === $inventoryField['db_field']) {
        $groupFieldTitle = $inventoryField['title'];
    }
}
$controls = (new CList())->addItem([_('Group') . SPACE, $pageFilter->getGroupsCB()])->addItem([_('Grouping by') . SPACE, $inventoryFieldsComboBox]);
$hostinvent_wdgt->setControls((new CForm('get'))->addItem($controls));
$table = (new CTableInfo())->setHeader([make_sorting_header($groupFieldTitle === '' ? _('Field') : $groupFieldTitle, 'inventory_field', $sortField, $sortOrder), make_sorting_header(_('Host count'), 'host_count', $sortField, $sortOrder)]);
// to show a report, we will need a host group and a field to aggregate
if ($pageFilter->groupsSelected && $groupFieldTitle !== '') {
    $options = ['output' => ['hostid', 'name'], 'selectInventory' => [$_REQUEST['groupby']], 'withInventory' => true];
    if ($pageFilter->groupid > 0) {
        $options['groupids'] = $pageFilter->groupid;
    }
    $hosts = API::Host()->get($options);
    // aggregating data by chosen field value
    $report = [];
    foreach ($hosts as $host) {
        if ($host['inventory'][$_REQUEST['groupby']] !== '') {
            // same names with different letter casing are considered the same
            $lowerValue = mb_strtolower($host['inventory'][$_REQUEST['groupby']]);
            if (!isset($report[$lowerValue])) {
                $report[$lowerValue] = ['inventory_field' => $host['inventory'][$_REQUEST['groupby']], 'host_count' => 1];
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:hostinventoriesoverview.php


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