本文整理汇总了PHP中CFormTable::SetTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP CFormTable::SetTitle方法的具体用法?PHP CFormTable::SetTitle怎么用?PHP CFormTable::SetTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFormTable
的用法示例。
在下文中一共展示了CFormTable::SetTitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if ($new_service_time['to'] && !str_in_array($_REQUEST['service_times'], $new_service_time)) {
array_push($_REQUEST['service_times'], $new_service_time);
}
} else {
if (isset($_REQUEST["del_service_times"]) && isset($_REQUEST["rem_service_times"])) {
$_REQUEST["service_times"] = get_request("service_times", array());
foreach ($_REQUEST["rem_service_times"] as $val) {
unset($_REQUEST["service_times"][$val]);
}
}
}
$service_times = get_request('service_times', array());
$new_service_time = get_request('new_service_time', array('type' => SERVICE_TIME_TYPE_UPTIME));
//----------
if (isset($service["serviceid"])) {
$frmService->SetTitle(S_SERVICE . " \"" . $service["name"] . "\"");
}
if (isset($service["serviceid"]) && !isset($_REQUEST["form_refresh"])) {
$name = $service["name"];
$algorithm = $service["algorithm"];
$showsla = $service["showsla"];
$goodsla = $service["goodsla"];
$sortorder = $service["sortorder"];
$triggerid = $service["triggerid"];
$linktrigger = isset($triggerid) ? 1 : 0;
if (!isset($triggerid)) {
$triggerid = 0;
}
$result = DBselect('select * from services_times where serviceid=' . $service['serviceid']);
while ($db_stime = DBfetch($result)) {
$stime = array('type' => $db_stime['type'], 'from' => $db_stime['ts_from'], 'to' => $db_stime['ts_to'], 'note' => $db_stime['note']);
示例2: insert_map_element_form
function insert_map_element_form()
{
global $USER_DETAILS;
$frmEl = new CFormTable('New map element', 'sysmap.php');
$frmEl->SetHelp('web.sysmap.host.php');
$frmEl->addVar('sysmapid', $_REQUEST['sysmapid']);
if (isset($_REQUEST['selementid'])) {
$frmEl->addVar('selementid', $_REQUEST['selementid']);
$element = get_sysmaps_element_by_selementid($_REQUEST['selementid']);
$frmEl->SetTitle('Map element "' . $element['label'] . '"');
}
if (isset($_REQUEST['selementid']) && !isset($_REQUEST['form_refresh'])) {
$elementid = $element['elementid'];
$elementtype = $element['elementtype'];
$label = $element['label'];
$x = $element['x'];
$y = $element['y'];
$url = $element['url'];
$iconid_off = $element['iconid_off'];
$iconid_on = $element['iconid_on'];
$iconid_unknown = $element['iconid_unknown'];
$iconid_disabled = $element['iconid_disabled'];
$label_location = $element['label_location'];
if (is_null($label_location)) {
$label_location = -1;
}
} else {
$elementid = get_request('elementid', 0);
$elementtype = get_request('elementtype', SYSMAP_ELEMENT_TYPE_HOST);
$label = get_request('label', '');
$x = get_request('x', 0);
$y = get_request('y', 0);
$url = get_request('url', '');
$iconid_off = get_request('iconid_off', 0);
$iconid_on = get_request('iconid_on', 0);
$iconid_unknown = get_request('iconid_unknown', 0);
$iconid_disabled = get_request('iconid_disabled', 0);
$label_location = get_request('label_location', '-1');
}
$cmbType = new CComboBox('elementtype', $elementtype, 'submit()');
$available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, null, get_current_nodeid(true));
$sql = 'SELECT DISTINCT n.name as node_name,h.hostid,h.host ' . ' FROM hosts h' . ' LEFT JOIN nodes n on n.nodeid=' . DBid2nodeid('h.hostid') . ' WHERE ' . DBcondition('h.hostid', $available_hosts) . ' ORDER BY node_name,h.host';
$db_hosts = DBselect($sql);
if ($db_hosts) {
$cmbType->addItem(SYSMAP_ELEMENT_TYPE_HOST, S_HOST);
}
$db_maps = DBselect('SELECT sysmapid FROM sysmaps WHERE sysmapid!=' . $_REQUEST['sysmapid']);
if (DBfetch($db_maps)) {
$cmbType->addItem(SYSMAP_ELEMENT_TYPE_MAP, S_MAP);
}
$cmbType->addItem(SYSMAP_ELEMENT_TYPE_TRIGGER, S_TRIGGER);
$cmbType->addItem(SYSMAP_ELEMENT_TYPE_HOST_GROUP, S_HOST_GROUP);
$cmbType->addItem(SYSMAP_ELEMENT_TYPE_IMAGE, S_IMAGE);
$frmEl->addRow(S_TYPE, $cmbType);
$frmEl->addRow(S_LABEL, new CTextArea('label', $label, 32, 4));
$cmbLocation = new CComboBox('label_location', $label_location);
$cmbLocation->addItem(-1, '-');
$cmbLocation->addItem(0, S_BOTTOM);
$cmbLocation->addItem(1, S_LEFT);
$cmbLocation->addItem(2, S_RIGHT);
$cmbLocation->addItem(3, S_TOP);
$frmEl->addRow(S_LABEL_LOCATION, $cmbLocation);
if ($elementtype == SYSMAP_ELEMENT_TYPE_HOST) {
$host = '';
$host_info = DBfetch(DBselect('SELECT DISTINCT n.name as node_name,h.hostid,h.host ' . ' FROM hosts h ' . ' LEFT JOIN nodes n ON n.nodeid=' . DBid2nodeid('h.hostid') . ' WHERE ' . DBcondition('h.hostid', $available_hosts) . ' AND hostid=' . $elementid . ' ORDER BY node_name,h.host'));
if ($host_info) {
$host = $host_info['host'];
} else {
$elementid = 0;
}
if ($elementid == 0) {
$host = '';
$elementid = 0;
}
$frmEl->addVar('elementid', $elementid);
$frmEl->addRow(S_HOST, array(new CTextBox('host', $host, 32, 'yes'), new CButton('btn1', S_SELECT, "return PopUp('popup.php?dstfrm=" . $frmEl->GetName() . "&dstfld1=elementid&dstfld2=host&srctbl=hosts&srcfld1=hostid&srcfld2=host',450,450);", 'T')));
} else {
if ($elementtype == SYSMAP_ELEMENT_TYPE_MAP) {
$cmbMaps = new CComboBox('elementid', $elementid);
$db_maps = DBselect('SELECT DISTINCT n.name as node_name,s.sysmapid,s.name ' . ' FROM sysmaps s' . ' LEFT JOIN nodes n on n.nodeid=' . DBid2nodeid('s.sysmapid') . ' ORDER BY node_name,s.name');
while ($db_map = DBfetch($db_maps)) {
if (!sysmap_accessible($db_map['sysmapid'], PERM_READ_ONLY)) {
continue;
}
$node_name = isset($db_map['node_name']) ? '(' . $db_map['node_name'] . ') ' : '';
$cmbMaps->addItem($db_map['sysmapid'], $node_name . $db_map['name']);
}
$frmEl->addRow(S_MAP, $cmbMaps);
} else {
if ($elementtype == SYSMAP_ELEMENT_TYPE_TRIGGER) {
$available_triggers = get_accessible_triggers(PERM_READ_ONLY, array(), PERM_RES_IDS_ARRAY, get_current_nodeid(true));
$trigger = '';
$trigger_info = DBfetch(DBselect('SELECT DISTINCT n.name as node_name,h.hostid,h.host,t.*' . ' FROM triggers t ' . ' LEFT JOIN functions f on t.triggerid=f.triggerid ' . ' LEFT JOIN items i on i.itemid=f.itemid ' . ' LEFT JOIN hosts h on h.hostid=i.hostid ' . ' LEFT JOIN nodes n on n.nodeid=' . DBid2nodeid('t.triggerid') . ' WHERE t.triggerid=' . $elementid . ' AND ' . DBcondition('t.triggerid', $available_triggers) . ' ORDER BY node_name,h.host,t.description'));
if ($trigger_info) {
$trigger = expand_trigger_description_by_data($trigger_info);
} else {
$elementid = 0;
}
if ($elementid == 0) {
$trigger = '';
//.........这里部分代码省略.........
示例3: CLink
$table->addRow(array($name, $imagetype, $actions = new CLink(new CImg('image.php?height=24&imageid=' . $row['imageid'], 'no image', NULL), 'image.php?imageid=' . $row['imageid'])));
}
$table->show();
}
} elseif ($_REQUEST['config'] == 6) {
// Value Mapping
echo SBR;
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;