本文整理汇总了PHP中CDiv::addOption方法的典型用法代码示例。如果您正苦于以下问题:PHP CDiv::addOption方法的具体用法?PHP CDiv::addOption怎么用?PHP CDiv::addOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDiv
的用法示例。
在下文中一共展示了CDiv::addOption方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CDiv
$rst_icon = new CDiv(SPACE, 'iconreset');
$rst_icon->addOption('title', S_RESET);
$rst_icon->addAction('onclick', new CScript("javascript: graphload(SCROLL_BAR.dom_graphs, " . (time() + 100000000) . ", 3600, false);"));
}
$charts_hat = create_hat(S_GRAPHS_BIG, $p_elements, array($icon, $rst_icon, $fs_icon), 'hat_charts', get_profile('web.charts.hats.hat_charts.state', 1));
$charts_hat->show();
if ($_REQUEST['graphid'] > 0) {
// NAV BAR
$stime = get_min_itemclock_by_graphid($_REQUEST['graphid']);
$stime = is_null($stime) ? 0 : $stime;
$bstime = time() - $effectiveperiod;
if (isset($_REQUEST['stime'])) {
$bstime = $_REQUEST['stime'];
$bstime = mktime(substr($bstime, 8, 2), substr($bstime, 10, 2), 0, substr($bstime, 4, 2), substr($bstime, 6, 2), substr($bstime, 0, 4));
}
$script = 'scrollinit(0,' . $effectiveperiod . ',' . $stime . ',0,' . $bstime . '); showgraphmenu("graph");';
if ($graphtype == GRAPH_TYPE_NORMAL || $graphtype == GRAPH_TYPE_STACKED) {
$script .= 'graph_zoom_init("' . $dom_graph_id . '",' . $bstime . ',' . $effectiveperiod . ',ZBX_G_WIDTH,' . $graph_height . ',true);';
}
zbx_add_post_js($script);
$scroll_div = new CDiv();
$scroll_div->addOption('id', 'scroll_cntnr');
$scroll_div->addOption('style', 'border: 0px #CC0000 solid; height: 25px; width: 800px;');
$scroll_div->show();
// navigation_bar('charts.php',array('groupid','hostid','graphid'));
//-------------
}
include_once 'include/page_footer.php';
?>
示例2: DBfetch
if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) {
exit;
}
//--------
if (!check_right_on_trigger_by_triggerid(PERM_READ_ONLY, $_REQUEST["triggerid"])) {
access_deny();
}
$trigger_data = DBfetch(DBselect('SELECT h.host, t.* ' . ' FROM hosts h, items i, functions f, triggers t ' . ' WHERE i.itemid=f.itemid ' . ' AND f.triggerid=t.triggerid ' . ' AND t.triggerid=' . $_REQUEST["triggerid"] . ' AND h.hostid=i.hostid ' . ' AND ' . DBin_node('t.triggerid')));
$p_elements = array();
//Header
$trigger_data['exp_expr'] = explode_exp($trigger_data["expression"], 1);
$trigger_data['exp_desc'] = expand_trigger_description_by_data($trigger_data);
$text = array(S_EVENTS_BIG . ': "' . $trigger_data['exp_desc'] . '"');
$url = '?fullscreen=' . ($_REQUEST['fullscreen'] ? '0' : '1') . url_param('triggerid') . url_param('eventid');
$fs_icon = new CDiv(SPACE, 'fullscreen');
$fs_icon->addOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
$fs_icon->addAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
//-------
$left_tab = new CTable();
$left_tab->setCellPadding(3);
$left_tab->setCellSpacing(3);
$left_tab->addOption('border', 0);
$left_tab->addRow(create_hat(S_EVENT . SPACE . S_SOURCE . SPACE . S_DETAILS, make_trigger_details($_REQUEST['triggerid'], $trigger_data), null, 'hat_triggerdetails'));
$left_tab->addRow(create_hat(S_EVENT_DETAILS, make_event_details($_REQUEST['eventid']), null, 'hat_eventdetails'));
$right_tab = new CTable();
$right_tab->setCellPadding(3);
$right_tab->setCellSpacing(3);
$right_tab->addOption('border', 0);
$right_tab->addRow(create_hat(S_ACKNOWLEDGES, make_acktab_by_eventid($_REQUEST['eventid']), null, 'hat_eventack', get_profile('web.tr_events.hats.hat_eventack.state', 1)));
$right_tab->addRow(create_hat(S_MESSAGE_ACTIONS, get_action_msgs_for_event($_REQUEST['eventid']), null, 'hat_eventactionmsgs', get_profile('web.tr_events.hats.hat_eventactionmsgs.state', 1)));
$right_tab->addRow(create_hat(S_COMMAND_ACTIONS, get_action_cmds_for_event($_REQUEST['eventid']), null, 'hat_eventactioncmds', get_profile('web.tr_events.hats.hat_eventactioncmds.state', 1)));
示例3: insert_mass_update_trigger_form
function insert_mass_update_trigger_form()
{
//$elements_array_name){
global $USER_DETAILS;
$visible = get_request('visible', array());
$priority = get_request('priority', '');
$dependencies = get_request('dependencies', array());
$original_templates = array();
asort($dependencies);
$frmMTrig = new CFormTable(S_TRIGGERS_MASSUPDATE, 'triggers.php');
$frmMTrig->addVar('massupdate', get_request('massupdate', 1));
$frmMTrig->addOption('id', 'massupdate');
$triggers = $_REQUEST['g_triggerid'];
foreach ($triggers as $id => $triggerid) {
$frmMTrig->addVar('g_triggerid[' . $triggerid . ']', $triggerid);
}
$cmbPrior = new CComboBox("priority", $priority);
for ($i = 0; $i <= 5; $i++) {
$cmbPrior->addItem($i, get_severity_description($i));
}
$frmMTrig->addRow(array(new CVisibilityBox('visible[priority]', isset($visible['priority']), 'priority', S_ORIGINAL), S_SEVERITY), $cmbPrior);
/* fependencies */
$dep_el = array();
foreach ($dependencies as $val) {
array_push($dep_el, array(new CCheckBox("rem_dependence[]", 'no', null, strval($val)), expand_trigger_description($val)), BR());
$frmMTrig->addVar("dependencies[]", strval($val));
}
if (count($dep_el) == 0) {
$dep_el[] = S_NO_DEPENDENCES_DEFINED;
} else {
$dep_el[] = new CButton('del_dependence', 'delete selected');
}
// $frmMTrig->addRow(S_THE_TRIGGER_DEPENDS_ON,$dep_el);
/* end dependencies */
/* new dependence */
//$frmMTrig->addVar('new_dependence','0');
$btnSelect = new CButton('btn1', S_ADD, "return PopUp('popup.php?dstfrm=massupdate&dstact=add_dependence" . "&dstfld1=new_dependence[]&srctbl=triggers&objname=triggers&srcfld1=1&multiselect=1" . "',600,450);", 'T');
array_push($dep_el, array(br(), $btnSelect));
$dep_div = new CDiv($dep_el);
$dep_div->addOption('id', 'dependency_box');
$frmMTrig->addRow(array(new CVisibilityBox('visible[dependencies]', isset($visible['dependencies']), 'dependency_box', S_ORIGINAL), S_TRIGGER_DEPENDENCIES), $dep_div);
/* end new dependence */
$frmMTrig->addItemToBottomRow(new CButton('mass_save', S_SAVE));
$frmMTrig->addItemToBottomRow(SPACE);
$frmMTrig->addItemToBottomRow(new CButtonCancel(url_param('config') . url_param('groupid')));
$frmMTrig->Show();
}
示例4: create_filter
function create_filter($col_l, $col_r, $items, $id = 'zbx_filter', $state = 1)
{
if (isset($_REQUEST['print'])) {
$state = 0;
}
$table = new CTable();
$table->addOption('width', '100%');
$table->setCellPadding(0);
$table->setCellSpacing(0);
$table->addOption('border', 0);
$icon = new CDiv(SPACE, $state ? 'filteropened' : 'filterclosed');
$icon->addAction('onclick', new CScript("javascript: change_filter_state(this,'" . $id . "');"));
$icon->addOption('title', S_MAXIMIZE . '/' . S_MINIMIZE);
$icon->addAction('id', 'filter_icon');
$td_icon = new CCol($icon);
$td_icon->addOption('valign', 'bottom');
$icons_row = array($td_icon, SPACE);
$icons_row[] = $col_l;
$icon_tab = new CTable();
$icon_tab->setCellSpacing(0);
$icon_tab->setCellPadding(0);
$icon_tab->addRow($icons_row);
$table->addRow(get_thin_table_header($icon_tab, $col_r));
$div = new CDiv($items);
$div->addOption('id', $id);
if (!$state) {
$div->addOption('style', 'display: none;');
}
$tab = new CTable();
$tab->addRow($div);
// $table->addRow($tab);
$table->addRow($div);
return $table;
}
示例5: show_messages
function show_messages($bool = TRUE, $okmsg = NULL, $errmsg = NULL)
{
global $page, $ZBX_MESSAGES;
if (!defined('PAGE_HEADER_LOADED')) {
return;
}
if (!isset($page["type"])) {
$page["type"] = PAGE_TYPE_HTML;
}
$message = array();
$width = 0;
$height = 0;
$img_space = null;
if (!$bool && !is_null($errmsg)) {
$msg = 'ERROR: ' . $errmsg;
} else {
if ($bool && !is_null($okmsg)) {
$msg = $okmsg;
}
}
if (isset($msg)) {
switch ($page['type']) {
case PAGE_TYPE_IMAGE:
array_push($message, array('text' => $msg, 'color' => !$bool ? array('R' => 255, 'G' => 0, 'B' => 0) : array('R' => 34, 'G' => 51, 'B' => 68), 'font' => 2));
$width = max($width, ImageFontWidth(2) * strlen($msg) + 1);
$height += imagefontheight(2) + 1;
break;
case PAGE_TYPE_XML:
echo htmlspecialchars($msg) . "\n";
break;
case PAGE_TYPE_HTML:
default:
$msg_tab = new CTable($msg, $bool ? 'msgok' : 'msgerr');
$msg_tab->setCellPadding(0);
$msg_tab->setCellSpacing(0);
$msg_col = new CCol(bold($msg), 'msg_main msg');
$msg_col->addOption('id', 'page_msg');
$msg_details = SPACE;
if (isset($ZBX_MESSAGES) && !empty($ZBX_MESSAGES)) {
$msg_details = new CDiv(array(S_DETAILS), 'pointer');
$msg_details->addAction('onclick', new CScript("javascript: ShowHide('msg_messages', IE?'block':'table');"));
$msg_details->addOption('title', S_MAXIMIZE . '/' . S_MINIMIZE);
}
$msg_tab->addRow(array(new CCol($msg_details, 'clr'), $msg_col));
$msg_tab->Show();
$img_space = new CImg('images/general/tree/zero.gif', 'space', '100', '2');
break;
}
}
if (isset($ZBX_MESSAGES)) {
if ($page['type'] == PAGE_TYPE_IMAGE) {
$msg_font = 2;
foreach ($ZBX_MESSAGES as $msg) {
if ($msg['type'] == 'error') {
array_push($message, array('text' => $msg['message'], 'color' => array('R' => 255, 'G' => 55, 'B' => 55), 'font' => $msg_font));
} else {
array_push($message, array('text' => $msg['message'], 'color' => array('R' => 155, 'G' => 155, 'B' => 55), 'font' => $msg_font));
}
$width = max($width, imagefontwidth($msg_font) * strlen($msg['message']) + 1);
$height += imagefontheight($msg_font) + 1;
}
} else {
if ($page['type'] == PAGE_TYPE_XML) {
foreach ($ZBX_MESSAGES as $msg) {
echo '[' . $msg['type'] . '] ' . $msg['message'] . "\n";
}
} else {
$lst_error = new CList(null, 'messages');
foreach ($ZBX_MESSAGES as $msg) {
$lst_error->addItem($msg['message'], $msg['type']);
$bool = $bool && 'error' != strtolower($msg['type']);
}
//message scroll if needed
$msg_show = 6;
$msg_count = count($ZBX_MESSAGES);
if ($msg_count > $msg_show) {
$msg_count = $msg_show;
$msg_count = $msg_count * 16;
$lst_error->addOption('style', 'height: ' . $msg_count . 'px;');
}
$tab = new CTable(null, $bool ? 'msgok' : 'msgerr');
$tab->setCellPadding(0);
$tab->setCellSpacing(0);
$tab->addOption('id', 'msg_messages');
$tab->addOption('style', 'width: 100%;');
if (isset($msg_tab) && $bool) {
$tab->addOption('style', 'display: none;');
}
$tab->addRow(new CCol($lst_error, 'msg'));
$tab->Show();
//---
}
}
$ZBX_MESSAGES = null;
}
if (!is_null($img_space)) {
print unpack_object($img_space);
}
if ($page['type'] == PAGE_TYPE_IMAGE && count($message) > 0) {
$width += 2;
//.........这里部分代码省略.........
示例6: CTable
$sub_menu_div->addAction('onmouseout', 'javascript: MMenu.mouseOut();');
if (isset($page['menu']) && $page['menu'] == $label) {
$menu_selected = true;
$sub_menu_div->addOption('style', 'display: block;');
insert_js('MMenu.def_label = ' . zbx_jsvalue($label));
} else {
$sub_menu_div->addOption('style', 'display: none;');
}
$page_menu->addItem($sub_menu_div);
}
$sub_menu_table = new CTable(NULL, 'sub_menu');
$sub_menu_table->setCellSpacing(0);
$sub_menu_table->setCellPadding(5);
$sub_menu_table->addRow(SPACE);
$sub_menu_div = new CDiv($sub_menu_table);
$sub_menu_div->addOption('id', 'sub_empty');
$sub_menu_div->addOption('style', 'display: ' . ($menu_selected ? 'none;' : 'block;'));
$page_menu->addItem($sub_menu_div);
$page_menu->show();
}
//------------------------------------- <HISTORY> ---------------------------------------
if (isset($page['hist_arg']) && $USER_DETAILS['alias'] != ZBX_GUEST_USER && $page['type'] == PAGE_TYPE_HTML && !defined('ZBX_PAGE_NO_MENU')) {
$table = new CTable();
$table->setClass('history');
$table->setCellSpacing(0);
$table->setCellPadding(0);
$history = get_user_history();
$tr = new CRow(new CCol('History:', 'caption'));
$tr->addItem($history);
$table->addRow($tr);
$table->Show();
示例7: get_screen
function get_screen($screenid, $editmode, $effectiveperiod = NULL)
{
global $USER_DETAILS;
if (!screen_accessible($screenid, $editmode == 1 ? PERM_READ_WRITE : PERM_READ_ONLY)) {
access_deny();
}
if (is_null($effectiveperiod)) {
$effectiveperiod = ZBX_MIN_PERIOD;
}
$result = DBselect('SELECT name,hsize,vsize FROM screens WHERE screenid=' . $screenid);
$row = DBfetch($result);
if (!$row) {
return new CTableInfo(S_NO_SCREENS_DEFINED);
}
for ($r = 0; $r < $row['vsize']; $r++) {
for ($c = 0; $c < $row['hsize']; $c++) {
if (isset($skip_field[$r][$c])) {
continue;
}
$sql = 'SELECT * FROM screens_items WHERE screenid=' . $screenid . ' AND x=' . $c . ' AND y=' . $r;
$iresult = DBSelect($sql);
$irow = DBfetch($iresult);
if ($irow) {
$colspan = $irow['colspan'];
$rowspan = $irow['rowspan'];
} else {
$colspan = 0;
$rowspan = 0;
}
for ($i = 0; $i < $rowspan || $i == 0; $i++) {
for ($j = 0; $j < $colspan || $j == 0; $j++) {
if ($i != 0 || $j != 0) {
$skip_field[$r + $i][$c + $j] = 1;
}
}
}
}
}
$table = new CTable(new CLink('No rows in screen ' . $row['name'], 'screenconf.php?config=0&form=update&screenid=' . $screenid), $editmode == 0 || $editmode == 2 ? 'screen_view' : 'screen_edit');
$table->addOption('id', 'iframe');
if ($editmode == 1) {
$add_col_link = 'screenedit.php?config=1&screenid=' . $screenid . '&add_col=';
$new_cols = array(new Ccol(new Cimg('images/general/zero.gif', 'zero', 1, 1)));
for ($c = 0; $c < $row['hsize'] + 1; $c++) {
array_push($new_cols, new Ccol(new Clink(new Cimg('images/general/closed.gif'), $add_col_link . $c)));
}
$table->addRow($new_cols);
}
$empty_screen_col = array();
for ($r = 0; $r < $row['vsize']; $r++) {
$new_cols = array();
$empty_screen_row = true;
if ($editmode == 1) {
$add_row_link = 'screenedit.php?config=1&screenid=' . $screenid . '&add_row=';
array_push($new_cols, new Ccol(new Clink(new Cimg('images/general/closed.gif'), $add_row_link . $r)));
}
for ($c = 0; $c < $row['hsize']; $c++) {
$item = array();
if (isset($skip_field[$r][$c])) {
continue;
}
$item_form = false;
$iresult = DBSelect('SELECT * FROM screens_items WHERE screenid=' . $screenid . ' AND x=' . $c . ' AND y=' . $r);
$irow = DBfetch($iresult);
if ($irow) {
$screenitemid = $irow['screenitemid'];
$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 {
$screenitemid = 0;
$resourcetype = 0;
$resourceid = 0;
$width = 0;
$height = 0;
$colspan = 0;
$rowspan = 0;
$elements = 0;
$valign = VALIGN_DEFAULT;
$halign = HALIGN_DEFAULT;
$style = 0;
$url = '';
$dynamic = 0;
}
if ($screenitemid > 0) {
$empty_screen_row = false;
$empty_screen_col[$c] = 1;
}
if ($editmode == 1 && $screenitemid != 0) {
$onclick_action = "ZBX_SCREENS['" . $_REQUEST['screenid'] . "'].screen.element_onclick('screenedit.php?form=update" . url_param('screenid') . '&screenitemid=' . $screenitemid . "#form');";
$action = 'screenedit.php?form=update' . url_param('screenid') . '&screenitemid=' . $screenitemid . '#form';
//.........这里部分代码省略.........
示例8: CSpan
$refresh_menu->addOption('title', S_MENU);
$right_tab->addRow(create_hat(S_STATUS_OF_ZABBIX, new CSpan(S_LOADING_P, 'textcolorstyles'), array($refresh_menu), 'hat_stszbx', get_profile('web.dashboard.hats.hat_stszbx.state', 1)));
$refresh_menu = new CDiv(SPACE, 'iconmenu');
$refresh_menu->addAction('onclick', 'javascript: create_page_menu(event,"hat_lastiss");');
$refresh_menu->addOption('title', S_MENU);
$right_tab->addRow(create_hat(S_LAST_20_ISSUES, new CSpan(S_LOADING_P, 'textcolorstyles'), array($refresh_menu), 'hat_lastiss', get_profile('web.dashboard.hats.hat_lastiss.state', 1)));
$refresh_menu = new CDiv(SPACE, 'iconmenu');
$refresh_menu->addAction('onclick', 'javascript: create_page_menu(event,"hat_webovr");');
$refresh_menu->addOption('title', S_MENU);
$right_tab->addRow(create_hat(S_WEB_MONITORING, new CSpan(S_LOADING_P, 'textcolorstyles'), array($refresh_menu), 'hat_webovr', get_profile('web.dashboard.hats.hat_webovr.state', 1)));
$drules = DBfetch(DBselect('SELECT COUNT(d.druleid) as cnt FROM drules d WHERE ' . DBin_node('d.druleid') . ' AND d.status=' . DRULE_STATUS_ACTIVE));
if ($drules['cnt'] > 0 && check_right_on_discovery(PERM_READ_ONLY)) {
$refresh_tab[] = array('id' => 'hat_dscvry', 'frequency' => get_profile('web.dahsboard.rf_rate.hat_dscvry', 60));
$refresh_menu = new CDiv(SPACE, 'iconmenu');
$refresh_menu->addAction('onclick', 'javascript: create_page_menu(event,"hat_dscvry");');
$refresh_menu->addOption('title', S_MENU);
$right_tab->addRow(create_hat(S_DISCOVERY_STATUS, new CSpan(S_LOADING_P, 'textcolorstyles'), array($refresh_menu), 'hat_dscvry', get_profile('web.dashboard.hats.hat_dscvry.state', 1)));
}
add_doll_objects($refresh_tab);
/*
$right_tab->addRow(create_hat(
S_GRAPH,
null,//make_webmon_overview(),
null,
'hat_custom',
get_profile('web.dashboard.hats.hat_custom.state',1)
));
*/
$td_l = new CCol($left_tab);
$td_l->addOption('valign', 'top');
$td_r = new CCol($right_tab);
示例9: array
$cmbGroups->addItem($groupid, get_node_name_by_elid($groupid) . $name);
}
foreach ($PAGE_HOSTS['hosts'] as $hostid => $name) {
$cmbHosts->addItem($hostid, get_node_name_by_elid($hostid) . $name);
}
$r_form->addItem(array(S_GROUP . SPACE, $cmbGroups));
$r_form->addItem(array(SPACE . S_HOST . SPACE, $cmbHosts));
$r_form->addVar('fullscreen', $_REQUEST['fullscreen']);
$p_elemetns = array();
$text = array(S_STATUS_OF_TRIGGERS_BIG, SPACE);
$url = 'tr_status.php' . ($_REQUEST['fullscreen'] ? '' : '?fullscreen=1');
$fs_icon = new CDiv(SPACE, 'fullscreen');
$fs_icon->addOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
$fs_icon->addAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
$mute_icon = new CDiv(SPACE, $mute ? 'iconmute' : 'iconsound');
$mute_icon->addOption('title', S_SOUND . ' ' . S_ON . '/' . S_OFF);
$mute_icon->addAction('onclick', new CScript("javascript: switch_mute(this);"));
$tr_numrows = new CSpan(null, 'info');
$tr_numrows->addOption('name', 'tr_numrows');
$p_elements[] = get_table_header(array(S_TRIGGERS, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $tr_numrows, SPACE . SPACE . SPACE . S_UPDATED . ': ', new CSpan(date(S_DATE_FORMAT_YMDHMS), 'info')), $r_form);
/************************* FILTER **************************/
/***********************************************************/
$filterForm = new CFormTable(S_FILTER);
//,'tr_status.php?filter_set=1','POST',null,'sform');
$filterForm->addOption('name', 'zbx_filter');
$filterForm->addOption('id', 'zbx_filter');
$filterForm->SetMethod('post');
$filterForm->addVar('fullscreen', $_REQUEST['fullscreen']);
$filterForm->addVar('groupid', $_REQUEST['groupid']);
$filterForm->addVar('hostid', $_REQUEST['hostid']);
$tr_select = new CComboBox('show_triggers', $show_triggers, 'javasctipt: submit();');