本文整理汇总了PHP中CComboItem类的典型用法代码示例。如果您正苦于以下问题:PHP CComboItem类的具体用法?PHP CComboItem怎么用?PHP CComboItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CComboItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addItem
public function addItem($value, $caption = '', $selected = null, $enabled = true, $class = null)
{
if ($value instanceof CComboItem || $value instanceof COptGroup) {
parent::addItem($value);
} else {
if (is_null($selected)) {
$selected = 'no';
if (is_array($this->value)) {
if (str_in_array($value, $this->value)) {
$selected = 'yes';
}
} elseif (strcmp($value, $this->value) == 0) {
$selected = 'yes';
}
} else {
$selected = 'yes';
}
$citem = new CComboItem($value, $caption, $selected, $enabled);
if ($class !== null) {
$citem->addClass($class);
}
parent::addItem($citem);
}
return $this;
}
示例2: addItem
public function addItem($value, $caption = '', $selected = null, $enabled = 'yes')
{
if ($value instanceof CComboItem || $value instanceof COptGroup) {
parent::addItem($value);
} else {
$title = false;
// if caption is too long ( > 44 symbols), we add new class - 'selectShorten',
// so that the select box would not stretch
if (zbx_strlen($caption) > 44 && !$this->hasClass('selectShorten')) {
$this->setAttribute('class', $this->getAttribute('class') . ' selectShorten');
$title = true;
}
if (is_null($selected)) {
$selected = 'no';
if (is_array($this->value)) {
if (str_in_array($value, $this->value)) {
$selected = 'yes';
}
} elseif (strcmp($value, $this->value) == 0) {
$selected = 'yes';
}
} else {
$selected = 'yes';
}
$citem = new CComboItem($value, $caption, $selected, $enabled);
if ($title) {
$citem->setTitle($caption);
}
parent::addItem($citem);
}
}
示例3: array
$typeComboBox->addItems($this->data['types']);
$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');
示例4: CSpan
$name[] = NAME_DELIMITER;
$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
示例5: array_pop
$caption[] = ')';
}
$hostTemplates[] = $caption;
$hostTemplates[] = ', ';
}
if ($hostTemplates) {
array_pop($hostTemplates);
}
}
$table->addRow(array(new CCheckBox('hosts[' . $host['hostid'] . ']', null, null, $host['hostid']), $displayNodes ? get_node_name_by_elid($host['hostid'], true) : null, $description, $applications, $items, $triggers, $graphs, $discoveries, $httpTests, $hostInterface, new CCol($hostTemplates, 'wraptext'), $status, getAvailabilityTable($host)));
}
$goBox = new CComboBox('go');
$goBox->addItem('export', _('Export selected'));
$goBox->addItem('massupdate', _('Mass update'));
$goOption = new CComboItem('activate', _('Enable selected'));
$goOption->setAttribute('confirm', _('Enable selected hosts?'));
$goBox->addItem($goOption);
$goOption = new CComboItem('disable', _('Disable selected'));
$goOption->setAttribute('confirm', _('Disable selected hosts?'));
$goBox->addItem($goOption);
$goOption = new CComboItem('delete', _('Delete selected'));
$goOption->setAttribute('confirm', _('Delete selected hosts?'));
$goBox->addItem($goOption);
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$goButton->setAttribute('id', 'goButton');
zbx_add_post_js('chkbxRange.pageGoName = "hosts";');
$form->addItem(array($paging, $table, $paging, get_table_header(array($goBox, $goButton))));
$hostsWidget->addItem($form);
}
$hostsWidget->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
示例6: get_host_by_hostid
$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';
示例7: CLink
$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';
示例8: CCheckBox
}
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;
示例9: CTableInfo
$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';
示例10: CLink
$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';
示例11: getPagingLine
$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';
示例12: array_pop
$hosts_output[] = ', ';
}
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();
示例13: CLink
$url = 'hosts.php?form=update&hostid=' . $linked_to_host['hostid'] . '&groupid=' . $_REQUEST['groupid'];
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();
示例14: order_result
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: CTableInfo
// 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;