本文整理汇总了PHP中CFormTable::SetName方法的典型用法代码示例。如果您正苦于以下问题:PHP CFormTable::SetName方法的具体用法?PHP CFormTable::SetName怎么用?PHP CFormTable::SetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFormTable
的用法示例。
在下文中一共展示了CFormTable::SetName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CFormTable
{
InsertText(el, <?php
echo zbx_jsvalue($expression);
?>
);
close_window();
}
}
-->
</script>
<?php
}
echo SBR;
$form = new CFormTable(S_CONDITION);
$form->SetHelp('config_triggers.php');
$form->SetName('expression');
$form->AddVar('dstfrm', $dstfrm);
$form->AddVar('dstfld1', $dstfld1);
$form->AddVar('itemid', $itemid);
$form->AddRow(S_ITEM, array(new CTextBox('description', $description, 50, 'yes'), new CButton('select', S_SELECT, "return PopUp('popup.php?dstfrm=" . $form->GetName() . "&dstfld1=itemid&dstfld2=description&" . "srctbl=items&srcfld1=itemid&srcfld2=description',0,0,'zbx_popup_item');")));
$cmbFnc = new CComboBox('expr_type', $expr_type, 'submit()');
foreach ($functions as $id => $f) {
foreach ($f['operators'] as $op => $txt_op) {
$cmbFnc->AddItem($id . '[' . $op . ']', str_replace('{OP}', $txt_op, $f['description']));
}
}
$form->AddRow(S_FUNCTION, $cmbFnc);
if (isset($functions[$function]['params'])) {
foreach ($functions[$function]['params'] as $pid => $pf) {
$pv = isset($param[$pid]) ? $param[$pid] : null;
if ($pf['T'] == T_ZBX_INT) {
示例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);
//.........这里部分代码省略.........