本文整理汇总了PHP中CFormTable::AddVar方法的典型用法代码示例。如果您正苦于以下问题:PHP CFormTable::AddVar方法的具体用法?PHP CFormTable::AddVar怎么用?PHP CFormTable::AddVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFormTable
的用法示例。
在下文中一共展示了CFormTable::AddVar方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CFormTable
//]]>
-->
</script>
<?php
if (isset($_REQUEST['save']) && isset($_REQUEST['triggerid']) && isset($_REQUEST['dstfrm'])) {
echo '<script language="JavaScript" type="text/javascript">
<!--
add_trigger_link("' . $_REQUEST['dstfrm'] . '","' . $_REQUEST['triggerid'] . '","' . $_REQUEST['drawtype'] . '","' . $_REQUEST['color'] . '");
-->
</script>';
} else {
if (isset($_REQUEST['form'])) {
echo SBR;
$frmCnct = new CFormTable("New connector", "popup_link_tr.php");
$frmCnct->SetHelp("web.sysmap.connector.php");
$frmCnct->AddVar("dstfrm", $_REQUEST["dstfrm"]);
if (isset($_REQUEST["linkid"]) && isset($_REQUEST['triggerid'])) {
$frmCnct->AddVar("linkid", $_REQUEST["linkid"]);
$db_link = DBfetch(DBselect('SELECT * FROM sysmaps_link_triggers WHERE linkid=' . $_REQUEST["linkid"] . ' AND triggerid=' . $_REQUEST['triggerid']));
$triggerid = $_REQUEST['triggerid'];
$drawtype = $db_link["drawtype"];
$color = $db_link["color"];
} else {
$triggerid = get_request("triggerid", 0);
$drawtype = get_request("drawtype", 0);
$color = get_request("color", 0);
}
$frmCnct->AddVar("triggerid", $triggerid);
/* START comboboxes preparations */
$cmbType = new CComboBox("drawtype", $drawtype);
foreach (map_link_drawtypes() as $i) {
示例2: 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) {
if (0 == $pid) {
示例3: array
for ($i = 0; $i < 6; $i++) {
if ($rq_severity & 1 << $i) {
$severity[$i] = $i;
}
}
} else {
$severity = get_request('severity', array(0, 1, 2, 3, 4, 5));
}
$media = get_request('media', -1);
$sendto = get_request('sendto', '');
$mediatypeid = get_request('mediatypeid', 0);
$active = get_request('active', 0);
$period = get_request('period', '1-7,00:00-23:59');
$frmMedia = new CFormTable(S_NEW_MEDIA);
$frmMedia->SetHelp("web.media.php");
$frmMedia->AddVar("media", $media);
$frmMedia->AddVar("dstfrm", $_REQUEST["dstfrm"]);
$cmbType = new CComboBox("mediatypeid", $mediatypeid);
$types = DBselect('SELECT mediatypeid,description ' . ' FROM media_type' . ' WHERE ' . DBin_node('mediatypeid') . ' ORDER BY type');
while ($type = DBfetch($types)) {
$cmbType->AddItem($type["mediatypeid"], get_node_name_by_elid($type["mediatypeid"]) . $type["description"]);
}
$frmMedia->AddRow(S_TYPE, $cmbType);
$frmMedia->AddRow(S_SEND_TO, new CTextBox("sendto", $sendto, 20));
$frmMedia->AddRow(S_WHEN_ACTIVE, new CTextBox("period", $period, 48));
$frm_row = array();
for ($i = 0; $i <= 5; $i++) {
array_push($frm_row, array(new CCheckBox("severity[{$i}]", str_in_array($i, $severity) ? 'yes' : 'no', null, $i), get_severity_description($i)), BR());
}
$frmMedia->AddRow(S_USE_IF_SEVERITY, $frm_row);
$cmbStat = new CComboBox("active", $active);
示例4: CImg
$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); ');
$filterForm->AddRow(S_SHOW_UNKNOWN, $unkcbx);
示例5: DBstart
$cmbConfig->addItem(1, S_IMPORT);
$form->addItem($cmbConfig);
show_table_header($title, $form);
if ($config == 1) {
if (isset($_FILES['import_file'])) {
include_once "include/import.inc.php";
DBstart();
$importer = new CZabbixXMLImport();
$importer->setRules($rules['host'], $rules['template'], $rules['item'], $rules['trigger'], $rules['graph']);
$result = $importer->Parse($_FILES['import_file']['tmp_name']);
unset($importer);
$result = DBend($result);
show_messages($result, S_IMPORTED . SPACE . S_SUCCESSEFULLY_SMALL, S_IMPORT . SPACE . S_FAILED_SMALL);
}
$form = new CFormTable($frm_title, null, "post", "multipart/form-data");
$form->AddVar('config', $config);
$form->AddRow(S_IMPORT_FILE, new CFile('import_file'));
$table = new CTable();
$table->SetHeader(array(S_ELEMENT, S_EXISTING, S_MISSING), 'bold');
foreach (array('host' => S_HOST, 'template' => S_TEMPLATE, 'item' => S_ITEM, 'trigger' => S_TRIGGER, 'graph' => S_GRAPH) as $key => $title) {
$cmbExist = new CComboBox('rules[' . $key . '][exist]', $rules[$key]['exist']);
$cmbExist->AddItem(0, S_UPDATE);
$cmbExist->AddItem(1, S_SKIP);
$cmbMissed = new CComboBox('rules[' . $key . '][missed]', $rules[$key]['missed']);
$key == 'template' ? '' : $cmbMissed->AddItem(0, S_ADD);
$cmbMissed->AddItem(1, S_SKIP);
$table->AddRow(array($title, $cmbExist, $cmbMissed));
}
$form->AddRow(S_RULES, $table);
$form->AddItemToBottomRow(new CButton('import', S_IMPORT));
$form->Show();
示例6: CTextBox
$usr_test->AddItem($db_user['alias'], $db_user['alias']);
}
}
} else {
$usr_test = new CTextBox('user', $USER_DETAILS['alias'], null, 'yes');
}
$frmAuth->AddRow(S_LOGIN, $usr_test);
$frmAuth->AddRow(S_USER . SPACE . S_PASSWORD, new CPassBox('user_password'));
$frmAuth->AddItemToBottomRow(new CButton('save', S_SAVE));
$frmAuth->AddItemToBottomRow(new CButton('test', S_TEST));
$frmAuth->Show();
} else {
if (ZBX_AUTH_HTTP == $_REQUEST['config']) {
$form_refresh_http = get_request('form_refresh_http', 0);
$form_refresh_http++;
$frmAuth = new CFormTable(S_HTTP_AUTH, 'authentication.php');
$frmAuth->SetHelp('web.authentication.php');
$frmAuth->AddVar('form_refresh_http', $form_refresh_http);
$cmbConfig = new CCombobox('config', ZBX_AUTH_HTTP, 'submit()');
$cmbConfig->AddItem(ZBX_AUTH_INTERNAL, S_INTERNAL_S);
$cmbConfig->AddItem(ZBX_AUTH_LDAP, S_LDAP);
$cmbConfig->AddItem(ZBX_AUTH_HTTP, S_HTTP);
$frmAuth->AddRow(S_DEFAULT_AUTHENTICATION, $cmbConfig);
$action = "javascript: if(confirm('Switching HTTP authentication will reset all current sessions! Continue?')) return true; else return false;";
$frmAuth->AddRow(S_HTTP_AUTH . SPACE . S_ENABLED, new CCheckBox('authentication_type', ZBX_AUTH_HTTP == $config['authentication_type'], $action, ZBX_AUTH_HTTP));
$frmAuth->AddItemToBottomRow(new CButton('save', S_SAVE));
$frmAuth->Show();
}
}
}
include_once 'include/page_footer.php';
示例7: get_screen_item_form
function get_screen_item_form()
{
global $USER_DETAILS;
$available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY, get_current_nodeid(true));
$form = new CFormTable(S_SCREEN_CELL_CONFIGURATION, 'screenedit.php#form');
$form->SetHelp('web.screenedit.cell.php');
if (isset($_REQUEST['screenitemid'])) {
$iresult = DBSelect('SELECT * FROM screens_items' . ' WHERE screenid=' . $_REQUEST['screenid'] . ' AND screenitemid=' . $_REQUEST['screenitemid']);
$form->AddVar('screenitemid', $_REQUEST['screenitemid']);
} else {
$form->AddVar('x', $_REQUEST['x']);
$form->AddVar('y', $_REQUEST['y']);
}
if (isset($_REQUEST['screenitemid']) && !isset($_REQUEST['form_refresh'])) {
$irow = DBfetch($iresult);
$resourcetype = $irow['resourcetype'];
$resourceid = $irow['resourceid'];
$width = $irow['width'];
$height = $irow['height'];
$colspan = $irow['colspan'];
$rowspan = $irow['rowspan'];
$elements = $irow['elements'];
$valign = $irow['valign'];
$halign = $irow['halign'];
$style = $irow['style'];
$url = $irow['url'];
$dynamic = $irow['dynamic'];
} else {
$resourcetype = get_request('resourcetype', 0);
$resourceid = get_request('resourceid', 0);
$width = get_request('width', 500);
$height = get_request('height', 100);
$colspan = get_request('colspan', 0);
$rowspan = get_request('rowspan', 0);
$elements = get_request('elements', 25);
$valign = get_request('valign', VALIGN_DEFAULT);
$halign = get_request('halign', HALIGN_DEFAULT);
$style = get_request('style', 0);
$url = get_request('url', '');
$dynamic = get_request('dynamic', SCREEN_SIMPLE_ITEM);
}
$form->addVar('screenid', $_REQUEST['screenid']);
$cmbRes = new CCombobox('resourcetype', $resourcetype, 'submit()');
$cmbRes->addItem(SCREEN_RESOURCE_GRAPH, S_GRAPH);
$cmbRes->addItem(SCREEN_RESOURCE_SIMPLE_GRAPH, S_SIMPLE_GRAPH);
$cmbRes->addItem(SCREEN_RESOURCE_PLAIN_TEXT, S_PLAIN_TEXT);
$cmbRes->addItem(SCREEN_RESOURCE_MAP, S_MAP);
$cmbRes->addItem(SCREEN_RESOURCE_SCREEN, S_SCREEN);
$cmbRes->addItem(SCREEN_RESOURCE_SERVER_INFO, S_SERVER_INFO);
$cmbRes->addItem(SCREEN_RESOURCE_HOSTS_INFO, S_HOSTS_INFO);
$cmbRes->addItem(SCREEN_RESOURCE_TRIGGERS_INFO, S_TRIGGERS_INFO);
$cmbRes->addItem(SCREEN_RESOURCE_TRIGGERS_OVERVIEW, S_TRIGGERS_OVERVIEW);
$cmbRes->addItem(SCREEN_RESOURCE_STATUS_OF_TRIGGERS, S_STATUS_OF_TRIGGERS);
$cmbRes->addItem(SCREEN_RESOURCE_DATA_OVERVIEW, S_DATA_OVERVIEW);
$cmbRes->addItem(SCREEN_RESOURCE_CLOCK, S_CLOCK);
$cmbRes->addItem(SCREEN_RESOURCE_URL, S_URL);
$cmbRes->addItem(SCREEN_RESOURCE_ACTIONS, S_HISTORY_OF_ACTIONS);
$cmbRes->addItem(SCREEN_RESOURCE_EVENTS, S_HISTORY_OF_EVENTS);
$form->addRow(S_RESOURCE, $cmbRes);
if ($resourcetype == SCREEN_RESOURCE_GRAPH) {
// User-defined graph
$resourceid = graph_accessible($resourceid) ? $resourceid : 0;
$caption = '';
$id = 0;
if ($resourceid > 0) {
$result = DBselect('SELECT DISTINCT g.graphid,g.name,n.name as node_name, h.host' . ' FROM graphs g ' . ' LEFT JOIN graphs_items gi ON g.graphid=gi.graphid ' . ' LEFT JOIN items i ON gi.itemid=i.itemid ' . ' LEFT JOIN hosts h ON h.hostid=i.hostid ' . ' LEFT JOIN nodes n ON n.nodeid=' . DBid2nodeid('g.graphid') . ' WHERE g.graphid=' . $resourceid);
while ($row = DBfetch($result)) {
$row['node_name'] = isset($row['node_name']) ? '(' . $row['node_name'] . ') ' : '';
$caption = $row['node_name'] . $row['host'] . ':' . $row['name'];
$id = $resourceid;
}
}
$form->addVar('resourceid', $id);
$textfield = new Ctextbox('caption', $caption, 75, 'yes');
$selectbtn = new Cbutton('select', S_SELECT, "javascript: return PopUp('popup.php?dstfrm=" . $form->getName() . "&dstfld1=resourceid&dstfld2=caption&srctbl=graphs&srcfld1=graphid&srcfld2=name',800,450);");
$selectbtn->setAttribute('onmouseover', "javascript: this.style.cursor = 'pointer';");
$form->AddRow(S_GRAPH_NAME, array($textfield, SPACE, $selectbtn));
} else {
if ($resourcetype == SCREEN_RESOURCE_SIMPLE_GRAPH) {
// Simple graph
$caption = '';
$id = 0;
if ($resourceid > 0) {
$result = DBselect('SELECT n.name as node_name,h.host,i.description,i.itemid,i.key_ ' . ' FROM hosts h,items i ' . ' LEFT JOIN nodes n on n.nodeid=' . DBid2nodeid('i.itemid') . ' WHERE h.hostid=i.hostid ' . ' AND h.status=' . HOST_STATUS_MONITORED . ' AND i.status=' . ITEM_STATUS_ACTIVE . ' AND ' . DBcondition('i.hostid', $available_hosts) . ' AND i.itemid=' . $resourceid);
while ($row = DBfetch($result)) {
$description_ = item_description($row);
$row["node_name"] = isset($row["node_name"]) ? "(" . $row["node_name"] . ") " : '';
$caption = $row['node_name'] . $row['host'] . ': ' . $description_;
$id = $resourceid;
}
}
$form->AddVar('resourceid', $id);
$textfield = new Ctextbox('caption', $caption, 75, 'yes');
$selectbtn = new Cbutton('select', S_SELECT, "javascript: return PopUp('popup.php?dstfrm=" . $form->getName() . "&dstfld1=resourceid&dstfld2=caption&srctbl=simple_graph&srcfld1=itemid&srcfld2=description',800,450);");
$selectbtn->setAttribute('onmouseover', "javascript: this.style.cursor = 'pointer';");
$form->AddRow(S_PARAMETER, array($textfield, SPACE, $selectbtn));
} else {
if ($resourcetype == SCREEN_RESOURCE_MAP) {
// Map
$caption = '';
//.........这里部分代码省略.........
示例8: array
} else {
$name = get_request('name', '');
$showsla = get_request('showsla', 0);
$goodsla = get_request('goodsla', 99.05);
$sortorder = get_request('sortorder', 0);
$algorithm = get_request('algorithm', SERVICE_ALGORITHM_MAX);
$triggerid = get_request('triggerid', 0);
$linktrigger = get_request('linktrigger', 0);
//links
$parentid = get_request('parentid', 0);
$parentname = get_request('parentname', '');
$childs = get_request('childs', array());
//-----
}
if (isset($service)) {
$frmService->AddVar('serviceid', $service['serviceid']);
}
$frmService->AddRow(S_NAME, new CTextBox('name', $name, 60));
//link
//-------------------------------------------- <LINK> --------------------------------------------
//parent link
$ctb = new CTextBox('parent_name', $parentname, 60);
$ctb->setAttribute('disabled', 'disabled');
$frmService->AddVar('parentname', $parentname);
$frmService->AddVar('parentid', $parentid);
$cb = new CButton('select_parent', S_CHANGE);
$cb->SetType('button');
$cb->SetAction("javascript: openWinCentered('services_form.php?pservices=1" . url_param('serviceid') . "','ZBX_Services_List',740,420,'scrollbars=1, toolbar=0, menubar=0, resizable=1, dialog=0');");
$frmService->AddRow('Parent Service', array($ctb, $cb));
//----------
//child links