$regExpForm = new CForm();
$regExpForm->setName('regularExpressionsForm');
$regExpForm->addItem(BR());
$regExpTable = new CTableInfo(_('No regular expressions found.'));
$regExpTable->setHeader(array(new CCheckBox('all_regexps', null, "checkAll('regularExpressionsForm', 'all_regexps', 'regexpids');"), $this->data['displayNodes'] ? _('Node') : null, _('Name'), _('Expressions')));
$expressions = array();
$values = array();
foreach ($this->data['db_exps'] as $exp) {
    if (!isset($expressions[$exp['regexpid']])) {
        $values[$exp['regexpid']] = 1;
    } else {
        $values[$exp['regexpid']]++;
    }
    if (!isset($expressions[$exp['regexpid']])) {
        $expressions[$exp['regexpid']] = new CTable();
    }
    $expressions[$exp['regexpid']]->addRow(array($values[$exp['regexpid']], ' » ', $exp['expression'], ' [' . expression_type2str($exp['expression_type']) . ']'));
}
foreach ($this->data['regexps'] as $regexpid => $regexp) {
    $regExpTable->addRow(array(new CCheckBox('regexpids[' . $regexp['regexpid'] . ']', null, null, $regexp['regexpid']), $this->data['displayNodes'] ? $regexp['nodename'] : null, new CLink($regexp['name'], 'adm.regexps.php?form=update' . '&regexpid=' . $regexp['regexpid']), isset($expressions[$regexpid]) ? $expressions[$regexpid] : '-'));
}
$goBox = new CComboBox('go');
$goOption = new CComboItem('delete', _('Delete selected'));
$goOption->setAttribute('confirm', _('Delete selected regular expressions?'));
$goBox->addItem($goOption);
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "regexpids";');
$regExpTable->setFooter(new CCol(array($goBox, $goButton)));
$regExpForm->addItem($regExpTable);
return $regExpForm;
コード例 #2
0
        }
        array_pop($actionLinks);
    } else {
        $actionLinks = '-';
    }
    $actionColumn = new CCol($actionLinks);
    $actionColumn->setAttribute('style', 'white-space: normal;');
    $statusLink = 'media_types.php?go=' . ($mediaType['status'] == MEDIA_TYPE_STATUS_DISABLED ? 'activate' : 'disable') . '&mediatypeids' . SQUAREBRACKETS . '=' . $mediaType['mediatypeid'];
    $status = MEDIA_TYPE_STATUS_ACTIVE == $mediaType['status'] ? new CLink(_('Enabled'), $statusLink, 'enabled') : new CLink(_('Disabled'), $statusLink, 'disabled');
    // append row
    $mediaTypeTable->addRow(array(new CCheckBox('mediatypeids[' . $mediaType['mediatypeid'] . ']', null, null, $mediaType['mediatypeid']), $this->data['displayNodes'] ? $mediaType['nodename'] : null, new CLink($mediaType['description'], '?form=edit&mediatypeid=' . $mediaType['mediatypeid']), media_type2str($mediaType['typeid']), $status, $actionColumn, $details));
}
// create go button
$goComboBox = new CComboBox('go');
$goOption = new CComboItem('activate', _('Enable selected'));
$goOption->setAttribute('confirm', _('Enable selected media types?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('disable', _('Disable selected'));
$goOption->setAttribute('confirm', _('Disable selected media types?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('delete', _('Delete selected'));
$goOption->setAttribute('confirm', _('Delete selected media types?'));
$goComboBox->addItem($goOption);
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "mediatypeids";');
// append table to form
$mediaTypeForm->addItem(array($this->data['paging'], $mediaTypeTable, $this->data['paging'], get_table_header(array($goComboBox, $goButton))));
// append form to widget
$mediaTypeWidget->addItem($mediaTypeForm);
return $mediaTypeWidget;
コード例 #3
0
ファイル: httpconf.php プロジェクト: songyuanjie/zabbix-stats
        }
    }
    // PAGING FOOTER
    //		$table->addRow(new CCol($paging));
    //		$http_wdgt->addItem($paging);
    //---------
    //----- GO ------
    $goBox = new CComboBox('go');
    $goOption = new CComboItem('activate', S_ACTIVATE_SELECTED);
    $goOption->setAttribute('confirm', S_ENABLE_SELECTED_WEB_SCENARIOS_Q);
    $goBox->addItem($goOption);
    $goOption = new CComboItem('disable', S_DISABLE_SELECTED);
    $goOption->setAttribute('confirm', S_DISABLE_SELECTED_WEB_SCENARIOS_Q);
    $goBox->addItem($goOption);
    $goOption = new CComboItem('clean_history', S_CLEAR_HISTORY_FOR_SELECTED);
    $goOption->setAttribute('confirm', S_DELETE_HISTORY_SELECTED_WEB_SCENARIOS_Q);
    $goBox->addItem($goOption);
    $goOption = new CComboItem('delete', S_DELETE_SELECTED);
    $goOption->setAttribute('confirm', S_DELETE_SELECTED_WEB_SCENARIOS_Q);
    $goBox->addItem($goOption);
    // goButton name is necessary!!!
    $goButton = new CButton('goButton', S_GO . ' (0)');
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "group_httptestid";');
    $table->setFooter(new CCol(array($goBox, $goButton)));
    //----
    $form->addItem($table);
    $http_wdgt->addItem($form);
}
$http_wdgt->show();
include_once 'include/page_footer.php';
コード例 #4
0
// create table
$maintenanceTable = new CTableInfo(_('No maintenance periods found.'));
$maintenanceTable->setHeader(array(new CCheckBox('all_maintenances', null, "checkAll('" . $maintenanceForm->getName() . "', 'all_maintenances', 'maintenanceids');"), $this->data['displayNodes'] ? _('Node') : null, make_sorting_header(_('Name'), 'name'), make_sorting_header(_('Type'), 'maintenance_type'), _('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'), 'red');
            break;
        case MAINTENANCE_STATUS_APPROACH:
            $maintenanceStatus = new CSpan(_x('Approaching', 'maintenance status'), 'blue');
            break;
        case MAINTENANCE_STATUS_ACTIVE:
            $maintenanceStatus = new CSpan(_x('Active', 'maintenance status'), 'green');
            break;
    }
    $maintenanceTable->addRow(array(new CCheckBox('maintenanceids[' . $maintenanceid . ']', null, null, $maintenanceid), $this->data['displayNodes'] ? $maintenance['nodename'] : null, new CLink($maintenance['name'], 'maintenance.php?form=update&maintenanceid=' . $maintenanceid), $maintenance['maintenance_type'] ? _('No data collection') : _('With data collection'), $maintenanceStatus, $maintenance['description']));
}
// create go button
$goComboBox = new CComboBox('go');
$goOption = new CComboItem('delete', _('Delete selected'));
$goOption->setAttribute('confirm', _('Delete selected maintenance periods?'));
$goComboBox->addItem($goOption);
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "maintenanceids";');
// append table to form
$maintenanceForm->addItem(array($this->data['paging'], $maintenanceTable, $this->data['paging'], get_table_header(array($goComboBox, $goButton))));
// append form to widget
$maintenanceWidget->addItem($maintenanceForm);
return $maintenanceWidget;
コード例 #5
0
$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?'));
$goComboBox->addItem($goOption);
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "g_druleid";');
// append table to form
$discoveryForm->addItem(array($this->data['paging'], $discoveryTable, $this->data['paging'], get_table_header(array($goComboBox, $goButton))));
// append form to widget
$discoveryWidget->addItem($discoveryForm);
return $discoveryWidget;
コード例 #6
0
}
$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
$screenForm->addItem(array($this->data['paging'], $screenTable, $this->data['paging'], get_table_header(array($goComboBox, $goButton))));
// append form to widget
$screenWidget->addItem($screenForm);
return $screenWidget;
コード例 #7
0
        $name[] = new CSpan($graph['name']);
        $isCheckboxEnabled = false;
    } else {
        $name[] = new CLink($graph['name'], 'graphs.php?' . 'form=update' . '&graphid=' . $graphid . url_param('parent_discoveryid') . '&hostid=' . $this->data['hostid']);
    }
    $checkBox = new CCheckBox('group_graphid[' . $graphid . ']', null, null, $graphid);
    $checkBox->setEnabled($isCheckboxEnabled);
    $graphTable->addRow(array($checkBox, $this->data['displayNodes'] ? $graph['nodename'] : null, $hostList, $name, $graph['width'], $graph['height'], $graph['graphtype']));
}
// create go buttons
$goComboBox = new CComboBox('go');
if (!$this->data['parent_discoveryid']) {
    $goComboBox->addItem('copy_to', _('Copy selected to ...'));
}
$goOption = new CComboItem('delete', _('Delete selected'));
$goOption->setAttribute('confirm', $this->data['parent_discoveryid'] ? _('Delete selected graph prototypes?') : _('Delete selected graphs?'));
$goComboBox->addItem($goOption);
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$goButton->attr('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "group_graphid";');
if ($this->data['parent_discoveryid']) {
    zbx_add_post_js('chkbxRange.prefix = "' . $this->data['parent_discoveryid'] . '";');
    zbx_add_post_js('cookie.prefix = "' . $this->data['parent_discoveryid'] . '";');
} else {
    zbx_add_post_js('chkbxRange.prefix = "' . $this->data['hostid'] . '";');
    zbx_add_post_js('cookie.prefix = "' . $this->data['hostid'] . '";');
}
// append table to form
$graphForm->addItem(array($this->data['paging'], $graphTable, $this->data['paging'], get_table_header(array($goComboBox, $goButton))));
// append form to widget
$graphWidget->addItem($graphForm);
コード例 #8
0
ファイル: triggers.php プロジェクト: songyuanjie/zabbix-stats
            }
            //----- GO ------
            $goBox = new CComboBox('go');
            $goOption = new CComboItem('activate', S_ACTIVATE_SELECTED);
            $goOption->setAttribute('confirm', S_ENABLE_SELECTED_TRIGGERS_Q);
            $goBox->addItem($goOption);
            $goOption = new CComboItem('disable', S_DISABLE_SELECTED);
            $goOption->setAttribute('confirm', S_DISABLE_SELECTED_TRIGGERS_Q);
            $goBox->addItem($goOption);
            $goOption = new CComboItem('massupdate', S_MASS_UPDATE);
            //$goOption->setAttribute('confirm',S_MASS_UPDATE_SELECTED_TRIGGERS_Q);
            $goBox->addItem($goOption);
            $goOption = new CComboItem('copy_to', S_COPY_SELECTED_TO);
            //$goOption->setAttribute('confirm',S_COPY_SELECTED_TRIGGERS_Q);
            $goBox->addItem($goOption);
            $goOption = new CComboItem('delete', S_DELETE_SELECTED);
            $goOption->setAttribute('confirm', S_DELETE_SELECTED_TRIGGERS_Q);
            $goBox->addItem($goOption);
            // goButton name is necessary!!!
            $goButton = new CButton('goButton', S_GO);
            $goButton->setAttribute('id', 'goButton');
            zbx_add_post_js('chkbxRange.pageGoName = "g_triggerid";');
            $footer = get_table_header(array($goBox, $goButton));
            $table = array($paging, $table, $paging, $footer);
            $form->addItem($table);
            $triggers_wdgt->addItem($form);
        }
    }
}
$triggers_wdgt->show();
include_once 'include/page_footer.php';
コード例 #9
0
            $name[] = ', ';
        }
        array_pop($name);
        $name[] = NAME_DELIMITER;
        $name[] = $application['name'];
    } else {
        $name = new CLink($application['name'], 'applications.php?' . 'form=update' . '&applicationid=' . $application['applicationid'] . '&hostid=' . $application['hostid'] . '&groupid=' . $this->data['groupid']);
    }
    $applicationTable->addRow(array(new CCheckBox('applications[' . $application['applicationid'] . ']', null, null, $application['applicationid']), $this->data['displayNodes'] ? $application['nodename'] : null, $this->data['hostid'] > 0 ? null : $application['host'], $name, array(new CLink(_('Items'), 'items.php?' . 'hostid=' . $application['hostid'] . '&filter_set=1' . '&filter_application=' . urlencode($application['name'])), SPACE . '(' . count($application['items']) . ')')));
}
// create go buttons
$goComboBox = new CComboBox('go');
$goOption = new CComboItem('activate', _('Enable selected'));
$goOption->setAttribute('confirm', _('Enable selected applications?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('disable', _('Disable selected'));
$goOption->setAttribute('confirm', _('Disable selected applications?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('delete', _('Delete selected'));
$goOption->setAttribute('confirm', _('Delete selected applications?'));
$goComboBox->addItem($goOption);
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "applications";');
zbx_add_post_js('chkbxRange.prefix = "' . $this->data['hostid'] . '";');
zbx_add_post_js('cookie.prefix = "' . $this->data['hostid'] . '";');
// append table to form
$applicationForm->addItem(array($this->data['paging'], $applicationTable, $this->data['paging'], get_table_header(array($goComboBox, $goButton))));
// append form to widget
$applicationWidget->addItem($applicationForm);
return $applicationWidget;
コード例 #10
0
    $slides_arr = array();
    while ($slide_data = DBfetch($db_slides)) {
        $slides_arr[] = $slide_data;
    }
    // getting paging element
    $paging = getPagingLine($slides_arr);
    foreach ($slides_arr as $slide_data) {
        if (!slideshow_accessible($slide_data['slideshowid'], PERM_READ_WRITE)) {
            continue;
        }
        $table->addRow(array(new CCheckBox('shows[' . $slide_data['slideshowid'] . ']', NULL, NULL, $slide_data['slideshowid']), new CLink($slide_data['name'], '?config=1&form=update&slideshowid=' . $slide_data['slideshowid'], 'action'), $slide_data['delay'], $slide_data['cnt']));
    }
    // adding paging to widget
    $table->addRow(new CCol($paging));
    $slide_wdgt->addItem($paging);
    // goBox
    $goBox = new CComboBox('go');
    $goOption = new CComboItem('delete', S_DELETE_SELECTED);
    $goOption->setAttribute('confirm', S_DELETE_SELECTED_SLIDESHOWS_Q);
    $goBox->addItem($goOption);
    // goButton name is necessary!!!
    $goButton = new CButton('goButton', S_GO);
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "shows";');
    $table->setFooter(new CCol(array($goBox, $goButton)));
    //---------
    $form->addItem($table);
    $slide_wdgt->addItem($form);
}
$slide_wdgt->show();
include_once 'include/page_footer.php';
コード例 #11
0
ファイル: graphs.php プロジェクト: songyuanjie/zabbix-stats
                $name[] = new CLink($real_host['host'], 'graphs.php?' . 'hostid=' . $real_host['hostid'], 'unknown');
                $name[] = ':' . $graph['name'];
            } else {
                $name[] = new CLink($graph['name'], 'graphs.php?graphid=' . $graphid . '&form=update');
            }
            $chkBox = new CCheckBox('group_graphid[' . $graphid . ']', NULL, NULL, $graphid);
            if ($graph['templateid'] > 0) {
                $chkBox->setEnabled(false);
            }
            $table->addRow(array($chkBox, $host_list, $name, $graph['width'], $graph['height'], $graph['graphtype']));
        }
        //----- GO ------
        $goBox = new CComboBox('go');
        $goBox->addItem('copy_to', S_COPY_SELECTED_TO);
        $goOption = new CComboItem('delete', S_DELETE_SELECTED);
        $goOption->setAttribute('confirm', S_DELETE_SELECTED_GRAPHS);
        $goBox->addItem($goOption);
        // goButton name is necessary!!!
        $goButton = new CButton('goButton', S_GO);
        $goButton->setAttribute('id', 'goButton');
        zbx_add_post_js('chkbxRange.pageGoName = "group_graphid";');
        $footer = get_table_header(new CCol(array($goBox, $goButton)));
        //----
        // PAGING FOOTER
        $table = array($paging, $table, $paging, $footer);
        //---------
        $form->addItem($table);
        $graphs_wdgt->addItem($form);
        $graphs_wdgt->show();
    }
}
コード例 #12
0
        }
        array_pop($hosts_output);
        $hostCount = $groupCounts[$group['groupid']]['hosts'];
        $templateCount = $groupCounts[$group['groupid']]['templates'];
        $table->addRow(array(new CCheckBox('groups[' . $group['groupid'] . ']', NULL, NULL, $group['groupid']), new CLink($group['name'], 'hostgroups.php?form=update&groupid=' . $group['groupid']), array(array(new CLink(S_TEMPLATES, 'templates.php?groupid=' . $group['groupid'], 'unknown'), ' (' . $templateCount . ')'), BR(), array(new CLink(S_HOSTS, 'hosts.php?groupid=' . $group['groupid']), ' (' . $hostCount . ')')), new CCol(empty($hosts_output) ? '-' : $hosts_output, 'wraptext')));
    }
    //----- GO ------
    $goBox = new CComboBox('go');
    $goOption = new CComboItem('activate', S_ACTIVATE_SELECTED_HOSTS);
    $goOption->setAttribute('confirm', S_ENABLE_SELECTED_HOST_GROUPS);
    $goBox->addItem($goOption);
    $goOption = new CComboItem('disable', S_DISABLE_SELECTED_HOSTS);
    $goOption->setAttribute('confirm', S_DISABLE_SELECTED_HOST_GROUPS);
    $goBox->addItem($goOption);
    $goOption = new CComboItem('delete', S_DELETE_SELECTED_GROUPS);
    $goOption->setAttribute('confirm', S_DELETE_SELECTED_HOST_GROUPS);
    $goBox->addItem($goOption);
    // goButton name is necessary!!!
    $goButton = new CButton('goButton', S_GO);
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "groups";');
    $footer = get_table_header(array($goBox, $goButton));
    //----
    // PAGING FOOTER
    $table = array($paging, $table, $paging, $footer);
    //---------
    $form->addItem($table);
    $groups_wdgt->addItem($form);
}
$groups_wdgt->show();
include_once 'include/page_footer.php';
コード例 #13
0
                    break;
            }
            $linked_to_output[] = new CLink($linked_to_host['host'], $url, $style);
            $linked_to_output[] = ', ';
        }
        array_pop($linked_to_output);
        $table->addRow(array(new CCheckBox('templates[' . $template['templateid'] . ']', NULL, NULL, $template['templateid']), $templates_output, $applications, $items, $triggers, $graphs, empty($linked_templates_output) ? '-' : new CCol($linked_templates_output, 'wraptext'), empty($linked_to_output) ? '-' : new CCol($linked_to_output, 'wraptext')));
    }
    // GO{
    $goBox = new CComboBox('go');
    $goBox->addItem('export', S_EXPORT_SELECTED);
    $goOption = new CComboItem('delete', S_DELETE_SELECTED);
    $goOption->setAttribute('confirm', S_DELETE_SELECTED_TEMPLATES_Q);
    $goBox->addItem($goOption);
    $goOption = new CComboItem('delete_and_clear', S_DELETE_SELECTED_WITH_LINKED_ELEMENTS);
    $goOption->setAttribute('confirm', S_WARNING_THIS_DELETE_TEMPLATES_AND_CLEAR);
    $goBox->addItem($goOption);
    // goButton name is necessary!!!
    $goButton = new CButton('goButton', S_GO);
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "templates";');
    $footer = get_table_header(new CCol(array($goBox, $goButton)));
    // }GO
    // PAGING FOOTER
    $table = array($paging, $table, $paging, $footer);
    //---------
    $form->addItem($table);
    $template_wdgt->addItem($form);
}
$template_wdgt->show();
include_once 'include/page_footer.php';
コード例 #14
0
        order_result($action['operations'], 'operationtype', ZBX_SORT_DOWN);
        foreach ($action['operations'] as $onum => $operation) {
            $operations[] = array(get_operation_desc(SHORT_DESCRITION, $operation), BR());
        }
        if ($action['status'] == ACTION_STATUS_DISABLED) {
            $status = new CLink(S_DISABLED, 'actionconf.php?go=activate&g_actionid%5B%5D=' . $action['actionid'] . url_param('eventsource'), 'disabled');
        } else {
            $status = new CLink(S_ENABLED, 'actionconf.php?go=disable&g_actionid%5B%5D=' . $action['actionid'] . url_param('eventsource'), 'enabled');
        }
        $tblActions->addRow(array(new CCheckBox('g_actionid[' . $action['actionid'] . ']', null, null, $action['actionid']), new CLink($action['name'], 'actionconf.php?form=update&actionid=' . $action['actionid']), $conditions, $operations, $status));
    }
    //----- GO ------
    $goBox = new CComboBox('go');
    $goOption = new CComboItem('activate', S_ENABLE_SELECTED);
    $goOption->setAttribute('confirm', S_ENABLE . ' ' . S_SELECTED_ACTIONS);
    $goBox->addItem($goOption);
    $goOption = new CComboItem('disable', S_DISABLE_SELECTED);
    $goOption->setAttribute('confirm', S_DISABLE . ' ' . S_SELECTED_ACTIONS);
    $goBox->addItem($goOption);
    $goOption = new CComboItem('delete', S_DELETE_SELECTED);
    $goOption->setAttribute('confirm', S_DELETE . ' ' . S_SELECTED_ACTIONS);
    $goBox->addItem($goOption);
    $goButton = new CButton('goButton', S_GO);
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "g_actionid";');
    $footer = get_table_header(array($goBox, $goButton));
    $form->addItem(array($paging, $tblActions, $paging, $footer));
    $action_wdgt->addItem($form);
}
$action_wdgt->show();
include_once 'include/page_footer.php';
コード例 #15
0
ファイル: templates.php プロジェクト: TonywalkerCN/Zabbix
                    $style = 'unknown';
                    $url = 'templates.php?form=update&templateid=' . $linkedToHost['objectid'];
                    break;
                default:
                    $style = null;
                    $url = 'hosts.php?form=update&hostid=' . $linkedToHost['objectid'] . '&groupid=' . $_REQUEST['groupid'];
            }
            if ($linkedToOutput) {
                $linkedToOutput[] = ', ';
            }
            $linkedToOutput[] = new CLink($linkedToHost['name'], $url, $style);
        }
        $table->addRow(array(new CCheckBox('templates[' . $template['templateid'] . ']', null, null, $template['templateid']), $templatesOutput, $applications, $items, $triggers, $graphs, $screens, $discoveries, $httpTests, $linkedTemplatesOutput ? new CCol($linkedTemplatesOutput, 'wraptext') : '-', $linkedToOutput ? new CCol($linkedToOutput, 'wraptext') : '-'));
    }
    $goBox = new CComboBox('action');
    $goBox->addItem('template.export', _('Export selected'));
    $goOption = new CComboItem('template.massdelete', _('Delete selected'));
    $goOption->setAttribute('confirm', _('Delete selected templates?'));
    $goBox->addItem($goOption);
    $goOption = new CComboItem('template.massdeleteclear', _('Delete selected with linked elements'));
    $goOption->setAttribute('confirm', _('Delete and clear selected templates? (Warning: all linked hosts will be cleared!)'));
    $goBox->addItem($goOption);
    $goButton = new CSubmit('goButton', _('Go') . ' (0)');
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "templates";');
    $footer = get_table_header(array($goBox, $goButton));
    $form->addItem(array($paging, $table, $paging, $footer));
    $templateWidget->addItem($form);
}
$templateWidget->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
コード例 #16
0
    $paging = getPagingLine($maintenances);
    foreach ($maintenances as $mnum => $maintenance) {
        $maintenanceid = $maintenance['maintenanceid'];
        switch ($maintenance['status']) {
            case MAINTENANCE_STATUS_EXPIRED:
                $mnt_status = new CSpan(S_EXPIRED, 'red');
                break;
            case MAINTENANCE_STATUS_APPROACH:
                $mnt_status = new CSpan(S_APPROACHING, 'blue');
                break;
            case MAINTENANCE_STATUS_ACTIVE:
                $mnt_status = new CSpan(S_ACTIVE, 'green');
                break;
        }
        $table->addRow(array(new CCheckBox('maintenanceids[' . $maintenanceid . ']', NULL, NULL, $maintenanceid), new CLink($maintenance['name'], 'maintenance.php?form=update&maintenanceid=' . $maintenanceid . '#form'), $maintenance['maintenance_type'] ? S_NO_DATA_COLLECTION : S_WITH_DATA_COLLECTION, $mnt_status, $maintenance['description']));
    }
    // goBox
    $goBox = new CComboBox('go');
    $goOption = new CComboItem('delete', S_DELETE_SELECTED);
    $goOption->setAttribute('confirm', S_DELETE_SELECTED_MAINTENANCE_PERIODS_Q);
    $goBox->addItem($goOption);
    // goButton name is necessary!!!
    $goButton = new CButton('goButton', S_GO . ' (0)');
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "maintenanceids";');
    $footer = get_table_header(array($goBox, $goButton));
    $form->addItem(array($paging, $table, $paging, $footer));
    $maintenance_wdgt->addItem($form);
}
$maintenance_wdgt->show();
include_once 'include/page_footer.php';
コード例 #17
0
            $proxy = get_host_by_hostid($rule_data["proxy_hostid"]);
            array_push($description, $proxy["host"], ":");
        }
        array_push($description, new CLink($rule_data['name'], "?form=update&druleid=" . $rule_data['druleid']));
        $tblDiscovery->addRow(array(new CCheckBox('g_druleid[' . $rule_data["druleid"] . ']', null, null, $rule_data["druleid"]), $description, $rule_data['iprange'], $rule_data['delay'], implode(', ', $checks), $status));
    }
    // pagination at the top and the bottom of the page
    $tblDiscovery->addRow(new CCol($paging));
    $dscry_wdgt->addItem($paging);
    // gobox
    $goBox = new CComboBox('go');
    $goOption = new CComboItem('activate', S_ENABLE_SELECTED);
    $goOption->setAttribute('confirm', S_ENABLE_SELECTED_DISCOVERY_RULES);
    $goBox->addItem($goOption);
    $goOption = new CComboItem('disable', S_DISABLE_SELECTED);
    $goOption->setAttribute('confirm', S_DISABLE_SELECTED_DISCOVERY_RULES);
    $goBox->addItem($goOption);
    $goOption = new CComboItem('delete', S_DELETE_SELECTED);
    $goOption->setAttribute('confirm', S_DELETE_SELECTED_DISCOVERY_RULES);
    $goBox->addItem($goOption);
    // goButton name is necessary!!!
    $goButton = new CButton('goButton', S_GO . ' (0)');
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "g_druleid";');
    $tblDiscovery->setFooter(new CCol(array($goBox, $goButton)));
    //----
    $form->addItem($tblDiscovery);
    $dscry_wdgt->addItem($form);
}
$dscry_wdgt->show();
include_once 'include/page_footer.php';
コード例 #18
0
    // status
    if ($showStatus) {
        $status = array();
        // discovered item lifetime indicator
        if ($group['flags'] == ZBX_FLAG_DISCOVERY_CREATED && $group['groupDiscovery']['ts_delete']) {
            $deleteError = new CDiv(SPACE, 'status_icon iconwarning');
            $deleteError->setHint(_s('The host group is not discovered anymore and will be deleted in %1$s (on %2$s at %3$s).', zbx_date2age($group['groupDiscovery']['ts_delete']), zbx_date2str(_('d M Y'), $group['groupDiscovery']['ts_delete']), zbx_date2str(_('H:i:s'), $group['groupDiscovery']['ts_delete'])));
            $status[] = $deleteError;
        }
    }
    $hostGroupTable->addRow(array(new CCheckBox('groups[' . $group['groupid'] . ']', null, null, $group['groupid']), $this->data['displayNodes'] ? $group['nodename'] : null, $name, array(array(new CLink(_('Templates'), 'templates.php?groupid=' . $group['groupid'], 'unknown'), ' (' . $templateCount . ')'), BR(), array(new CLink(_('Hosts'), 'hosts.php?groupid=' . $group['groupid']), ' (' . $hostCount . ')')), new CCol(empty($hostsOutput) ? '-' : $hostsOutput, 'wraptext'), $showStatus ? $status : null));
}
// create go button
$goComboBox = new CComboBox('go');
$goOption = new CComboItem('activate', _('Enable selected'));
$goOption->setAttribute('confirm', _('Enable selected hosts?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('disable', _('Disable selected'));
$goOption->setAttribute('confirm', _('Disable hosts in the selected host groups?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('delete', _('Delete selected'));
$goOption->setAttribute('confirm', _('Delete selected host groups?'));
$goComboBox->addItem($goOption);
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "groups";');
// append table to form
$hostGroupForm->addItem(array($this->data['paging'], $hostGroupTable, $this->data['paging'], get_table_header(array($goComboBox, $goButton))));
// append form to widget
$hostGroupWidget->addItem($hostGroupForm);
return $hostGroupWidget;
コード例 #19
0
**/
$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);
return $slideWidget;
コード例 #20
0
                $name = new CLink($application['name'], 'applications.php?form=update&applicationid=' . $applicationid);
            } else {
                $template_host = get_realhost_by_applicationid($application['templateid']);
                $name = array(new CLink($template_host['host'], 'applications.php?hostid=' . $template_host['hostid']), ':', $application['name']);
            }
            $table->addRow(array(new CCheckBox('applications[' . $applicationid . ']', NULL, NULL, $applicationid), $_REQUEST['hostid'] > 0 ? null : $application['host'], $name, array(new CLink(S_ITEMS, 'items.php?hostid=' . $_REQUEST['hostid'] . '&filter_set=1&filter_application=' . urlencode($application['name'])), SPACE . '(' . count($application['items']) . ')')));
        }
        // goBox
        $goBox = new CComboBox('go');
        $goOption = new CComboItem('activate', S_ACTIVATE_SELECTED);
        $goOption->setAttribute('confirm', S_ACTIVATE_SELECTED_APPLICATIONS);
        $goBox->addItem($goOption);
        $goOption = new CComboItem('disable', S_DISABLE_SELECTED);
        $goOption->setAttribute('confirm', S_DISABLE_SELECTED_APPLICATIONS);
        $goBox->addItem($goOption);
        $goOption = new CComboItem('delete', S_DELETE_SELECTED);
        $goOption->setAttribute('confirm', S_DELETE_SELECTED_APPLICATIONS);
        $goBox->addItem($goOption);
        // goButton name is necessary!!!
        $goButton = new CButton('goButton', S_GO . ' (0)');
        $goButton->setAttribute('id', 'goButton');
        zbx_add_post_js('chkbxRange.pageGoName = "applications";');
        $footer = get_table_header(new CCol(array($goBox, $goButton)));
        //----
        $table = array($paging, $table, $paging, $footer);
    }
    $form->addItem($table);
    $app_wdgt->addItem($form);
}
$app_wdgt->show();
include_once 'include/page_footer.php';
コード例 #21
0
    $itemFormList->addRow(_('Type'), $typeComboBox);
}
// append key to form list
$itemFormList->addRow(_('Key'), array(new CTextBox('key', $this->data['key'], ZBX_TEXTBOX_STANDARD_SIZE, $this->data['limited']), !$this->data['limited'] && !$this->data['is_discovery_rule'] ? new CButton('keyButton', _('Select'), 'return PopUp("popup.php?srctbl=help_items&srcfld1=key' . '&dstfrm=' . $itemForm->getName() . '&dstfld1=key&itemtype="+jQuery("#type option:selected").val());', 'formlist') : null));
// append interfaces to form list
if (!empty($this->data['interfaces'])) {
    $interfacesComboBox = new CComboBox('interfaceid', $this->data['interfaceid']);
    // set up interface groups
    $interfaceGroups = array();
    foreach (zbx_objectValues($this->data['interfaces'], 'type') as $interfaceType) {
        $interfaceGroups[$interfaceType] = new COptGroup(interfaceType2str($interfaceType));
    }
    // add interfaces to groups
    foreach ($this->data['interfaces'] as $interface) {
        $option = new CComboItem($interface['interfaceid'], $interface['useip'] ? $interface['ip'] . ' : ' . $interface['port'] : $interface['dns'] . ' : ' . $interface['port'], $interface['interfaceid'] == $this->data['interfaceid'] ? 'yes' : 'no');
        $option->setAttribute('data-interfacetype', $interface['type']);
        $interfaceGroups[$interface['type']]->addItem($option);
    }
    foreach ($interfaceGroups as $interfaceGroup) {
        $interfacesComboBox->addItem($interfaceGroup);
    }
    $span = new CSpan(_('No interface found'), 'red');
    $span->setAttribute('id', 'interface_not_defined');
    $span->setAttribute('style', 'display: none;');
    $itemFormList->addRow(_('Host interface'), array($interfacesComboBox, $span), false, 'interface_row');
    $itemForm->addVar('selectedInterfaceId', $this->data['interfaceid']);
}
$itemFormList->addRow(_('SNMP OID'), new CTextBox('snmp_oid', $this->data['snmp_oid'], ZBX_TEXTBOX_STANDARD_SIZE, $this->data['limited']), false, 'row_snmp_oid');
$itemFormList->addRow(_('Context name'), new CTextBox('snmpv3_contextname', $this->data['snmpv3_contextname'], ZBX_TEXTBOX_STANDARD_SIZE), false, 'row_snmpv3_contextname');
$itemFormList->addRow(_('SNMP community'), new CTextBox('snmp_community', $this->data['snmp_community'], ZBX_TEXTBOX_STANDARD_SIZE, 'no', 64), false, 'row_snmp_community');
$itemFormList->addRow(_('Security name'), new CTextBox('snmpv3_securityname', $this->data['snmpv3_securityname'], ZBX_TEXTBOX_STANDARD_SIZE, 'no', 64), false, 'row_snmpv3_securityname');
コード例 #22
0
ファイル: proxies.php プロジェクト: songyuanjie/zabbix-stats
        foreach ($proxy['hosts'] as $host) {
            $style = $host['status'] == HOST_STATUS_MONITORED ? 'off' : ($host['status'] == HOST_STATUS_TEMPLATE ? 'unknown' : 'on');
            $hosts[] = new CLink($host['host'], 'hosts.php?form=update&hostid=' . $host['hostid'], $style);
            $hosts[] = ', ';
        }
        array_pop($hosts);
        $table->addRow(array(new CCheckBox('hosts[' . $proxy['proxyid'] . ']', NULL, NULL, $proxy['proxyid']), new CLink($proxy['host'], 'proxies.php?form=update&hostid=' . $proxy['proxyid']), $proxy['status'] == HOST_STATUS_PROXY_ACTIVE ? S_PROXY_ACTIVE : S_PROXY_PASSIVE, $proxy['lastaccess'] == 0 ? '-' : zbx_date2age($proxy['lastaccess']), count($proxy['hosts']), isset($proxy['item_count']) ? $proxy['item_count'] : 0, isset($proxy['perf']) ? $proxy['perf'] : '-', new CCol(empty($hosts) ? '-' : $hosts, 'wraptext')));
    }
    //----- GO ------
    $goBox = new CComboBox('go');
    $goOption = new CComboItem('activate', S_ACTIVATE_SELECTED);
    $goOption->setAttribute('confirm', S_ENABLE_SELECTED_PROXIES);
    $goBox->addItem($goOption);
    $goOption = new CComboItem('disable', S_DISABLE_SELECTED);
    $goOption->setAttribute('confirm', S_DISABLE_SELECTED_PROXIES);
    $goBox->addItem($goOption);
    $goOption = new CComboItem('delete', S_DELETE_SELECTED);
    $goOption->setAttribute('confirm', S_DELETE_SELECTED_PROXIES);
    $goBox->addItem($goOption);
    // goButton name is necessary!!!
    $goButton = new CButton('goButton', S_GO . ' (0)');
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "hosts";');
    // --
    $footer = get_table_header(array($goBox, $goButton));
    $table = array($paging, $table, $paging, $footer);
    $form->addItem($table);
    $proxies_wdgt->addItem($form);
    $proxies_wdgt->show();
}
include_once 'include/page_footer.php';
コード例 #23
0
            if ($hosts) {
                $hosts[] = ', ';
            }
            $hosts[] = new CLink($host['name'], 'hosts.php?form=update&hostid=' . $host['hostid'], $style);
        }
    }
    $lastAccess = '-';
    if (isset($proxy['lastaccess'])) {
        $lastAccess = $proxy['lastaccess'] == 0 ? '-' : zbx_date2age($proxy['lastaccess']);
    }
    $proxyTable->addRow(array(new CCheckBox('hosts[' . $proxy['proxyid'] . ']', null, null, $proxy['proxyid']), isset($proxy['host']) ? new CLink($proxy['host'], 'proxies.php?form=update&proxyid=' . $proxy['proxyid']) : '', isset($proxy['status']) && $proxy['status'] == HOST_STATUS_PROXY_ACTIVE ? _('Active') : _('Passive'), $lastAccess, isset($proxy['host']) ? count($proxy['hosts']) : '', isset($proxy['item_count']) ? $proxy['item_count'] : 0, isset($proxy['perf']) ? $proxy['perf'] : '-', new CCol(empty($hosts) ? '-' : $hosts, 'wraptext')));
}
// create go buttons
$goComboBox = new CComboBox('action');
$goOption = new CComboItem('proxy.massenable', _('Enable selected'));
$goOption->setAttribute('confirm', _('Enable hosts monitored by selected proxies?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('proxy.massdisable', _('Disable selected'));
$goOption->setAttribute('confirm', _('Disable hosts monitored by selected proxies?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('proxy.massdelete', _('Delete selected'));
$goOption->setAttribute('confirm', _('Delete selected proxies?'));
$goComboBox->addItem($goOption);
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "hosts";');
// append table to form
$proxyForm->addItem(array($this->data['paging'], $proxyTable, $this->data['paging'], get_table_header(array($goComboBox, $goButton))));
// append form to widget
$proxyWidget->addItem($proxyForm);
return $proxyWidget;
コード例 #24
0
        $template = $this->data['parentTemplates'][$httpTestId];
        $name[] = new CLink($template['name'], '?groupid=0&hostid=' . $template['id'], 'unknown');
        $name[] = NAME_DELIMITER;
    }
    $name[] = new CLink($httpTest['name'], '?form=update' . '&httptestid=' . $httpTest['httptestid'] . '&hostid=' . $httpTest['hostid']);
    $httpTable->addRow(array(new CCheckBox('group_httptestid[' . $httpTest['httptestid'] . ']', null, null, $httpTest['httptestid']), $this->data['displayNodes'] ? $httpTest['nodename'] : null, $this->data['hostid'] > 0 ? null : $httpTest['hostname'], $name, $httpTest['stepscnt'], $httpTest['delay'], new CLink(httptest_status2str($httpTest['status']), '?group_httptestid[]=' . $httpTest['httptestid'] . '&hostid=' . $httpTest['hostid'] . '&go=' . ($httpTest['status'] ? 'activate' : 'disable'), httptest_status2style($httpTest['status']))));
}
// create go buttons
$goComboBox = new CComboBox('go');
$goOption = new CComboItem('activate', _('Enable selected'));
$goOption->setAttribute('confirm', _('Enable selected WEB scenarios?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('disable', _('Disable selected'));
$goOption->setAttribute('confirm', _('Disable selected WEB scenarios?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('clean_history', _('Clear history for selected'));
$goOption->setAttribute('confirm', _('Delete history of selected WEB scenarios?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('delete', _('Delete selected'));
$goOption->setAttribute('confirm', _('Delete selected WEB scenarios?'));
$goComboBox->addItem($goOption);
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "group_httptestid";');
zbx_add_post_js('chkbxRange.prefix = "' . $this->data['hostid'] . '";');
zbx_add_post_js('cookie.prefix = "' . $this->data['hostid'] . '";');
// append table to form
$httpForm->addItem(array($this->data['paging'], $httpTable, $this->data['paging'], get_table_header(array($goComboBox, $goButton))));
// append form to widget
$httpWidget->addItem($httpForm);
return $httpWidget;
コード例 #25
0
    }
    if ($user['type'] == USER_TYPE_SUPER_ADMIN) {
        $userTypeStyle = 'disabled';
    }
    // gui access style
    $guiAccessStyle = 'green';
    if ($user['gui_access'] == GROUP_GUI_ACCESS_INTERNAL) {
        $guiAccessStyle = 'orange';
    }
    if ($user['gui_access'] == GROUP_GUI_ACCESS_DISABLED) {
        $guiAccessStyle = 'disabled';
    }
    // append user to table
    $usersTable->addRow(array(new CCheckBox('group_userid[' . $userId . ']', null, null, $userId), new CLink($user['alias'], 'users.php?form=update&userid=' . $userId), $user['name'], $user['surname'], user_type2str($user['type']), $usersGroups, $online, $blocked, new CSpan(user_auth_type2str($user['gui_access']), $guiAccessStyle), $user['debug_mode'] == GROUP_DEBUG_MODE_ENABLED ? new CSpan(_('Enabled'), 'orange') : new CSpan(_('Disabled'), 'green'), $user['users_status'] == 1 ? new CSpan(_('Disabled'), 'red') : new CSpan(_('Enabled'), 'green')));
}
// append Go buttons
$goComboBox = new CComboBox('action');
$goOption = new CComboItem('user.massunblock', _('Unblock selected'));
$goOption->setAttribute('confirm', _('Unblock selected users?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('user.massdelete', _('Delete selected'));
$goOption->setAttribute('confirm', _('Delete selected users?'));
$goComboBox->addItem($goOption);
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "group_userid";');
// append table to form
$usersForm->addItem(array($this->data['paging'], $usersTable, $this->data['paging'], get_table_header(array($goComboBox, $goButton))));
// append form to widget
$usersWidget->addItem($usersForm);
return $usersWidget;
コード例 #26
0
ファイル: sysmaps.php プロジェクト: songyuanjie/zabbix-stats
    $map_wdgt->addHeader($numrows);
    $table = new CTableInfo(S_NO_MAPS_DEFINED);
    $table->setHeader(array(new CCheckBox('all_maps', NULL, "checkAll('" . $form->getName() . "','all_maps','maps');"), make_sorting_header(S_NAME, 'name'), make_sorting_header(S_WIDTH, 'width'), make_sorting_header(S_HEIGHT, 'height'), S_EDIT));
    $sortfield = getPageSortField('name');
    $sortorder = getPageSortOrder();
    $options = array('editable' => 1, 'extendoutput' => 1, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'limit' => $config['search_limit'] + 1);
    $maps = CMap::get($options);
    // sorting
    order_result($maps, $sortfield, $sortorder);
    $paging = getPagingLine($maps);
    //-------
    foreach ($maps as $mnum => $map) {
        $table->addRow(array(new CCheckBox('maps[' . $map['sysmapid'] . ']', NULL, NULL, $map['sysmapid']), new CLink($map['name'], 'sysmap.php?sysmapid=' . $map['sysmapid']), $map['width'], $map['height'], new CLink(S_EDIT, 'sysmaps.php?form=update&sysmapid=' . $map['sysmapid'] . '#form')));
    }
    // goBox
    $goBox = new CComboBox('go');
    $goBox->addItem('export', S_EXPORT_SELECTED);
    $goOption = new CComboItem('delete', S_DELETE_SELECTED);
    $goOption->setAttribute('confirm', S_DELETE_SELECTED_MAPS_Q);
    $goBox->addItem($goOption);
    // goButton name is necessary!!!
    $goButton = new CButton('goButton', S_GO);
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "maps";');
    $footer = get_table_header(array($goBox, $goButton));
    $table = array($paging, $table, $paging, $footer);
    $form->addItem($table);
    $map_wdgt->addItem($form);
}
$map_wdgt->show();
include_once 'include/page_footer.php';
コード例 #27
0
            $hostTemplates[] = ', ';
        }
        if ($hostTemplates) {
            array_pop($hostTemplates);
        }
    }
    // status
    $status = new CLink(item_status2str($hostPrototype['status']), '?group_hostid=' . $hostPrototype['hostid'] . '&parent_discoveryid=' . $discoveryRule['itemid'] . '&go=' . ($hostPrototype['status'] ? 'activate' : 'disable'), itemIndicatorStyle($hostPrototype['status']));
    $hostTable->addRow(array(new CCheckBox('group_hostid[' . $hostPrototype['hostid'] . ']', null, null, $hostPrototype['hostid']), $name, new CCol($hostTemplates, 'wraptext'), $status));
}
// create go buttons
$goComboBox = new CComboBox('go');
$goOption = new CComboItem('activate', _('Activate selected'));
$goOption->setAttribute('confirm', _('Enable selected host prototypes?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('disable', _('Disable selected'));
$goOption->setAttribute('confirm', _('Disable selected host prototypes?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('delete', _('Delete selected'));
$goOption->setAttribute('confirm', _('Delete selected host prototypes?'));
$goComboBox->addItem($goOption);
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "group_hostid";');
zbx_add_post_js('chkbxRange.prefix = "' . $discoveryRule['itemid'] . '";');
zbx_add_post_js('cookie.prefix = "' . $discoveryRule['itemid'] . '";');
// append table to form
$itemForm->addItem(array($this->data['paging'], $hostTable, $this->data['paging'], get_table_header(array($goComboBox, $goButton))));
// append form to widget
$itemsWidget->addItem($itemForm);
return $itemsWidget;
コード例 #28
0
                $details = S_SCRIPT_NAME . ': "' . $mediatype['exec_path'] . '"';
                break;
            case MEDIA_TYPE_SMS:
                $details = S_GSM_MODEM . ': "' . $mediatype['gsm_modem'] . '"';
                break;
            case MEDIA_TYPE_JABBER:
                $details = S_JABBER_IDENTIFIER . ': "' . $mediatype['username'] . '"';
                break;
            case MEDIA_TYPE_EZ_TEXTING:
                $details = S_USERNAME . ': "' . $mediatype['username'] . '"';
                break;
            default:
                $details = '';
        }
        $table->addRow(array(new CCheckBox('media_types[' . $mediatype['mediatypeid'] . ']', NULL, NULL, $mediatype['mediatypeid']), new CLink($mediatype['description'], '?form=update&mediatypeid=' . $mediatype['mediatypeid']), media_type2str($mediatype['type']), $details));
    }
    //----- GO ------
    $goBox = new CComboBox('go');
    $goOption = new CComboItem('delete', S_DELETE_SELECTED);
    $goOption->setAttribute('confirm', S_DELETE_SELECTED_MEDIATYPES_Q);
    $goBox->addItem($goOption);
    // goButton name is necessary!!!
    $goButton = new CButton('goButton', S_GO . ' (0)');
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "media_types";');
    $footer = get_table_header(array($goBox, $goButton));
    $form->addItem(array($paging, $table, $paging, $footer));
    $medias_wdgt->addItem($form);
}
$medias_wdgt->show();
include_once 'include/page_footer.php';