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


PHP CTableInfo::setFooter方法代码示例

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


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

示例1: CLink

            $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';
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:discoveryconf.php

示例2: foreach

form = window.opener.document.forms['<?php 
    echo $dstfrm;
    ?>
'];
<!--
<?php 
    foreach ($new_groups as $id) {
        echo 'add_var_to_opener_obj(form,"new_groups[' . $id . ']","' . $id . '")' . "\r";
    }
    ?>
if(form){
	form.submit();
	close_window();
}
-->
</script>
<?php 
}
$form = new CForm();
$form->addVar('dstfrm', $dstfrm);
$form->setName('groups');
$table = new CTableInfo(_('No user groups defined.'));
$table->setHeader(array(new CCheckBox("all_groups", NULL, "checkAll('" . $form->getName() . "','all_groups','new_groups');"), _('Name')));
$result = DBselect('select * from usrgrp where ' . DBin_node('usrgrpid') . ' order by name');
while ($row = DBfetch($result)) {
    $table->addRow(array(new CCheckBox('new_groups[' . $row['usrgrpid'] . ']', isset($new_groups[$row['usrgrpid']]), NULL, $row['usrgrpid']), $row['name']));
}
$table->setFooter(new CCol(new CSubmit('select', _('Select'))));
$form->addItem($table);
$form->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:popup_usrgrp.php

示例3: array

        $operations = array();
        $db_operations = DBselect('select * from operations where actionid=' . $action_data['actionid'] . ' order by operationtype,operationid');
        while ($operation_data = DBfetch($db_operations)) {
            array_push($operations, array(get_operation_desc(SHORT_DESCRITION, $operation_data), BR()));
        }
        if ($action_data['status'] == ACTION_STATUS_DISABLED) {
            $status = new CLink(S_DISABLED, 'actionconf.php?group_enable=1&g_actionid%5B%5D=' . $action_data['actionid'] . url_param('eventsource'), 'disabled');
        } else {
            $status = new CLink(S_ENABLED, 'actionconf.php?group_disable=1&g_actionid%5B%5D=' . $action_data['actionid'] . url_param('eventsource'), 'enabled');
        }
        $tblActions->addRow(array(new CCheckBox('g_actionid[' . $action_data['actionid'] . ']', null, null, $action_data['actionid']), new CLink($action_data['name'], 'actionconf.php?form=update&actionid=' . $action_data['actionid']), $conditions, $operations, $status));
        $row_count++;
    }
    //----- GO ------
    $goBox = new CComboBox('go');
    $goBox->addItem('activate', S_ENABLE_SELECTED);
    $goBox->addItem('disable', S_DISABLE_SELECTED);
    $goBox->addItem('delete', S_DELETE_SELECTED);
    // goButton name is necessary!!!
    $goButton = new CButton('goButton', S_GO . ' (0)');
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "g_actionid";');
    $tblActions->setFooter(new CCol(array($goBox, $goButton)));
    //----
    $form->addItem($tblActions);
    $form->Show();
}
if (isset($row_count)) {
    zbx_add_post_js('insert_in_element("numrows","' . $row_count . '");');
}
include_once "include/page_footer.php";
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:actionconf.php

示例4: foreach

    echo $dstfrm;
    ?>
'];
<!--
<?php 
    foreach ($new_group as $id => $name) {
        echo 'add_var_to_opener_obj(form,"new_group[' . $id . ']","' . $name . '")' . "\r";
    }
    ?>
if(form)
{
	form.submit();
	close_window();
}
-->
</script>
<?php 
}
$form = new CForm();
$form->AddVar('dstfrm', $dstfrm);
$form->SetName('groups');
$table = new CTableInfo(S_NO_GROUPS_DEFINED);
$table->setHeader(array(new CCheckBox("all_groups", NULL, "checkAll('" . $form->getName() . "','all_groups','new_group');"), S_NAME));
$result = DBselect('select * from usrgrp where ' . DBin_node('usrgrpid') . ' order by name');
while ($row = DBfetch($result)) {
    $table->addRow(array(new CCheckBox('new_group[' . $row['usrgrpid'] . ']', isset($new_group[$row['usrgrpid']]), NULL, $row['name']), $row['name']));
}
$table->setFooter(new CButton('select', S_SELECT));
$form->addItem($table);
$form->show();
include_once "include/page_footer.php";
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:popup_usrgrp.php

示例5: add_groups

foreach ($groups as $gnum => $row) {
    $groups[$gnum]['nodename'] = get_node_name_by_elid($row['groupid'], true, ':') . $row['name'];
    if ($nodeid == 0) {
        $groups[$gnum]['name'] = $groups[$gnum]['nodename'];
    }
}
order_result($groups, 'name');
foreach ($groups as $gnum => $row) {
    $grouplist[$count] = array('groupid' => $row['groupid'], 'name' => $row['nodename'], 'permission' => $permission);
    $table->addRow(new CCol(array(new CCheckBox('groups[' . $count . ']', NULL, NULL, $count), $row['name'])));
    $count++;
}
insert_js('var grouplist = ' . zbx_jsvalue($grouplist) . ';');
$button = new CButton('select', S_SELECT, 'add_groups("' . $dstfrm . '")');
$button->setType('button');
$table->setFooter(new CCol($button, 'right'));
$form->addItem($table);
$form->show();
?>
<script language="JavaScript" type="text/javascript">
<!--
function add_groups(formname) {
	var parent_document = window.opener.document;

	if(!parent_document) return close_window();

	$('groups').getInputs("checkbox").each(
		function(box){
			if(box.checked && (box.name != "all_groups")){
				var groupid = grouplist[box.value].groupid;
				add_variable('input', 'new_right['+groupid+'][permission]', grouplist[box.value].permission, formname, parent_document);
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:popup_right.php

示例6: foreach

        if ($host['proxy_hostid']) {
            $proxyHostIds[$host['proxy_hostid']] = $host['proxy_hostid'];
        }
    }
    if ($proxyHostIds) {
        $proxies = API::Proxy()->get(['proxyids' => $proxyHostIds, 'output' => ['proxyid', 'host'], 'preservekeys' => true]);
    }
    $table->setHeader([_('Scheduled check'), _('Delayed by'), _('Host'), _('Name')]);
    $i = 0;
    foreach ($queueData as $itemData) {
        if (!isset($items[$itemData['itemid']])) {
            continue;
        }
        // display only the first 500 items
        $i++;
        if ($i > QUEUE_DETAIL_ITEM_COUNT) {
            break;
        }
        $item = $items[$itemData['itemid']];
        $host = reset($item['hosts']);
        $table->addRow([zbx_date2str(DATE_TIME_FORMAT_SECONDS, $itemData['nextcheck']), zbx_date2age($itemData['nextcheck']), isset($proxies[$hosts[$item['hostid']]['proxy_hostid']]) ? $proxies[$hosts[$item['hostid']]['proxy_hostid']]['host'] . NAME_DELIMITER . $host['name'] : $host['name'], $item['name_expanded']]);
    }
}
// display the table footer
if ($config == QUEUE_OVERVIEW_BY_PROXY) {
    $table->setFooter(new CCol(_('Total') . ': ' . $table->getNumRows()));
} elseif ($config == QUEUE_DETAILS) {
    $table->setFooter(new CCol(_('Total') . ': ' . $table->getNumRows() . (count($queueData) > QUEUE_DETAIL_ITEM_COUNT ? ' (' . _('Truncated') . ')' : '')));
}
$widget->addItem($table)->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:queue.php

示例7: CForm

if (isset($_REQUEST["form"])) {
    insert_map_form();
} else {
    $form = new CForm();
    $form->setName('frm_maps');
    $numrows = new CSpan(null, 'info');
    $numrows->setAttribute('name', 'numrows');
    $header = get_table_header(array(S_MAPS_BIG, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows));
    show_table_header($header);
    $table = new CTableInfo(S_NO_MAPS_DEFINED);
    $table->SetHeader(array(new CCheckBox('all_maps', NULL, "checkAll('" . $form->getName() . "','all_maps','maps');"), make_sorting_link(S_NAME, 'sm.name'), make_sorting_link(S_WIDTH, 'sm.width'), make_sorting_link(S_HEIGHT, 'sm.height'), S_MAP));
    $result = DBselect('SELECT sm.sysmapid,sm.name,sm.width,sm.height ' . ' FROM sysmaps sm' . ' WHERE ' . DBin_node('sm.sysmapid') . order_by('sm.name,sm.width,sm.height', 'sm.sysmapid'));
    while ($row = DBfetch($result)) {
        if (!sysmap_accessible($row["sysmapid"], PERM_READ_WRITE)) {
            continue;
        }
        $table->AddRow(array(new CCheckBox('maps[' . $row['sysmapid'] . ']', NULL, NULL, $row['sysmapid']), new CLink($row["name"], "sysmaps.php?form=update" . "&sysmapid=" . $row["sysmapid"] . "#form", 'action'), $row["width"], $row["height"], new CLink(S_EDIT, "sysmap.php?sysmapid=" . $row["sysmapid"])));
    }
    //----- GO ------
    $goBox = new CComboBox('go');
    $goBox->addItem('delete', S_DELETE_SELECTED);
    // goButton name is necessary!!!
    $goButton = new CButton('goButton', S_GO . ' (0)');
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "maps";');
    $table->setFooter(new CCol(array($goBox, $goButton)));
    $form->addItem($table);
    $form->show();
    zbx_add_post_js('insert_in_element("numrows","' . $table->getNumRows() . '");');
}
include_once "include/page_footer.php";
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:sysmaps.php

示例8: make_ipmistat_summary

function make_ipmistat_summary($preloading = false)
{
    $form_name = 'ipmi_control';
    $table = new CTableInfo();
    $ipmicontrol_form = new CForm();
    $ipmicontrol_form->setName('ipmi_control');
    $ipmicontrol_form->setAttribute('id', 'ipmi_control');
    $ipmicontrol_form->addVar('driver', 'ipmi');
    $script_itemkey = 'push_message.py[{$HYCLOPS_SERVER},{$HYCLOPS_PORT},ipmi,{HOST.HOST}]';
    $table->setHeader(array(is_show_all_nodes() ? S_NODE : null, new CCheckBox('all_physical_hosts', null, "checkAllHosts('" . $ipmicontrol_form->getName() . "', 'all_physical_hosts', '');"), _('Host name'), _('IPMI interface'), _('Status'), _('Problems')));
    $hosts = get_ipmi_hosts();
    if (empty($hosts)) {
        return null;
    }
    foreach ($hosts as $host) {
        $triggers = get_triggers($host['hostid']);
        $trigger_count = count($triggers);
        // get State
        if (!$preloading) {
            if (is_script_success($host['hostid'], $script_itemkey)) {
                $state = strtolower(get_item_value($host['hostid'], "ipmi.state.text"));
            } else {
                $state = _('script failed');
            }
        } else {
            $state = _('loading...');
        }
        // Check box
        $checkbox_col = new CCheckBox("hostids[]", null, null, $host['hostid']);
        if (!is_operation_available("ipmi", $state)) {
            $checkbox_col->attributes['disabled'] = 'disabled';
        }
        // Host name
        if ($trigger_count == 0) {
            $hostname_col = new CCol(new CSpan($host['host']));
        } else {
            $hostname_col = new CLink(new CSpan($host['host']), 'tr_status.php?&hostid=' . $host['hostid'] . '&show_triggers=' . TRIGGERS_OPTION_ONLYTRUE);
        }
        // IPMI Interfaces
        $ipmi_addresses = get_addresses($host['hostid'], INTERFACE_TYPE_IPMI);
        $ipmi_ip_col = new CCol(reset($ipmi_addresses));
        // Status
        $state_col = new CCol($state, get_item_level($state));
        // Problem
        if ($trigger_count == 0) {
            $problem_col = new CCol($trigger_count, 'normal');
        } else {
            $problem_col = new CCol($trigger_count, 'high');
            $problem_col->setHint(make_trigger_table($triggers, $hostname_col));
        }
        $r = new CRow();
        $r->addItem($checkbox_col);
        $r->addItem($hostname_col);
        $r->addItem($ipmi_ip_col);
        $r->addItem($state_col);
        $r->addItem($problem_col);
        $table->addRow($r);
    }
    $table->setFooter(new CCol(make_operation_box_footer(zbx_objectValues($hosts, 'hostid'), $form_name)));
    $ipmicontrol_form->addItem($table);
    $script = new CJSScript(get_js("jQuery('#hat_ipmistat_footer').html('" . _s('Updated: %s', zbx_date2str(_('H:i:s'))) . "')"));
    return new CDiv(array($ipmicontrol_form, $script));
}
开发者ID:sogaoh,项目名称:hyclops,代码行数:63,代码来源:additional_blocks.inc.php

示例9: CCol

             }
         }
         $table->ShowRow(array(new CCol($host['host'], 'top'), $el_table));
         unset($el_table);
     }
     $form = new CForm(null, 'post');
     $form->setName('hosts');
     $form->addVar("config", $config);
     $form->addVar('update', true);
     $form->addVar('hosts', $hosts);
     $form->addVar('templates', $templates);
     $form->addVar('items', $items);
     $form->addVar('graphs', $graphs);
     $form->addVar('triggers', $triggers);
     $form->addItem(array(new CButton('back', S_BACK), new CButton('preview', S_REFRESH), new CButton('export', S_EXPORT)));
     $table->setFooter(new CCol($form));
     $table->showEnd();
 } else {
     /* table HOSTS */
     $form = new CForm(null, 'post');
     $form->SetName('hosts');
     $form->AddVar('config', $config);
     $form->AddVar('update', true);
     $cmbGroups = new CComboBox('groupid', $PAGE_GROUPS['selected'], 'javascript: submit();');
     foreach ($PAGE_GROUPS['groups'] as $groupid => $name) {
         $cmbGroups->addItem($groupid, get_node_name_by_elid($groupid) . $name);
     }
     $header = get_table_header(S_HOSTS_BIG, array(S_GROUP . SPACE, $cmbGroups));
     $form->addItem($header);
     $table = new CTableInfo(S_NO_HOSTS_DEFINED);
     $table->setHeader(array(array(new CCheckBox("all_hosts", true, "CheckAll('" . $form->GetName() . "','all_hosts','hosts');"), make_sorting_link(S_NAME, 'h.host')), make_sorting_link(S_DNS, 'h.dns'), make_sorting_link(S_IP, 'h.ip'), make_sorting_link(S_PORT, 'h.port'), make_sorting_link(S_STATUS, 'h.status'), array(new CCheckBox("all_templates", true, "CheckAll('" . $form->GetName() . "','all_templates','templates');"), S_TEMPLATES), array(new CCheckBox("all_items", true, "CheckAll('" . $form->GetName() . "','all_items','items');"), S_ITEMS), array(new CCheckBox("all_triggers", true, "CheckAll('" . $form->GetName() . "','all_triggers','triggers');"), S_TRIGGERS), array(new CCheckBox("all_graphs", true, "CheckAll('" . $form->GetName() . "','all_graphs','graphs');"), S_GRAPHS)));
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:exp_imp.php

示例10: foreach

     $col->SetColSpan(6);
     $table->addRow(array(get_node_name_by_elid($db_app['applicationid']), $_REQUEST['hostid'] > 0 ? NULL : $db_app['host'], $col));
     $any_app_exist = true;
     foreach ($app_rows as $row) {
         $table->addRow($row);
     }
 }
 $footerButtons = array();
 array_push($footerButtons, new CButtonQMessage('group_task', S_ACTIVATE_SELECTED, S_ACTIVATE_SELECTED_SCENARIOS_Q));
 array_push($footerButtons, SPACE);
 array_push($footerButtons, new CButtonQMessage('group_task', S_DISABLE_SELECTED, S_DISABLE_SELECTED_SCENARIOS_Q));
 array_push($footerButtons, SPACE);
 array_push($footerButtons, new CButtonQMessage('group_task', S_CLEAN_HISTORY_SELECTED_SCENARIOS, S_HISTORY_CLEANING_CAN_TAKE_A_LONG_TIME_CONTINUE_Q));
 array_push($footerButtons, SPACE);
 array_push($footerButtons, new CButtonQMessage('group_task', S_DELETE_SELECTED, S_DELETE_SELECTED_SCENARIOS_Q));
 $table->setFooter(new CCol($footerButtons));
 $form->addItem($table);
 $form->Show();
 /* TABLE
 		$form = new CForm();
 		$form->setName('scenarios');
 		$form->addVar('hostid',$_REQUEST['hostid']);
 
 		if(isset($show_all_apps))
 			$link = new CLink(new CImg('images/general/opened.gif'),'?close=1'.url_param('groupid').url_param('hostid'));
 		else
 			$link = new CLink(new CImg('images/general/closed.gif'),'?open=1'.url_param('groupid').url_param('hostid'));
 
 		$table  = new CTableInfo();
 		$table->setHeader(array(
 			array(	$link, SPACE, new CCheckBox('all_httptests',null,
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:httpconf.php

示例11: make_discovery_status

function make_discovery_status()
{
    $options = array('filter' => array('status' => DHOST_STATUS_ACTIVE), 'selectDHosts' => API_OUTPUT_EXTEND, 'output' => API_OUTPUT_EXTEND);
    $drules = CDRule::get($options);
    order_result($drules, 'name');
    foreach ($drules as $drnum => $drule) {
        $drules[$drnum]['up'] = 0;
        $drules[$drnum]['down'] = 0;
        foreach ($drule['dhosts'] as $dhnum => $dhost) {
            if (DRULE_STATUS_DISABLED == $dhost['status']) {
                $drules[$drnum]['down']++;
            } else {
                $drules[$drnum]['up']++;
            }
        }
    }
    $header = array(is_show_all_nodes() ? new CCol(S_NODE, 'center') : null, new CCol(S_DISCOVERY_RULE, 'center'), new CCol(S_UP), new CCol(S_DOWN));
    $table = new CTableInfo();
    $table->setHeader($header, 'header');
    foreach ($drules as $drnum => $drule) {
        $table->addRow(array(get_node_name_by_elid($drule['druleid']), new CLink(get_node_name_by_elid($drule['druleid'], null, ': ') . $drule['name'], 'discovery.php?druleid=' . $drule['druleid']), new CSpan($drule['up'], 'green'), new CSpan($drule['down'], $drule['down'] > 0 ? 'red' : 'green')));
    }
    $table->setFooter(new CCol(S_UPDATED . ': ' . zbx_date2str(S_BLOCKS_DISCOVERY_STATUS_TIME_FORMAT)));
    return $table;
}
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:25,代码来源:blocks.inc.php

示例12: CSpan

    $numrows = new CSpan(null, 'info');
    $numrows->addOption('name', 'numrows');
    $header = get_table_header(array(S_SCRIPTS, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows));
    show_table_header($header);
    $table = new CTableInfo(S_NO_SCRIPTS_DEFINED);
    $table->setHeader(array(array(new CCheckBox('all_scripts', null, "CheckAll('" . $form->GetName() . "','all_scripts');"), make_sorting_link(S_NAME, 's.name')), make_sorting_link(S_COMMAND, 's.command'), S_USER_GROUP, S_HOST_GROUP, S_HOST_ACCESS));
    $sql = 'SELECT s.* ' . ' FROM scripts s ' . ' WHERE ' . DBin_node('s.scriptid') . order_by('s.name,s.command');
    $scripts = DBselect($sql);
    while ($script = DBfetch($scripts)) {
        $user_group_name = S_ALL_S;
        if ($script['usrgrpid'] > 0) {
            $user_group = get_group_by_usrgrpid($script['usrgrpid']);
            $user_group_name = $user_group['name'];
        }
        $host_group_name = S_ALL_S;
        if ($script['groupid'] > 0) {
            $group = get_hostgroup_by_groupid($script['groupid']);
            $host_group_name = $group['name'];
        }
        $table->addRow(array(array(new CCheckBox('scripts[' . $script['scriptid'] . ']', 'no', NULL, $script['scriptid']), new CLink($script['name'], 'scripts.php?form=1' . '&scriptid=' . $script['scriptid'] . '#form', 'action')), htmlspecialchars($script['command']), $user_group_name, $host_group_name, PERM_READ_WRITE == $script['host_access'] ? S_WRITE : S_READ));
        $row_count++;
    }
    $qbutton = new CButtonQMessage('delete', S_DELETE_SELECTED, S_DELETE_SELECTED_SCRIPTS_Q);
    //$qbutton->setAction('javascript:document.getElementById("scripts").action += "?action=1";');
    $tr = new CCol(array($qbutton));
    $table->setFooter($tr);
    $form->addItem($table);
    $form->show();
    zbx_add_post_js('insert_in_element("numrows","' . $row_count . '");');
}
include_once 'include/page_footer.php';
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:scripts.php

示例13: get_expression_form

function get_expression_form()
{
    $tblExp = new CTable();
    /* init new_timeperiod variable */
    $new_expression = get_request('new_expression', array());
    if (is_array($new_expression) && isset($new_expression['id'])) {
        $tblExp->addItem(new Cvar('new_expression[id]', $new_expression['id']));
    }
    if (!is_array($new_expression)) {
        $new_expression = array();
    }
    if (isset($new_expression['expressionid'])) {
        $tblExp->addItem(new CVar('new_expression[expressionid]', $new_expression['expressionid']));
    }
    if (!isset($new_expression['expression'])) {
        $new_expression['expression'] = '';
    }
    if (!isset($new_expression['expression_type'])) {
        $new_expression['expression_type'] = EXPRESSION_TYPE_INCLUDED;
    }
    if (!isset($new_expression['case_sensitive'])) {
        $new_expression['case_sensitive'] = 0;
    }
    if (!isset($new_expression['exp_delimiter'])) {
        $new_expression['exp_delimiter'] = ',';
    }
    $tblExp->addRow(array(_('Expression'), new CTextBox('new_expression[expression]', $new_expression['expression'], 60)));
    $cmbType = new CComboBox('new_expression[expression_type]', $new_expression['expression_type'], 'javascript: submit();');
    $cmbType->addItem(EXPRESSION_TYPE_INCLUDED, expression_type2str(EXPRESSION_TYPE_INCLUDED));
    $cmbType->addItem(EXPRESSION_TYPE_ANY_INCLUDED, expression_type2str(EXPRESSION_TYPE_ANY_INCLUDED));
    $cmbType->addItem(EXPRESSION_TYPE_NOT_INCLUDED, expression_type2str(EXPRESSION_TYPE_NOT_INCLUDED));
    $cmbType->addItem(EXPRESSION_TYPE_TRUE, expression_type2str(EXPRESSION_TYPE_TRUE));
    $cmbType->addItem(EXPRESSION_TYPE_FALSE, expression_type2str(EXPRESSION_TYPE_FALSE));
    $tblExp->addRow(array(_('Expression type'), $cmbType));
    if (EXPRESSION_TYPE_ANY_INCLUDED == $new_expression['expression_type']) {
        $cmbDelimiter = new CComboBox('new_expression[exp_delimiter]', $new_expression['exp_delimiter']);
        $cmbDelimiter->addItem(',', ',');
        $cmbDelimiter->addItem('.', '.');
        $cmbDelimiter->addItem('/', '/');
        $tblExp->addRow(array(_('Delimiter'), $cmbDelimiter));
    } else {
        $tblExp->addItem(new Cvar('new_expression[exp_delimiter]', $new_expression['exp_delimiter']));
    }
    $chkbCase = new CCheckBox('new_expression[case_sensitive]', $new_expression['case_sensitive'], null, 1);
    $tblExp->addRow(array(_('Case sensitive'), $chkbCase));
    $tblExpFooter = new CTableInfo($tblExp);
    $oper_buttons = array();
    $oper_buttons[] = new CSubmit('add_expression', isset($new_expression['id']) ? _('Save') : _('Add'));
    $oper_buttons[] = new CSubmit('cancel_new_expression', _('Cancel'));
    $td = new CCol($oper_buttons);
    $td->setAttribute('colspan', 2);
    $td->setAttribute('style', 'text-align: right;');
    $tblExpFooter->setFooter($td);
    return $tblExpFooter;
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:55,代码来源:forms.inc.php

示例14: DBselect

                        $db_exps = DBselect($sql);
                        while ($exp = DBfetch($db_exps)) {
                            if (!isset($expressions[$exp['regexpid']])) {
                                $count[$exp['regexpid']] = 1;
                            } else {
                                $count[$exp['regexpid']]++;
                            }
                            if (!isset($expressions[$exp['regexpid']])) {
                                $expressions[$exp['regexpid']] = new CTable();
                            }
                            $expressions[$exp['regexpid']]->addRow(array($count[$exp['regexpid']], ' &raquo; ', $exp['expression'], ' [' . expression_type2str($exp['expression_type']) . ']'));
                            $regexp[$exp['regexpid']]['expressions'][$exp['expressionid']] = $exp;
                        }
                        $form = new CForm(null, 'post');
                        $form->setName('regexp');
                        $table = new CTableInfo();
                        $table->setHeader(array(new CCheckBox('all_regexps', NULL, "checkAll('" . $form->GetName() . "','all_regexps','regexpids');"), S_NAME, S_EXPRESSIONS));
                        foreach ($regexps as $regexpid => $regexp) {
                            $table->addRow(array(new CCheckBox('regexpids[' . $regexp['regexpid'] . ']', NULL, NULL, $regexp['regexpid']), new CLink($regexp['name'], 'config.php?form=update' . url_param('config') . '&regexpid=' . $regexp['regexpid'] . '#form'), isset($expressions[$regexpid]) ? $expressions[$regexpid] : '-'));
                        }
                        //			$table->SetFooter(new CCol(new CButtonQMessage('delete_selected',S_DELETE_SELECTED,S_DELETE_SELECTED_USERS_Q)));
                        $table->setFooter(new CCol(array(new CButtonQMessage('delete', S_DELETE_SELECTED, S_DELETE_SELECTED_REGULAR_EXPRESSIONS_Q))));
                        $form->AddItem($table);
                        $form->show();
                    }
                }
            }
        }
    }
}
include_once 'include/page_footer.php';
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:config.php

示例15: DBselect

                            $db_maintenances = DBselect($sql);
                            while ($maintenance = DBfetch($db_maintenances)) {
                                $maintenances[$maintenance['maintenanceid']] = $maintenance;
                                $maintenanceids[$maintenance['maintenanceid']] = $maintenance['maintenanceid'];
                            }
                            $form = new CForm(null, 'post');
                            $form->setName('maintenances');
                            $table = new CTableInfo();
                            $table->setHeader(array(array(new CCheckBox('all_maintenances', NULL, "CheckAll('" . $form->GetName() . "','all_maintenances','group_maintenanceid');"), make_sorting_link(S_NAME, 'm.name')), S_TYPE, S_STATUS, S_DESCRIPTION));
                            foreach ($maintenances as $maintenanceid => $maintenance) {
                                if ($maintenance['active_till'] < time()) {
                                    $mnt_status = new CSpan(S_EXPIRED, 'red');
                                } else {
                                    $mnt_status = new CSpan(S_ACTIVE, 'green');
                                }
                                $table->addRow(array(array(new CCheckBox('maintenanceids[' . $maintenance['maintenanceid'] . ']', NULL, NULL, $maintenance['maintenanceid']), new CLink($maintenance['name'], 'hosts.php?form=update' . url_param('config') . '&maintenanceid=' . $maintenance['maintenanceid'] . '#form', 'action')), $maintenance['maintenance_type'] ? S_NO_DATA_PROCESSING : S_NORMAL_PROCESSING, $mnt_status, $maintenance['description']));
                                $row_count++;
                            }
                            //			$table->setFooter(new CCol(new CButtonQMessage('delete_selected',S_DELETE_SELECTED,S_DELETE_SELECTED_USERS_Q)));
                            $table->setFooter(new CCol(array(new CButtonQMessage('delete', S_DELETE_SELECTED, S_DELETE_SELECTED_GROUPS_Q))));
                            $form->addItem($table);
                            $form->show();
                        }
                    }
                }
            }
        }
    }
}
zbx_add_post_js('insert_in_element("numrows","' . $row_count . '");');
include_once 'include/page_footer.php';
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:hosts.php


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