本文整理汇总了PHP中CFormTable::AddRow方法的典型用法代码示例。如果您正苦于以下问题:PHP CFormTable::AddRow方法的具体用法?PHP CFormTable::AddRow怎么用?PHP CFormTable::AddRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFormTable
的用法示例。
在下文中一共展示了CFormTable::AddRow方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DBfetch
$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) {
$value = map_link_drawtype2str($i);
$cmbType->AddItem($i, $value);
}
$btnSelect = new CButton('btn1', S_SELECT, "return PopUp('popup.php?dstfrm=" . $frmCnct->GetName() . "&dstfld1=triggerid&dstfld2=trigger&srctbl=triggers&srcfld1=triggerid&srcfld2=description');", 'T');
$btnSelect->SetType('button');
/* END preparation */
$description = $triggerid > 0 ? expand_trigger_description($triggerid) : '';
$frmCnct->AddRow(S_TRIGGER, array(new CTextBox('trigger', $description, 70, 'yes'), SPACE, $btnSelect));
$frmCnct->AddRow(S_TYPE . ' (' . S_PROBLEM_BIG . ')', $cmbType);
$frmCnct->AddRow(S_COLOR . ' (' . S_PROBLEM_BIG . ')', new CColor('color', $color));
$frmCnct->AddItemToBottomRow(new CButton("save", isset($_REQUEST['triggerid']) ? S_SAVE : S_ADD));
$frmCnct->AddItemToBottomRow(SPACE);
$frmCnct->AddItemToBottomRow(new CButton("cancel", S_CANCEL, 'javascript: window.close();'));
$frmCnct->Show();
}
}
include_once "include/page_footer.php";
示例2: CFormTable
);
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) {
if (isset($pf['M']) && is_array($pf['M'])) {
$cmbParamType = new CComboBox('paramtype', $paramtype);
foreach ($pf['M'] as $mid => $caption) {
示例3: CFormTable
}
$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);
$cmbStat->AddItem(0, S_ENABLED);
$cmbStat->AddItem(1, S_DISABLED);
$frmMedia->AddRow("Status", $cmbStat);
$frmMedia->AddItemToBottomRow(new CButton("add", $media > -1 ? S_SAVE : S_ADD));
$frmMedia->AddItemToBottomRow(SPACE);
$frmMedia->AddItemToBottomRow(new CButtonCancel(null, 'close_window();'));
$frmMedia->Show();
示例4: CScript
//,'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);
$reset = new CButton("filter_rst", S_RESET);
$reset->SetType('button');
$reset->SetAction('javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst",1); location.href = uri.getUrl();');
$filterForm->AddItemToBottomRow(new CButton("filter_set", S_FILTER));
$filterForm->AddItemToBottomRow($reset);
$p_elements[] = create_filter(S_FILTER, $navigation, $filterForm, 'tr_filter', get_profile('web.events.filter.state', 0));
} else {
$p_elements[] = get_thin_table_header(SPACE, $navigation);
}
//-------
$p_elements[] = $table;
示例5: insert_host_form
//.........这里部分代码省略.........
}
$frmHost->addRow(S_NAME, new CTextBox('host', $host, 54));
$available_groups = get_accessible_groups_by_user($USER_DETAILS, PERM_READ_LIST);
$grp_tb = new CTweenBox($frmHost, 'groups', $groups, 10);
$db_groups = DBselect('SELECT DISTINCT groupid,name ' . ' FROM groups ' . ' WHERE ' . DBcondition('groupid', $available_groups) . ' ORDER BY name');
while ($db_group = DBfetch($db_groups)) {
$grp_tb->addItem($db_group['groupid'], $db_group['name']);
}
$frmHost->addRow(S_GROUPS, $grp_tb->get(S_IN . SPACE . S_GROUPS, S_OTHER . SPACE . S_GROUPS));
$frmHost->addRow(S_NEW_GROUP, new CTextBox('newgroup', $newgroup), 'new');
// onchange does not work on some browsers: MacOS, KDE browser
if ($show_only_tmp) {
$frmHost->addVar('useip', 0);
$frmHost->addVar('ip', '0.0.0.0');
$frmHost->addVar('dns', '');
} else {
$frmHost->addRow(S_DNS_NAME, new CTextBox('dns', $dns, '40'));
if (defined('ZBX_HAVE_IPV6')) {
$frmHost->addRow(S_IP_ADDRESS, new CTextBox('ip', $ip, '39'));
} else {
$frmHost->addRow(S_IP_ADDRESS, new CTextBox('ip', $ip, '15'));
}
$cmbConnectBy = new CComboBox('useip', $useip);
$cmbConnectBy->addItem(0, S_DNS_NAME);
$cmbConnectBy->addItem(1, S_IP_ADDRESS);
$frmHost->addRow(S_CONNECT_TO, $cmbConnectBy);
}
if ($show_only_tmp) {
$port = '10050';
$status = HOST_STATUS_TEMPLATE;
$frmHost->addVar('port', $port);
$frmHost->addVar('status', $status);
} else {
$frmHost->AddRow(S_AGENT_PORT, new CNumericBox('port', $port, 5));
//Proxy
$cmbProxy = new CComboBox('proxy_hostid', $proxy_hostid);
$cmbProxy->addItem(0, S_NO_PROXY);
$db_proxies = DBselect('SELECT hostid,host FROM hosts' . ' where status in (' . HOST_STATUS_PROXY . ') and ' . DBin_node('hostid'));
while ($db_proxy = DBfetch($db_proxies)) {
$cmbProxy->addItem($db_proxy['hostid'], $db_proxy['host']);
}
$frmHost->addRow(S_MONITORED_BY_PROXY, $cmbProxy);
//----------
$cmbStatus = new CComboBox('status', $status);
$cmbStatus->addItem(HOST_STATUS_MONITORED, S_MONITORED);
$cmbStatus->addItem(HOST_STATUS_NOT_MONITORED, S_NOT_MONITORED);
$frmHost->addRow(S_STATUS, $cmbStatus);
}
$template_table = new CTable();
$template_table->SetCellPadding(0);
$template_table->SetCellSpacing(0);
foreach ($templates as $id => $temp_name) {
$frmHost->addVar('templates[' . $id . ']', $temp_name);
$template_table->addRow(array($temp_name, new CButton('unlink[' . $id . ']', S_UNLINK), isset($original_templates[$id]) ? new CButton('unlink_and_clear[' . $id . ']', S_UNLINK_AND_CLEAR) : SPACE));
}
$frmHost->addRow(S_LINK_WITH_TEMPLATE, array($template_table, new CButton('add_template', S_ADD, "return PopUp('popup.php?dstfrm=" . $frmHost->GetName() . "&dstfld1=new_template&srctbl=templates&srcfld1=hostid&srcfld2=host" . url_param($templates, false, 'existed_templates') . "',450,450)", 'T')));
if ($show_only_tmp) {
$frmHost->addVar('useipmi', $useipmi);
} else {
$frmHost->addRow(S_USEIPMI, new CCheckBox('useipmi', $useipmi, 'submit()'));
}
if ($useipmi == 'yes') {
$frmHost->addRow(S_IPMI_IP_ADDRESS, new CTextBox('ipmi_ip', $ipmi_ip, defined('ZBX_HAVE_IPV6') ? 39 : 15));
$frmHost->addRow(S_IPMI_PORT, new CNumericBox('ipmi_port', $ipmi_port, 5));
$cmbIPMIAuthtype = new CComboBox('ipmi_authtype', $ipmi_authtype);
$cmbIPMIAuthtype->addItem(IPMI_AUTHTYPE_DEFAULT, S_AUTHTYPE_DEFAULT);
示例6: array
** 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., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
require_once "include/config.inc.php";
require_once "include/forms.inc.php";
$page["title"] = "S_INSTALLATION";
$page["file"] = "instal.php";
include_once "include/page_header.php";
include_once "setup.php";
include_once "include/page_footer.php";
/*******************************/
/* THIS POINT NEVER BE REACHED */
/*******************************/
$fields = array("install" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), "update" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL));
check_fields($fields);
if (isset($_REQUEST['install'])) {
redirect('setup.php');
} elseif (isset($_REQUEST['update'])) {
error('*UNDER CONSTRUCTION*');
}
$form = new CFormTable(S_INSTALLATION_UPDATE);
$form->SetHelp('install_source_web.php');
$form->AddRow(array(bold(S_NEW_INSTALLATION_BIG), BR(), BR(), bold(S_DESCRIPTION), BR(), 'Not implemented yet!', BR(), BR(), BR()), new CButton('install', S_NEW_INSTALLATION));
$form->AddRow(array(bold(S_UPDATE_BIG), BR(), BR(), bold(S_DESCRIPTION), BR(), 'Not implemented yet!', BR(), BR(), BR()), new CButton('update', S_UPDATE));
$form->Show();
include_once "include/page_footer.php";
示例7: DBstart
$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();
} else {
示例8: 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';
示例9: 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 = '';
//.........这里部分代码省略.........
示例10: array
$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
$table = new CTable();
$table->setClass('tableinfo');