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


PHP CFormTable::SetMethod方法代码示例

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


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

示例1: CScript

$script = new CScript("javascript: if(CLNDR['nav_time'].clndr.setSDateFromOuterObj()){" . "this.action += '?nav_time='+parseInt(CLNDR['nav_time'].clndr.sdt.getTime()/1000);}");
$navForm->AddAction('onsubmit', $script);
$clndr_icon = new CImg('images/general/bar/cal.gif', 'calendar', 16, 12, 'pointer');
$clndr_icon->AddAction('onclick', "javascript: var pos = getPosition(this); pos.top+=14; pos.left-=174; CLNDR['nav_time'].clndr.clndrshow(pos.top,pos.left);");
$clndr_icon->AddOption('style', 'vertical-align: bottom;');
$nav_clndr = array(new CNumericBox('nav_day', $_REQUEST['nav_time'] > 0 ? date('d', $_REQUEST['nav_time']) : '', 2), new CNumericBox('nav_month', $_REQUEST['nav_time'] > 0 ? date('m', $_REQUEST['nav_time']) : '', 2), new CNumericBox('nav_year', $_REQUEST['nav_time'] > 0 ? date('Y', $_REQUEST['nav_time']) : '', 4), $clndr_icon);
zbx_add_post_js('create_calendar(null,["nav_day","nav_month","nav_year"],"nav_time");');
zbx_add_post_js('addListener($("hat_events_icon"),' . '"click",' . 'CLNDR["nav_time"].clndr.clndrhide.bindAsEventListener(CLNDR["nav_time"].clndr));');
$navForm->AddItem(array($back, SPACE, $next, new CSpan(' | ', 'divider'), $nav_clndr, SPACE, new CButton('load', S_SHOW . ' »')));
$navigation = $navForm;
//------------
$filterForm = new CFormTable(S_FILTER);
//,'events.php?filter_set=1','POST',null,'sform');
$filterForm->AddOption('name', 'zbx_filter');
$filterForm->AddOption('id', 'zbx_filter');
$filterForm->SetMethod('get');
$filterForm->AddVar('nav_time', $_REQUEST['nav_time']);
if (EVENT_SOURCE_TRIGGERS == $source) {
    $script = new CScript("javascript: if(CLNDR['events_since'].clndr.setSDateFromOuterObj()){" . "\$('filter_timesince').value = parseInt(CLNDR['events_since'].clndr.sdt.getTime()/1000);}" . "if(CLNDR['events_till'].clndr.setSDateFromOuterObj()){" . "\$('filter_timetill').value = parseInt(CLNDR['events_till'].clndr.sdt.getTime()/1000);}");
    $filterForm->AddAction('onsubmit', $script);
    $filterForm->AddVar('triggerid', $_REQUEST['triggerid']);
    if (isset($_REQUEST['triggerid']) && $_REQUEST['triggerid'] > 0) {
        $trigger = expand_trigger_description($_REQUEST['triggerid']);
    } else {
        $trigger = "";
    }
    $row = new CRow(array(new CCol(S_TRIGGER, 'form_row_l'), new CCol(array(new CTextBox("trigger", $trigger, 96, 'yes'), new CButton("btn1", S_SELECT, "return PopUp('popup.php?" . "dstfrm=" . $filterForm->GetName() . "&dstfld1=triggerid&dstfld2=trigger" . "&srctbl=triggers&srcfld1=triggerid&srcfld2=description&real_hosts=1');", 'T')), 'form_row_r')));
    $filterForm->AddRow($row);
    $filterForm->AddVar('show_unknown', $show_unknown);
    $unkcbx = new CCheckBox('show_unk', $show_unknown, null, '1');
    $unkcbx->SetAction('javascript: create_var("' . $filterForm->GetName() . '", "show_unknown", (this.checked?1:0), 0); ');
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:events.php

示例2: insert_graph_form

function insert_graph_form()
{
    $frmGraph = new CFormTable(S_GRAPH, null, 'post');
    $frmGraph->SetName('frm_graph');
    $frmGraph->SetHelp("web.graphs.graph.php");
    $frmGraph->SetMethod('post');
    $items = get_request('items', array());
    if (isset($_REQUEST['graphid'])) {
        $frmGraph->addVar('graphid', $_REQUEST['graphid']);
        $result = DBselect('SELECT * FROM graphs WHERE graphid=' . $_REQUEST['graphid']);
        $row = DBfetch($result);
        $frmGraph->SetTitle(S_GRAPH . ' "' . $row['name'] . '"');
    }
    if (isset($_REQUEST['graphid']) && !isset($_REQUEST['form_refresh'])) {
        $name = $row['name'];
        $width = $row['width'];
        $height = $row['height'];
        $ymin_type = $row["ymin_type"];
        $ymax_type = $row["ymax_type"];
        $yaxismin = $row['yaxismin'];
        $yaxismax = $row['yaxismax'];
        $ymin_itemid = $row["ymin_itemid"];
        $ymax_itemid = $row["ymax_itemid"];
        $showworkperiod = $row['show_work_period'];
        $showtriggers = $row['show_triggers'];
        $graphtype = $row['graphtype'];
        $legend = $row['show_legend'];
        $graph3d = $row['show_3d'];
        $percent_left = $row['percent_left'];
        $percent_right = $row['percent_right'];
        $db_items = DBselect('SELECT * FROM graphs_items WHERE graphid=' . $_REQUEST['graphid']);
        while ($item = DBfetch($db_items)) {
            array_push($items, array('itemid' => $item['itemid'], 'drawtype' => $item['drawtype'], 'sortorder' => $item['sortorder'], 'color' => $item['color'], 'yaxisside' => $item['yaxisside'], 'calc_fnc' => $item['calc_fnc'], 'type' => $item['type'], 'periods_cnt' => $item['periods_cnt']));
        }
    } else {
        $name = get_request('name', '');
        $graphtype = get_request('graphtype', GRAPH_TYPE_NORMAL);
        if ($graphtype == GRAPH_TYPE_PIE || $graphtype == GRAPH_TYPE_EXPLODED) {
            $width = get_request('width', 400);
            $height = get_request('height', 300);
        } else {
            $width = get_request('width', 900);
            $height = get_request('height', 200);
        }
        $ymin_type = get_request("ymin_type", GRAPH_YAXIS_TYPE_CALCULATED);
        $ymax_type = get_request("ymax_type", GRAPH_YAXIS_TYPE_CALCULATED);
        $yaxismin = get_request("yaxismin", 0.0);
        $yaxismax = get_request("yaxismax", 100.0);
        $ymin_itemid = get_request("ymin_itemid", 0);
        $ymax_itemid = get_request("ymax_itemid", 0);
        $showworkperiod = get_request('showworkperiod', 0);
        $showtriggers = get_request('showtriggers', 0);
        $legend = get_request('legend', 0);
        $graph3d = get_request('graph3d', 0);
        $visible = get_request('visible');
        $percent_left = 0;
        $percent_right = 0;
        if (isset($visible['percent_left'])) {
            $percent_left = get_request('percent_left', 0);
        }
        if (isset($visible['percent_right'])) {
            $percent_right = get_request('percent_right', 0);
        }
    }
    /* reinit $_REQUEST */
    $_REQUEST['items'] = $items;
    $_REQUEST['name'] = $name;
    $_REQUEST['width'] = $width;
    $_REQUEST['height'] = $height;
    $_REQUEST['ymin_type'] = $ymin_type;
    $_REQUEST['ymax_type'] = $ymax_type;
    $_REQUEST['yaxismin'] = $yaxismin;
    $_REQUEST['yaxismax'] = $yaxismax;
    $_REQUEST['ymin_itemid'] = $ymin_itemid;
    $_REQUEST['ymax_itemid'] = $ymax_itemid;
    $_REQUEST['showworkperiod'] = $showworkperiod;
    $_REQUEST['showtriggers'] = $showtriggers;
    $_REQUEST['graphtype'] = $graphtype;
    $_REQUEST['legend'] = $legend;
    $_REQUEST['graph3d'] = $graph3d;
    $_REQUEST['percent_left'] = $percent_left;
    $_REQUEST['percent_right'] = $percent_right;
    /********************/
    if ($graphtype != GRAPH_TYPE_NORMAL) {
        foreach ($items as $gid => $gitem) {
            if ($gitem['type'] != GRAPH_ITEM_AGGREGATED) {
                continue;
            }
            unset($items[$gid]);
        }
    }
    asort_by_key($items, 'sortorder');
    $group_gid = get_request('group_gid', array());
    $frmGraph->addVar('ymin_itemid', $ymin_itemid);
    $frmGraph->addVar('ymax_itemid', $ymax_itemid);
    $frmGraph->addRow(S_NAME, new CTextBox('name', $name, 32));
    $g_width = new CNumericBox('width', $width, 5);
    $g_width->addoption('onblur', 'javascript: submit();');
    $frmGraph->addRow(S_WIDTH, $g_width);
    $g_height = new CNumericBox('height', $height, 5);
//.........这里部分代码省略.........
开发者ID:rennhak,项目名称:zabbix,代码行数:101,代码来源:forms.inc.php

示例3: CDiv

$fs_icon = new CDiv(SPACE, 'fullscreen');
$fs_icon->addOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
$fs_icon->addAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
$mute_icon = new CDiv(SPACE, $mute ? 'iconmute' : 'iconsound');
$mute_icon->addOption('title', S_SOUND . ' ' . S_ON . '/' . S_OFF);
$mute_icon->addAction('onclick', new CScript("javascript: switch_mute(this);"));
$tr_numrows = new CSpan(null, 'info');
$tr_numrows->addOption('name', 'tr_numrows');
$p_elements[] = get_table_header(array(S_TRIGGERS, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $tr_numrows, SPACE . SPACE . SPACE . S_UPDATED . ': ', new CSpan(date(S_DATE_FORMAT_YMDHMS), 'info')), $r_form);
/************************* FILTER **************************/
/***********************************************************/
$filterForm = new CFormTable(S_FILTER);
//,'tr_status.php?filter_set=1','POST',null,'sform');
$filterForm->addOption('name', 'zbx_filter');
$filterForm->addOption('id', 'zbx_filter');
$filterForm->SetMethod('post');
$filterForm->addVar('fullscreen', $_REQUEST['fullscreen']);
$filterForm->addVar('groupid', $_REQUEST['groupid']);
$filterForm->addVar('hostid', $_REQUEST['hostid']);
$tr_select = new CComboBox('show_triggers', $show_triggers, 'javasctipt: submit();');
if (TRIGGERS_OPTION_ONLYTRUE) {
    $tr_select->additem(TRIGGERS_OPTION_ONLYTRUE, S_SHOW_ONLY_PROBLEMS);
}
if (TRIGGERS_OPTION_ALL) {
    $tr_select->addItem(TRIGGERS_OPTION_ALL, S_SHOW_ALL);
}
if (TRIGGERS_OPTION_NOFALSEFORB && $config['event_ack_enable']) {
    $tr_select->addItem(TRIGGERS_OPTION_NOFALSEFORB, S_SHOW_NOFALSEFORB);
}
$ev_select = new CComboBox('show_events', $show_events, 'javasctipt: submit();');
if (EVENTS_OPTION_NOEVENT) {
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:tr_status.php


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