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


PHP CFormTable::setTableClass方法代码示例

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


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

示例1: array

$fields['test_expression'] = array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null);
if (!check_fields($fields)) {
    $test = false;
}
//------------------------ <ACTIONS> ---------------------------
if (isset($_REQUEST['test_expression'])) {
    show_messages();
    $test = true;
} else {
    $test = false;
}
//------------------------ </ACTIONS> --------------------------
//------------------------ <FORM> ---------------------------
$frm_test = new CFormTable(_('Test'), 'tr_testexpr.php');
$frm_test->setHelp('web.testexpr.service.php');
$frm_test->setTableClass('formlongtable formtable');
$frm_test->addVar('form_refresh', get_request('form_refresh', 1));
$frm_test->addVar('expression', $expression);
/* test data */
$frm_test->addRow(_('Test data'), $data_table);
/* result */
$res_table = new CTable(null, 'tableinfo');
$res_table->setAttribute('id', 'result_list');
$res_table->setOddRowClass('even_row');
$res_table->setEvenRowClass('even_row');
$res_table->setHeader(array(_('Expression'), _('Result')));
ksort($rplcts, SORT_NUMERIC);
foreach ($eHTMLTree as $e) {
    $result = '-';
    if ($allowedTesting && $test && isset($e['expression'])) {
        $result = evalExpressionData($e['expression']['value'], $macrosData, $octet);
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:tr_testexpr.php

示例2: dirname

**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
require_once dirname(__FILE__) . '/js/common.filter.trigger.js.php';
$overview = $this->data['overview'];
$filter = $this->data['filter'];
$config = select_config();
$filterForm = new CFormTable(null, null, 'get');
$filterForm->setTableClass('formtable old-filter');
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$filterForm->addVar('fullscreen', $filter['fullScreen']);
$filterForm->addVar('groupid', $filter['groupId']);
$filterForm->addVar('hostid', $filter['hostId']);
// trigger status
$filterForm->addRow(_('Triggers status'), new CComboBox('show_triggers', $filter['showTriggers'], null, array(TRIGGERS_OPTION_ALL => _('Any'), TRIGGERS_OPTION_RECENT_PROBLEM => _('Recent problem'), TRIGGERS_OPTION_IN_PROBLEM => _('Problem'))));
// ack status
if ($config['event_ack_enable']) {
    $filterForm->addRow(_('Acknowledge status'), new CComboBox('ack_status', $filter['ackStatus'], null, array(ZBX_ACK_STS_ANY => _('Any'), ZBX_ACK_STS_WITH_UNACK => _('With unacknowledged events'), ZBX_ACK_STS_WITH_LAST_UNACK => _('With last event unacknowledged'))));
}
// events
if (!$overview) {
    $eventsComboBox = new CComboBox('show_events', $filter['showEvents'], null, array(EVENTS_OPTION_NOEVENT => _('Hide all'), EVENTS_OPTION_ALL => _n('Show all (%1$s day)', 'Show all (%1$s days)', $config['event_expire'])));
    if ($config['event_ack_enable']) {
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:common.filter.trigger.php

示例3: unset

            show_messages($result, _('Trigger added'), _('Cannot add trigger'));
        }
        if ($result) {
            add_audit($audit_action, AUDIT_RESOURCE_TRIGGER, _('Trigger') . ' [' . $triggerid . '] [' . $trigger['description'] . ']');
            unset($_REQUEST['sform']);
            zbx_add_post_js('closeForm("items.php");');
            require_once dirname(__FILE__) . '/include/page_footer.php';
        }
    }
}
//------------------------ </ACTIONS> --------------------------
//------------------------ <FORM> ---------------------------
if (isset($_REQUEST['sform'])) {
    $frmTRLog = new CFormTable(_('Trigger'), 'tr_logform.php', 'POST', null, 'sform');
    $frmTRLog->setHelp('web.triggerlog.service.php');
    $frmTRLog->setTableClass('formlongtable formtable');
    $frmTRLog->addVar('form_refresh', get_request('form_refresh', 1));
    if (isset($_REQUEST['triggerid'])) {
        $frmTRLog->addVar('triggerid', $_REQUEST['triggerid']);
    }
    if (isset($_REQUEST['triggerid']) && !isset($_REQUEST['form_refresh'])) {
        $frmTRLog->addVar('form_refresh', get_request('form_refresh', 1));
        $sql = 'SELECT DISTINCT f.functionid, f.function, f.parameter, t.expression, ' . ' t.description, t.priority, t.comments, t.url, t.status, t.type' . ' FROM functions f, triggers t, items i ' . ' WHERE t.triggerid=' . zbx_dbstr($_REQUEST['triggerid']) . ' AND i.itemid=f.itemid ' . ' AND f.triggerid = t.triggerid ' . ' AND i.value_type IN (' . ITEM_VALUE_TYPE_LOG . ' , ' . ITEM_VALUE_TYPE_TEXT . ', ' . ITEM_VALUE_TYPE_STR . ')';
        $res = DBselect($sql);
        while ($rows = DBfetch($res)) {
            $description = $rows['description'];
            $expression = $rows['expression'];
            $type = $rows['type'];
            $priority = $rows['priority'];
            $comments = $rows['comments'];
            $url = $rows['url'];
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:tr_logform.php

示例4: array

// checks
$fields['test_expression'] = array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null);
if (!check_fields($fields)) {
    $test = false;
}
// actions
if (isset($_REQUEST['test_expression'])) {
    show_messages();
    $test = true;
} else {
    $test = false;
}
// form
$testForm = new CFormTable(_('Test'), 'tr_testexpr.php');
$testForm->addHelpIcon();
$testForm->setTableClass('formlongtable formtable');
$testForm->addVar('expression', $expression);
$testForm->addRow(_('Test data'), $dataTable);
$resultTable = new CTable(null, 'tableinfo');
$resultTable->setAttribute('id', 'result_list');
$resultTable->setOddRowClass('even_row');
$resultTable->setEvenRowClass('even_row');
$resultTable->setHeader(array(_('Expression'), _('Result')));
ksort($rplcts, SORT_NUMERIC);
foreach ($eHTMLTree as $e) {
    $result = '-';
    $style = 'text-align: center;';
    if ($allowedTesting && $test && isset($e['expression'])) {
        if (evalExpressionData($e['expression']['value'], $macrosData)) {
            $result = 'TRUE';
            $style = 'background-color: #ccf; color: #00f;';
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:tr_testexpr.php

示例5: valueComparisonFormForMultiplePeriods

/**
 * Create report bar for for "Compare values for multiple periods"
 *
 * @return object $reportForm
 */
function valueComparisonFormForMultiplePeriods()
{
    $config = getRequest('config', BR_DISTRIBUTION_MULTIPLE_PERIODS);
    $title = getRequest('title', _('Report 3'));
    $xlabel = getRequest('xlabel', '');
    $ylabel = getRequest('ylabel', '');
    $scaletype = getRequest('scaletype', TIMEPERIOD_TYPE_WEEKLY);
    $avgperiod = getRequest('avgperiod', TIMEPERIOD_TYPE_DAILY);
    $report_timesince = getRequest('report_timesince', date(TIMESTAMP_FORMAT_ZERO_TIME, time() - SEC_PER_DAY));
    $report_timetill = getRequest('report_timetill', date(TIMESTAMP_FORMAT_ZERO_TIME));
    $itemId = getRequest('itemid', 0);
    $hostids = getRequest('hostids', array());
    $hostids = zbx_toHash($hostids);
    $showlegend = getRequest('showlegend', 0);
    $palette = getRequest('palette', 0);
    $palettetype = getRequest('palettetype', 0);
    $reportForm = new CFormTable(null, null, 'get');
    $reportForm->setTableClass('formtable old-filter');
    $reportForm->setAttribute('name', 'zbx_report');
    $reportForm->setAttribute('id', 'zbx_report');
    if (isset($_REQUEST['report_show']) && $itemId) {
        $reportForm->addVar('report_show', 'show');
    }
    $reportForm->addVar('config', $config);
    $reportForm->addVar('report_timesince', date(TIMESTAMP_FORMAT, $report_timesince));
    $reportForm->addVar('report_timetill', date(TIMESTAMP_FORMAT, $report_timetill));
    $reportForm->addRow(_('Title'), new CTextBox('title', $title, 40));
    $reportForm->addRow(_('X label'), new CTextBox('xlabel', $xlabel, 40));
    $reportForm->addRow(_('Y label'), new CTextBox('ylabel', $ylabel, 40));
    $reportForm->addRow(_('Legend'), new CCheckBox('showlegend', $showlegend, null, 1));
    $reportForm->addVar('sortorder', 0);
    $groupids = getRequest('groupids', array());
    $group_tb = new CTweenBox($reportForm, 'groupids', $groupids, 10);
    $db_groups = API::HostGroup()->get(array('real_hosts' => true, 'output' => array('groupid', 'name')));
    order_result($db_groups, 'name');
    foreach ($db_groups as $group) {
        $groupids[$group['groupid']] = $group['groupid'];
        $group_tb->addItem($group['groupid'], $group['name']);
    }
    $reportForm->addRow(_('Groups'), $group_tb->Get(_('Selected groups'), _('Other groups')));
    $groupid = getRequest('groupid', 0);
    $cmbGroups = new CComboBox('groupid', $groupid, 'submit()');
    $cmbGroups->addItem(0, _('All'));
    foreach ($db_groups as $group) {
        $cmbGroups->addItem($group['groupid'], $group['name']);
    }
    $td_groups = new CCol(array(_('Group'), SPACE, $cmbGroups));
    $td_groups->setAttribute('style', 'text-align: right;');
    $host_tb = new CTweenBox($reportForm, 'hostids', $hostids, 10);
    $options = array('real_hosts' => true, 'output' => array('hostid', 'name'));
    if ($groupid > 0) {
        $options['groupids'] = $groupid;
    }
    $db_hosts = API::Host()->get($options);
    $db_hosts = zbx_toHash($db_hosts, 'hostid');
    order_result($db_hosts, 'name');
    foreach ($db_hosts as $hnum => $host) {
        $host_tb->addItem($host['hostid'], $host['name']);
    }
    $options = array('real_hosts' => true, 'output' => array('hostid', 'name'), 'hostids' => $hostids);
    $db_hosts2 = API::Host()->get($options);
    order_result($db_hosts2, 'name');
    foreach ($db_hosts2 as $hnum => $host) {
        if (!isset($db_hosts[$host['hostid']])) {
            $host_tb->addItem($host['hostid'], $host['name']);
        }
    }
    $reportForm->addRow(_('Hosts'), $host_tb->Get(_('Selected hosts'), array(_('Other hosts | Group') . SPACE, $cmbGroups)));
    $reporttimetab = new CTable(null, 'calendar');
    $timeSinceRow = createDateSelector('report_timesince', $report_timesince, 'report_timetill');
    array_unshift($timeSinceRow, _('From'));
    $reporttimetab->addRow($timeSinceRow);
    $timeTillRow = createDateSelector('report_timetill', $report_timetill, 'report_timesince');
    array_unshift($timeTillRow, _('Till'));
    $reporttimetab->addRow($timeTillRow);
    $reportForm->addRow(_('Period'), $reporttimetab);
    $scale = new CComboBox('scaletype', $scaletype);
    $scale->addItem(TIMEPERIOD_TYPE_HOURLY, _('Hourly'));
    $scale->addItem(TIMEPERIOD_TYPE_DAILY, _('Daily'));
    $scale->addItem(TIMEPERIOD_TYPE_WEEKLY, _('Weekly'));
    $scale->addItem(TIMEPERIOD_TYPE_MONTHLY, _('Monthly'));
    $scale->addItem(TIMEPERIOD_TYPE_YEARLY, _('Yearly'));
    $reportForm->addRow(_('Scale'), $scale);
    $avgcmb = new CComboBox('avgperiod', $avgperiod);
    $avgcmb->addItem(TIMEPERIOD_TYPE_HOURLY, _('Hourly'));
    $avgcmb->addItem(TIMEPERIOD_TYPE_DAILY, _('Daily'));
    $avgcmb->addItem(TIMEPERIOD_TYPE_WEEKLY, _('Weekly'));
    $avgcmb->addItem(TIMEPERIOD_TYPE_MONTHLY, _('Monthly'));
    $avgcmb->addItem(TIMEPERIOD_TYPE_YEARLY, _('Yearly'));
    $reportForm->addRow(_('Average by'), $avgcmb);
    $itemName = '';
    if ($itemId) {
        $items = CMacrosResolverHelper::resolveItemNames(array(get_item_by_itemid($itemId)));
        $item = reset($items);
        $itemName = $item['name_expanded'];
//.........这里部分代码省略.........
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:101,代码来源:reports.inc.php


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