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


PHP CFormTable::setTitle方法代码示例

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


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

示例1: insert_graph_form

function insert_graph_form()
{
    $frmGraph = new CFormTable(S_GRAPH, null, 'post');
    $frmGraph->setName('frm_graph');
    //$frmGraph->setHelp("web.graphs.graph.php");
    $items = get_request('items', array());
    if (isset($_REQUEST['graphid'])) {
        $frmGraph->addVar('graphid', $_REQUEST['graphid']);
        $options = array('graphids' => $_REQUEST['graphid'], 'extendoutput' => 1);
        $graphs = CGraph::get($options);
        $row = reset($graphs);
        $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'];
        $options = array('graphids' => $_REQUEST['graphid'], 'sortfield' => 'sortorder', 'extendoutput' => 1);
        $items = CGraphItem::get($options);
    } 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) {
                unset($items[$gid]);
            }
        }
    }
    $items = array_values($items);
    $icount = count($items);
    for ($i = 0; $i < $icount - 1;) {
        // check if we deletd an item
        $next = $i + 1;
        while (!isset($items[$next]) && $next < $icount - 1) {
            $next++;
        }
        if (isset($items[$next]) && $items[$i]['sortorder'] == $items[$next]['sortorder']) {
            for ($j = $next; $j < $icount; $j++) {
                if ($items[$j - 1]['sortorder'] >= $items[$j]['sortorder']) {
                    $items[$j]['sortorder']++;
//.........这里部分代码省略.........
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:101,代码来源:forms.inc.php

示例2: CForm

    insert_js('cookie.eraseArray("' . $path . '")');
}
/* header */
$form_button = new CForm(null, 'get');
if (!isset($_REQUEST['form'])) {
    $form_button->addItem(new CButton('form', S_CREATE_RULE));
}
$dscry_wdgt = new CWidget();
$dscry_wdgt->addPageHeader(S_CONFIGURATION_OF_DISCOVERY_BIG, $form_button);
if (isset($_REQUEST['form'])) {
    $form = new CFormTable();
    if (isset($_REQUEST['druleid'])) {
        $sql = 'SELECT * FROM drules WHERE druleid=' . $_REQUEST['druleid'];
        if ($rule_data = DBfetch(DBselect($sql))) {
            $form->addVar('druleid', $_REQUEST['druleid']);
            $form->setTitle(S_DISCOVERY_RULE . ' "' . $rule_data['name'] . '"');
        }
    } else {
        $form->setTitle(S_DISCOVERY_RULE);
    }
    $uniqueness_criteria = -1;
    if (isset($_REQUEST['druleid']) && $rule_data && !isset($_REQUEST["form_refresh"])) {
        $proxy_hostid = $rule_data['proxy_hostid'];
        $name = $rule_data['name'];
        $iprange = $rule_data['iprange'];
        $delay = $rule_data['delay'];
        $status = $rule_data['status'];
        //TODO init checks
        $dchecks = array();
        $db_checks = DBselect('SELECT dcheckid,type,ports,key_,snmp_community,snmpv3_securityname,' . 'snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase' . ' FROM dchecks' . ' WHERE druleid=' . $_REQUEST['druleid']);
        while ($check_data = DBfetch($db_checks)) {
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:discoveryconf.php

示例3: CButton

         $cmbUsrGrp->addItem($row['usrgrpid'], get_node_name_by_elid($row['usrgrpid'], null, ': ') . $row['name']);
     }
     $frmOther->addRow(S_USER_GROUP_FOR_DATABASE_DOWN_MESSAGE, $cmbUsrGrp);
     $frmOther->addItemToBottomRow(new CButton('save', S_SAVE));
     $cnf_wdgt->addItem($frmOther);
 } elseif ($_REQUEST['config'] == 6) {
     // Value Mapping
     if (isset($_REQUEST['form'])) {
         $frmValmap = new CFormTable(S_VALUE_MAP);
         $frmValmap->setHelp("web.mapping.php");
         $frmValmap->addVar("config", get_request("config", 6));
         if (isset($_REQUEST["valuemapid"])) {
             $frmValmap->addVar("valuemapid", $_REQUEST["valuemapid"]);
             $db_valuemaps = DBselect("select * FROM valuemaps" . " WHERE valuemapid=" . $_REQUEST["valuemapid"]);
             $db_valuemap = DBfetch($db_valuemaps);
             $frmValmap->setTitle(S_VALUE_MAP . ' "' . $db_valuemap["name"] . '"');
         }
         if (isset($_REQUEST["valuemapid"]) && !isset($_REQUEST["form_refresh"])) {
             $valuemap = array();
             $mapname = $db_valuemap["name"];
             $mappings = DBselect("select * FROM mappings WHERE valuemapid=" . $_REQUEST["valuemapid"]);
             while ($mapping = DBfetch($mappings)) {
                 $value = array("value" => $mapping["value"], "newvalue" => $mapping["newvalue"]);
                 array_push($valuemap, $value);
             }
         } else {
             $mapname = get_request("mapname", "");
             $valuemap = get_request("valuemap", array());
         }
         $frmValmap->addRow(S_NAME, new CTextBox("mapname", $mapname, 40));
         $i = 0;
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:config.php


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