本文整理汇总了PHP中CLink::SetAction方法的典型用法代码示例。如果您正苦于以下问题:PHP CLink::SetAction方法的具体用法?PHP CLink::SetAction怎么用?PHP CLink::SetAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLink
的用法示例。
在下文中一共展示了CLink::SetAction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DBselect
if ($hostid > 0) {
$sql .= ' AND h.hostid=' . $hostid;
}
$sql .= ' ORDER BY h.host, i.description, i.key_, i.itemid';
$result = DBselect($sql);
while ($row = DBfetch($result)) {
$row['node_name'] = isset($row['node_name']) ? '(' . $row['node_name'] . ') ' : '';
$row['description'] = item_description($row);
$description = new CLink($row['description'], '#', 'action');
$row['description'] = $row['node_name'] . $row['host'] . ':' . $row['description'];
if (isset($_REQUEST['reference']) && $_REQUEST['reference'] == 'dashboard') {
$action = get_window_opener($dstfrm, $dstfld1, $srctbl) . get_window_opener($dstfrm, $dstfld2, $row[$srcfld2]) . "window.opener.setTimeout('add2favorites();', 1000);";
} else {
$action = get_window_opener($dstfrm, $dstfld1, $row[$srcfld1]) . get_window_opener($dstfrm, $dstfld2, $row[$srcfld2]);
}
$description->SetAction($action . ' close_window(); return false;');
$table->addRow(array($hostid > 0 ? null : $row['host'], $description, item_type2str($row['type']), item_value_type2str($row['value_type']), new CSpan(item_status2str($row['status']), item_status2style($row['status']))));
}
$table->Show();
} else {
if ('slides' == $srctbl) {
require_once 'include/screens.inc.php';
$table = new CTableInfo(S_NO_NODES_DEFINED);
$table->SetHeader(S_NAME);
$result = DBselect('select slideshowid,name from slideshows where ' . DBin_node('slideshowid', $nodeid) . ' ORDER BY name');
while ($row = DBfetch($result)) {
if (!slideshow_accessible($row['slideshowid'], PERM_READ_ONLY)) {
continue;
}
$name = new CLink($row['name'], '#', 'action');
if (isset($_REQUEST['reference']) && $_REQUEST['reference'] == 'dashboard') {
示例2: implode
$childs_str = implode(',', $childs);
!empty($childs_str) ? $childs_str .= ',' : '';
$query = 'SELECT DISTINCT s.* ' . ' FROM services s ' . ' WHERE ' . DBin_node('s.serviceid') . ' AND (s.triggerid IS NULL OR ' . DBcondition('s.triggerid', $available_triggers) . ') ' . ' AND s.serviceid NOT IN (' . $childs_str . $service['serviceid'] . ') ' . ' ORDER BY s.sortorder,s.name';
} else {
$query = 'SELECT DISTINCT s.* ' . ' FROM services s ' . ' WHERE ' . DBin_node('s.serviceid') . ' AND (s.triggerid IS NULL OR ' . DBcondition('s.triggerid', $available_triggers) . ') ' . ' ORDER BY s.sortorder,s.name';
}
$db_services = DBselect($query);
while ($db_service_data = DBfetch($db_services)) {
$prefix = null;
$trigger = "-";
$description = $db_service_data["name"];
if (isset($db_service_data["triggerid"])) {
$trigger = expand_trigger_description($db_service_data["triggerid"]);
}
$description = new CLink($description, '#', 'action');
$description->SetAction('window.opener.add_child_service(' . zbx_jsvalue($db_service_data["name"]) . ',' . zbx_jsvalue($db_service_data["serviceid"]) . ',' . zbx_jsvalue($trigger) . ',' . zbx_jsvalue($db_service_data["triggerid"]) . '); self.close(); return false;');
$table->AddRow(array(array($prefix, $description), algorithm2str($db_service_data["algorithm"]), $trigger));
}
$cb = new CButton('cancel', S_CANCEL);
$cb->SetType('button');
$cb->SetAction('javascript: self.close();');
$td = new CCol($cb);
$td->setAttribute('style', 'text-align:right;');
$table->SetFooter($td);
$form->AddItem($table);
$form->Show();
}
//-------------------------------------------- </CHILD SERVICES LIST> --------------------------------------------
//-------------------------------------------- <FORM> --------------------------------------------
if (isset($_REQUEST['sform'])) {
$frmService = new CFormTable(S_SERVICE, 'services_form.php', 'POST', null, 'sform');