本文整理汇总了PHP中CSpan::onClick方法的典型用法代码示例。如果您正苦于以下问题:PHP CSpan::onClick方法的具体用法?PHP CSpan::onClick怎么用?PHP CSpan::onClick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSpan
的用法示例。
在下文中一共展示了CSpan::onClick方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($url = 'index.php', $side = null)
{
if (is_null($side)) {
$side = 'right';
}
if ($side == 'right') {
$pside = 'left';
} else {
$side = 'left';
$pside = 'right';
}
parent::__construct(new CDiv(SPACE, 'iconhelp'), 'http://www.zabbix.com/documentation.php');
//'http://www.zabbix.com/manual/v1.1/'.$url);
parent::onClick('window.open("http://www.zabbix.com/documentation.php");');
$this->attributes['style'] = 'padding-' . $pside . ': 5px; float:' . $side . ';text-decoration: none;';
$this->attributes['target'] = '_blank';
}
示例2: bar_report_form2
function bar_report_form2()
{
global $USER_DETAILS;
$config = get_request('config', 1);
$title = get_request('title', S_REPORT . ' 2');
$xlabel = get_request('xlabel', '');
$ylabel = get_request('ylabel', '');
$sorttype = get_request('sorttype', 0);
$captions = get_request('captions', array());
$items = get_request('items', array());
$periods = get_request('periods', array());
$showlegend = get_request('showlegend', 0);
$reportForm = new CFormTable(null, null, 'get');
//,'events.php?report_set=1','POST',null,'sform');
$reportForm->setAttribute('name', 'zbx_report');
$reportForm->setAttribute('id', 'zbx_report');
// $reportForm->setMethod('post');
if (isset($_REQUEST['report_show']) && !empty($items)) {
$reportForm->addVar('report_show', 'show');
}
$reportForm->addVar('config', $config);
$reportForm->addVar('items', $items);
// periods add later
$reportForm->addRow(S_TITLE, new CTextBox('title', $title, 40));
$reportForm->addRow(S_X . SPACE . S_LABEL, new CTextBox('xlabel', $xlabel, 40));
$reportForm->addRow(S_Y . SPACE . S_LABEL, new CTextBox('ylabel', $ylabel, 40));
$reportForm->addRow(S_LEGEND, new CCheckBox('showlegend', $showlegend, null, 1));
if (count($periods) < 2) {
$sortCmb = new CComboBox('sorttype', $sorttype);
$sortCmb->addItem(0, S_NAME);
$sortCmb->addItem(1, S_VALUE);
$reportForm->addRow(S_SORT_BY, $sortCmb);
} else {
$reportForm->addVar('sortorder', 0);
}
//*/
// PERIODS
if (count($periods)) {
$periods_table = new CTableInfo();
foreach ($periods as $pid => $period) {
$color = new CColorCell(null, $period['color']);
$edit_link = 'popup_period.php?period_id=' . $pid . '&config=2' . '&dstfrm=' . $reportForm->getName() . '&caption=' . $period['caption'] . '&report_timesince=' . $period['report_timesince'] . '&report_timetill=' . $period['report_timetill'] . '&color=' . $period['color'];
$caption = new CSpan($period['caption'], 'link');
$caption->addAction('onclick', "return PopUp('" . $edit_link . "',840,340,'period_form');");
$periods_table->addRow(array(new CCheckBox('group_pid[' . $pid . ']'), $caption, zbx_date2str(S_REPORTS_BAR_REPORT_DATE_FORMAT, $period['report_timesince']), zbx_date2str(S_REPORTS_BAR_REPORT_DATE_FORMAT, $period['report_timetill']), $color));
}
$delete_button = new CButton('delete_period', S_DELETE_SELECTED);
} else {
$periods_table = $delete_button = null;
}
$reportForm->addVar('periods', $periods);
$reportForm->addRow(S_PERIOD, array($periods_table, new CButton('add_period', S_ADD, "return PopUp('popup_period.php?config=2&dstfrm=" . $reportForm->getName() . "',840,340,'period_form');"), $delete_button));
unset($periods_table, $delete_button);
//-----------
// ITEMS
if (count($items)) {
$items_table = new CTableInfo();
foreach ($items as $gid => $gitem) {
$host = get_host_by_itemid($gitem['itemid']);
$item = get_item_by_itemid($gitem['itemid']);
if ($host['status'] == HOST_STATUS_TEMPLATE) {
$only_hostid = $host['hostid'];
} else {
$monitored_hosts = 1;
}
$caption = new CSpan($gitem['caption'], 'link');
$caption->onClick('return PopUp("popup_bitem.php?config=2&list_name=items&dstfrm=' . $reportForm->GetName() . url_param($gitem, false) . url_param($gid, false, 'gid') . '",550,400,"graph_item_form");');
$description = $host['host'] . ': ' . item_description($item);
$items_table->addRow(array(new CCheckBox('group_gid[' . $gid . ']', isset($group_gid[$gid])), $caption, $description, graph_item_calc_fnc2str($gitem['calc_fnc'], 0)));
}
$delete_button = new CButton('delete_item', S_DELETE_SELECTED);
} else {
$items_table = $delete_button = null;
}
$reportForm->addRow(S_ITEMS, array($items_table, new CButton('add_item', S_ADD, "return PopUp('popup_bitem.php?config=2&dstfrm=" . $reportForm->getName() . "',550,400,'graph_item_form');"), $delete_button));
unset($items_table, $delete_button);
//--------------
$reportForm->addItemToBottomRow(new CButton('report_show', S_SHOW));
$reset = new CButton('reset', S_RESET);
$reset->setType('reset');
$reportForm->addItemToBottomRow($reset);
return $reportForm;
}
示例3: prepareSubfilterOutput
function prepareSubfilterOutput($data, $subfilter, $subfilterName)
{
order_result($data, 'name');
$output = array();
foreach ($data as $id => $element) {
$element['name'] = nbsp(CHtml::encode($element['name']));
// is activated
if (str_in_array($id, $subfilter)) {
$span = new CSpan($element['name'] . SPACE . '(' . $element['count'] . ')', 'subfilter_enabled');
$span->onClick(CHtml::encode('javascript: create_var("zbx_filter", "subfilter_set", "1", false);' . 'create_var("zbx_filter", ' . CJs::encodeJson($subfilterName . '[' . $id . ']') . ', null, true);'));
$output[] = $span;
} else {
// subfilter has 0 items
if ($element['count'] == 0) {
$span = new CSpan($element['name'] . SPACE . '(' . $element['count'] . ')', 'subfilter_inactive');
$output[] = $span;
} else {
// this level has no active subfilters
$nspan = $subfilter ? new CSpan(SPACE . '(+' . $element['count'] . ')', 'subfilter_active') : new CSpan(SPACE . '(' . $element['count'] . ')', 'subfilter_active');
$span = new CSpan($element['name'], 'subfilter_disabled');
$span->onClick(CHtml::encode('javascript: create_var("zbx_filter", "subfilter_set", "1", false);' . 'create_var("zbx_filter", ' . CJs::encodeJson($subfilterName . '[' . $id . ']') . ', ' . CJs::encodeJson($id) . ', ' . 'true' . ');'));
$output[] = $span;
$output[] = $nspan;
}
}
$output[] = ', ';
}
array_pop($output);
return $output;
}
示例4: valueDistributionFormForMultipleItems
/**
* Create bar report form for "Distribution of values for multiple items".
*
* @param array $items
* @param array $periods
*
* @return object $reportForm
*/
function valueDistributionFormForMultipleItems($items = array(), $periods = array())
{
$config = get_request('config', 1);
$title = get_request('title', _('Report 2'));
$xlabel = get_request('xlabel', '');
$ylabel = get_request('ylabel', '');
$sorttype = get_request('sorttype', 0);
$showlegend = get_request('showlegend', 0);
$reportForm = new CFormTable(null, null, 'get');
$reportForm->setAttribute('name', 'zbx_report');
$reportForm->setAttribute('id', 'zbx_report');
if (isset($_REQUEST['report_show']) && is_array($items) && $items && is_array($periods) && $periods) {
$reportForm->addVar('report_show', 'show');
}
$reportForm->addVar('config', $config);
$reportForm->addRow(_('Title'), new CTextBox('title', $title, 40));
$reportForm->addRow(_('X label'), new CTextBox('xlabel', $xlabel, 40));
$reportForm->addRow(_('Y label'), new CTextBox('ylabel', $ylabel, 40));
$reportForm->addRow(_('Legend'), new CCheckBox('showlegend', $showlegend, null, 1));
if (count($periods) < 2) {
$sortCmb = new CComboBox('sorttype', $sorttype);
$sortCmb->addItem(0, _('Name'));
$sortCmb->addItem(1, _('Value'));
$reportForm->addRow(_('Sort by'), $sortCmb);
} else {
$reportForm->addVar('sortorder', 0);
}
if (is_array($periods) && $periods) {
$periods_table = new CTableInfo();
foreach ($periods as $pid => $period) {
$color = new CColorCell(null, $period['color']);
$edit_link = 'popup_period.php?' . 'period_id=' . $pid . '&config=2' . '&dstfrm=' . $reportForm->getName() . '&caption=' . $period['caption'] . '&report_timesince=' . $period['report_timesince'] . '&report_timetill=' . $period['report_timetill'] . '&color=' . $period['color'];
$caption = new CSpan($period['caption'], 'link');
$caption->addAction('onclick', "return PopUp('" . $edit_link . "',840,340,'period_form');");
$periods_table->addRow(array(new CCheckBox('group_pid[' . $pid . ']'), $caption, zbx_date2str(REPORTS_BAR_REPORT_DATE_FORMAT, $period['report_timesince']), zbx_date2str(REPORTS_BAR_REPORT_DATE_FORMAT, $period['report_timetill']), $color));
}
$reportForm->addVar('periods', $periods);
$delete_button = new CSubmit('delete_period', _('Delete selected'));
} else {
$periods_table = $delete_button = null;
}
$reportForm->addRow(_('Period'), array($periods_table, new CButton('add_period', _('Add'), 'return PopUp("popup_period.php?config=2&dstfrm=' . $reportForm->getName() . '", 840, 340, "period_form");'), $delete_button));
unset($periods_table, $delete_button);
if (is_array($items) && $items) {
$items_table = new CTableInfo();
foreach ($items as $id => &$item) {
$caption = new CSpan($item['caption'], 'link');
$caption->onClick('return PopUp("popup_bitem.php?' . 'config=2' . '&list_name=items' . '&dstfrm=' . $reportForm->GetName() . url_param($item, false) . url_param($id, false, 'gid') . '", 550, 400, "graph_item_form");');
$description = $item['host']['name'] . NAME_DELIMITER . itemName($item);
$items_table->addRow(array(new CCheckBox('group_gid[' . $id . ']', isset($group_gid[$id])), $caption, $description, graph_item_calc_fnc2str($item['calc_fnc'], 0)));
// once used, unset unnecessary fields so they don't pass to URL. "color" goes in "periods" parameter.
unset($item['value_type'], $item['host'], $item['name'], $item['color']);
}
unset($item);
$reportForm->addVar('items', $items);
$delete_button = new CSubmit('delete_item', _('Delete selected'));
} else {
$items_table = $delete_button = null;
}
$reportForm->addRow(_('Items'), array($items_table, new CButton('add_item', _('Add'), "return PopUp('popup_bitem.php?config=2&dstfrm=" . $reportForm->getName() . "', 550, 400, 'graph_item_form');"), $delete_button));
unset($items_table, $delete_button);
$reportForm->addItemToBottomRow(new CSubmit('report_show', _('Show')));
$reset = new CButton('reset', _('Reset'));
$reset->setType('reset');
$reportForm->addItemToBottomRow($reset);
return $reportForm;
}
示例5: CSpan
if (!isset($step['url'])) {
$step['url'] = '';
}
if (!isset($step['posts'])) {
$step['posts'] = '';
}
if (!isset($step['required'])) {
$step['required'] = '';
}
$numSpan = new CSpan($i++ . ':');
$numSpan->addClass('rowNum');
$numSpan->setAttribute('id', 'current_step_' . $stepid);
$name = new CSpan($step['name'], 'link');
$name->setAttribute('id', 'name_' . $stepid);
$name->setAttribute('name_step', $stepid);
$name->onClick('return PopUp("popup_httpstep.php?dstfrm=' . $httpForm->getName() . '&list_name=steps&stepid="+jQuery(this).attr("name_step")+"' . url_param($step['name'], false, 'name') . url_param($step['timeout'], false, 'timeout') . url_param($step['url'], false, 'url') . url_param($step['posts'], false, 'posts') . url_param($step['required'], false, 'required') . url_param($step['status_codes'], false, 'status_codes') . '", 600, 410);');
if (zbx_strlen($step['url']) > 70) {
$url = new CSpan(substr($step['url'], 0, 35) . SPACE . '...' . SPACE . substr($step['url'], zbx_strlen($step['url']) - 25, 25));
$url->setHint($step['url']);
} else {
$url = $step['url'];
}
$removeButton = new CButton('remove_' . $stepid, _('Remove'), 'javascript: removeStep(this);', 'link_menu');
$removeButton->setAttribute('remove_step', $stepid);
$row = new CRow(array(new CSpan(null, 'ui-icon ui-icon-arrowthick-2-n-s move'), $numSpan, $name, $step['timeout'] . SPACE . _('sec'), $url, htmlspecialchars($step['required']), $step['status_codes'], $removeButton), 'sortable');
$row->setAttribute('id', 'steps_' . $stepid);
$stepsTable->addRow($row);
}
$tmpColumn = new CCol(new CButton('add_step', _('Add'), 'return PopUp("popup_httpstep.php?dstfrm=' . $httpForm->getName() . '", 600, 410);', 'link_menu'), null, 8);
$tmpColumn->setAttribute('style', 'vertical-align: middle;');
$stepsTable->addRow(new CRow($tmpColumn));
示例6: bar_report_form2
function bar_report_form2()
{
$config = get_request('config', 1);
$title = get_request('title', _('Report 2'));
$xlabel = get_request('xlabel', '');
$ylabel = get_request('ylabel', '');
$sorttype = get_request('sorttype', 0);
$items = get_request('items', array());
$periods = get_request('periods', array());
$showlegend = get_request('showlegend', 0);
$reportForm = new CFormTable(null, null, 'get');
//,'events.php?report_set=1','POST',null,'sform');
$reportForm->setAttribute('name', 'zbx_report');
$reportForm->setAttribute('id', 'zbx_report');
// $reportForm->setMethod('post');
if (isset($_REQUEST['report_show']) && !empty($items)) {
$reportForm->addVar('report_show', 'show');
}
$reportForm->addVar('config', $config);
$reportForm->addVar('items', $items);
// periods add later
$reportForm->addRow(_('Title'), new CTextBox('title', $title, 40));
$reportForm->addRow(_('X label'), new CTextBox('xlabel', $xlabel, 40));
$reportForm->addRow(_('Y label'), new CTextBox('ylabel', $ylabel, 40));
$reportForm->addRow(_('Legend'), new CCheckBox('showlegend', $showlegend, null, 1));
if (count($periods) < 2) {
$sortCmb = new CComboBox('sorttype', $sorttype);
$sortCmb->addItem(0, _('Name'));
$sortCmb->addItem(1, _('Value'));
$reportForm->addRow(_('Sort by'), $sortCmb);
} else {
$reportForm->addVar('sortorder', 0);
}
//*/
// PERIODS
if (count($periods)) {
$periods_table = new CTableInfo();
foreach ($periods as $pid => $period) {
$color = new CColorCell(null, $period['color']);
$edit_link = 'popup_period.php?period_id=' . $pid . '&config=2' . '&dstfrm=' . $reportForm->getName() . '&caption=' . $period['caption'] . '&report_timesince=' . $period['report_timesince'] . '&report_timetill=' . $period['report_timetill'] . '&color=' . $period['color'];
$caption = new CSpan($period['caption'], 'link');
$caption->addAction('onclick', "return PopUp('" . $edit_link . "',840,340,'period_form');");
$periods_table->addRow(array(new CCheckBox('group_pid[' . $pid . ']'), $caption, zbx_date2str(REPORTS_BAR_REPORT_DATE_FORMAT, $period['report_timesince']), zbx_date2str(REPORTS_BAR_REPORT_DATE_FORMAT, $period['report_timetill']), $color));
}
$delete_button = new CSubmit('delete_period', _('Delete selected'));
} else {
$periods_table = $delete_button = null;
}
$reportForm->addVar('periods', $periods);
$reportForm->addRow(_('Period'), array($periods_table, new CButton('add_period', _('Add'), "return PopUp('popup_period.php?config=2&dstfrm=" . $reportForm->getName() . "',840,340,'period_form');"), $delete_button));
unset($periods_table, $delete_button);
//-----------
// ITEMS
if (count($items)) {
$items_table = new CTableInfo();
foreach ($items as $gid => $gitem) {
$host = get_host_by_itemid($gitem['itemid']);
$item = get_item_by_itemid($gitem['itemid']);
$caption = new CSpan($gitem['caption'], 'link');
$caption->onClick('return PopUp("popup_bitem.php?config=2&list_name=items&dstfrm=' . $reportForm->GetName() . url_param($gitem, false) . url_param($gid, false, 'gid') . '",550,400,"graph_item_form");');
$description = $host['name'] . ': ' . itemName($item);
$items_table->addRow(array(new CCheckBox('group_gid[' . $gid . ']', isset($group_gid[$gid])), $caption, $description, graph_item_calc_fnc2str($gitem['calc_fnc'], 0)));
}
$delete_button = new CSubmit('delete_item', _('Delete selected'));
} else {
$items_table = $delete_button = null;
}
$reportForm->addRow(_('Items'), array($items_table, new CButton('add_item', _('Add'), "return PopUp('popup_bitem.php?config=2&dstfrm=" . $reportForm->getName() . "',550,400,'graph_item_form');"), $delete_button));
unset($items_table, $delete_button);
//--------------
$reportForm->addItemToBottomRow(new CSubmit('report_show', _('Show')));
$reset = new CButton('reset', _('Reset'));
$reset->setType('reset');
$reportForm->addItemToBottomRow($reset);
return $reportForm;
}
示例7: CTableInfo
$table->addRow($name);
}
$table->show();
} else {
if ($srctbl == "users") {
$table = new CTableInfo(S_NO_USERS_DEFINED);
$table->setHeader(array(S_ALIAS, S_NAME, S_SURNAME));
$result = DBselect('SELECT * FROM users WHERE ' . DBin_node('userid') . ' ORDER BY alias');
while ($row = DBfetch($result)) {
if (isset($_REQUEST['reference']) && $_REQUEST['reference'] == 'dashboard') {
$action = get_window_opener($dstfrm, $dstfld1, $srcfld2) . get_window_opener($dstfrm, $dstfld2, $row[$srcfld2]) . "window.opener.setTimeout('add2favorites();', 1000);";
} else {
$action = get_window_opener($dstfrm, $dstfld1, $row[$srcfld1]) . (isset($srcfld2) ? get_window_opener($dstfrm, $dstfld2, $row[$srcfld2]) : '') . (isset($_REQUEST['submit']) ? " window.opener.document.getElementsByName('{$dstfrm}')[0].submit();" : '');
}
$alias = new CSpan(get_node_name_by_elid($row['userid']) . $row['alias'], 'link');
$alias->onClick($action . ' close_window(); return false;');
$table->addRow(array($alias, $row['name'], $row['surname']));
}
$table->Show();
} else {
if ($srctbl == "help_items") {
$table = new CTableInfo(S_NO_ITEMS);
$table->SetHeader(array(S_KEY, S_DESCRIPTION));
$result = DBselect("select * from help_items where itemtype=" . $itemtype . " ORDER BY key_");
while ($row = DBfetch($result)) {
$name = new CLink($row["key_"], "#", "action");
if (isset($_REQUEST['reference']) && $_REQUEST['reference'] == 'dashboard') {
$action = get_window_opener($dstfrm, $dstfld1, $srcfld2) . get_window_opener($dstfrm, $dstfld2, $row[$srcfld2]) . "window.opener.setTimeout('add2favorites();', 1000);";
} else {
$action = get_window_opener($dstfrm, $dstfld1, html_entity_decode($row[$srcfld1])) . (isset($srcfld2) ? get_window_opener($dstfrm, $dstfld2, $row[$srcfld2]) : '');
}
示例8: prepare_subfilter_output
function prepare_subfilter_output($data, $subfilter, $subfilter_name)
{
$output = array();
order_result($data, 'name');
foreach ($data as $id => $element) {
// subfilter is activated
if (str_in_array($id, $subfilter)) {
$span = new CSpan($element['name'] . ' (' . $element['count'] . ')', 'subfilter_enabled');
$script = CHtml::encode('javascript: create_var("zbx_filter", ' . CJs::encodeJson($subfilter_name . '[' . $id . ']') . ', null, true);');
$span->onClick($script);
$output[] = $span;
} else {
$script = CHtml::encode('javascript: create_var("zbx_filter", ' . CJs::encodeJson($subfilter_name . '[' . $id . ']') . ', ' . CJs::encodeJson($id) . ', true);');
// subfilter has 0 items
if ($element['count'] == 0) {
$span = new CSpan($element['name'] . ' (' . $element['count'] . ')', 'subfilter_inactive');
$span->onClick($script);
$output[] = $span;
} else {
// this level has no active subfilters
if (empty($subfilter)) {
$nspan = new CSpan(' (' . $element['count'] . ')', 'subfilter_active');
} else {
$nspan = new CSpan(' (+' . $element['count'] . ')', 'subfilter_active');
}
$span = new CSpan($element['name'], 'subfilter_disabled');
$span->onClick($script);
$output[] = $span;
$output[] = $nspan;
}
}
$output[] = ' , ';
}
array_pop($output);
return $output;
}
示例9: insert_graph_form
//.........这里部分代码省略.........
$cmbGType->addItem(GRAPH_TYPE_NORMAL, S_NORMAL);
$cmbGType->addItem(GRAPH_TYPE_STACKED, S_STACKED);
$cmbGType->addItem(GRAPH_TYPE_PIE, S_PIE);
$cmbGType->addItem(GRAPH_TYPE_EXPLODED, S_EXPLODED);
zbx_add_post_js('graphs.graphtype = ' . $graphtype . ";\n");
$frmGraph->addRow(S_GRAPH_TYPE, $cmbGType);
// items beforehead, to get only_hostid for miny maxy items
$only_hostid = null;
$monitored_hosts = null;
if (count($items)) {
$frmGraph->addVar('items', $items);
$keys = array_keys($items);
$first = reset($keys);
$last = end($keys);
$items_table = new CTableInfo();
foreach ($items as $gid => $gitem) {
//if($graphtype == GRAPH_TYPE_STACKED && $gitem['type'] == GRAPH_ITEM_AGGREGATED) continue;
$host = get_host_by_itemid($gitem['itemid']);
$item = get_item_by_itemid($gitem['itemid']);
if ($host['status'] == HOST_STATUS_TEMPLATE) {
$only_hostid = $host['hostid'];
} else {
$monitored_hosts = 1;
}
if ($gitem['type'] == GRAPH_ITEM_AGGREGATED) {
$color = '-';
} else {
$color = new CColorCell(null, $gitem['color']);
}
if ($gid == $first) {
$do_up = null;
} else {
$do_up = new CSpan(S_UP, 'link');
$do_up->onClick("return create_var('" . $frmGraph->getName() . "','move_up'," . $gid . ", true);");
}
if ($gid == $last) {
$do_down = null;
} else {
$do_down = new CSpan(S_DOWN, 'link');
$do_down->onClick("return create_var('" . $frmGraph->getName() . "','move_down'," . $gid . ", true);");
}
$description = new CSpan($host['host'] . ': ' . item_description($item), 'link');
$description->onClick('return PopUp("popup_gitem.php?list_name=items&dstfrm=' . $frmGraph->getName() . url_param($only_hostid, false, 'only_hostid') . url_param($monitored_hosts, false, 'monitored_hosts') . url_param($graphtype, false, 'graphtype') . url_param($gitem, false) . url_param($gid, false, 'gid') . url_param(get_request('graphid', 0), false, 'graphid') . '",550,400,"graph_item_form");');
if ($graphtype == GRAPH_TYPE_PIE || $graphtype == GRAPH_TYPE_EXPLODED) {
$items_table->addRow(array(new CCheckBox('group_gid[' . $gid . ']', isset($group_gid[$gid])), $description, graph_item_calc_fnc2str($gitem["calc_fnc"], $gitem["type"]), graph_item_type2str($gitem['type'], $gitem["periods_cnt"]), $color, array($do_up, SPACE . "|" . SPACE, $do_down)));
} else {
$items_table->addRow(array(new CCheckBox('group_gid[' . $gid . ']', isset($group_gid[$gid])), $description, graph_item_calc_fnc2str($gitem["calc_fnc"], $gitem["type"]), graph_item_type2str($gitem['type'], $gitem["periods_cnt"]), $gitem['yaxisside'] == GRAPH_YAXIS_SIDE_LEFT ? S_LEFT : S_RIGHT, graph_item_drawtype2str($gitem["drawtype"], $gitem["type"]), $color, array($do_up, !is_null($do_up) && !is_null($do_down) ? SPACE . "|" . SPACE : '', $do_down)));
}
}
$dedlete_button = new CButton('delete_item', S_DELETE_SELECTED);
} else {
$items_table = $dedlete_button = null;
}
// $frmGraph->addRow(S_SHOW_LEGEND, new CCheckBox('legend',$legend, null, 1));
if ($graphtype == GRAPH_TYPE_NORMAL || $graphtype == GRAPH_TYPE_STACKED) {
$frmGraph->addRow(S_SHOW_WORKING_TIME, new CCheckBox('showworkperiod', $showworkperiod, null, 1));
$frmGraph->addRow(S_SHOW_TRIGGERS, new CCheckBox('showtriggers', $showtriggers, null, 1));
if ($graphtype == GRAPH_TYPE_NORMAL) {
$percent_left = sprintf('%2.2f', $percent_left);
$percent_right = sprintf('%2.2f', $percent_right);
$pr_left_input = new CTextBox('percent_left', $percent_left, '5');
$pr_left_chkbx = new CCheckBox('visible[percent_left]', 1, "javascript: ShowHide('percent_left');", 1);
if ($percent_left == 0) {
$pr_left_input->setAttribute('style', 'display: none;');
$pr_left_chkbx->setChecked(0);
}
示例10: CForm
}
} else {
$frmForm = new CForm();
$frmForm->setMethod('get');
$frmForm->addItem(array(S_GROUP . SPACE, $pageFilter->getGroupsCB()));
$numrows = new CDiv();
$numrows->setAttribute('name', 'numrows');
$hosts_wdgt->addHeader(S_HOSTS_BIG, $frmForm);
$hosts_wdgt->addHeader($numrows);
// HOSTS FILTER {{{
$filter_table = new CTable('', 'filter_config');
$filter_table->addRow(array(array(array(bold(S_HOST), SPACE . S_LIKE_SMALL . ': '), new CTextBox('filter_host', $_REQUEST['filter_host'], 20)), array(array(bold(S_DNS), SPACE . S_LIKE_SMALL . ': '), new CTextBox('filter_dns', $_REQUEST['filter_dns'], 20)), array(array(bold(S_IP), SPACE . S_LIKE_SMALL . ': '), new CTextBox('filter_ip', $_REQUEST['filter_ip'], 20)), array(bold(S_PORT . ': '), new CTextBox('filter_port', $_REQUEST['filter_port'], 20))));
$reset = new CSpan(S_RESET, 'biglink');
$reset->onClick("javascript: clearAllForm('zbx_filter');");
$filter = new CSpan(S_FILTER, 'biglink');
$filter->onClick("javascript: create_var('zbx_filter', 'filter_set', '1', true);");
$footer_col = new CCol(array($filter, SPACE, SPACE, SPACE, $reset), 'center');
$footer_col->setColSpan(4);
$filter_table->addRow($footer_col);
$filter_form = new CForm(null, 'get');
$filter_form->setAttribute('name', 'zbx_filter');
$filter_form->setAttribute('id', 'zbx_filter');
$filter_form->addItem($filter_table);
// }}} HOSTS FILTER
$hosts_wdgt->addFlicker($filter_form, CProfile::get('web.hosts.filter.state', 0));
// table HOSTS
$form = new CForm();
$form->setName('hosts');
$table = new CTableInfo(S_NO_HOSTS_DEFINED);
$table->setHeader(array(new CCheckBox('all_hosts', null, "checkAll('" . $form->getName() . "','all_hosts','hosts');"), make_sorting_header(S_NAME, 'host'), S_APPLICATIONS, S_ITEMS, S_TRIGGERS, S_GRAPHS, make_sorting_header(S_DNS, 'dns'), make_sorting_header(S_IP, 'ip'), S_PORT, S_TEMPLATES, make_sorting_header(S_STATUS, 'status'), S_AVAILABILITY));
// get Hosts
示例11: DBcondition
$table->SetHeader($header);
$sql = 'SELECT h.host,t.triggerid,t.description,t.expression,t.priority,t.status,count(d.triggerid_up) as dep_count ' . ' FROM hosts h,items i,functions f, triggers t' . ' LEFT JOIN trigger_depends d ON d.triggerid_down=t.triggerid ' . ' WHERE f.itemid=i.itemid ' . ' AND h.hostid=i.hostid ' . ' AND t.triggerid=f.triggerid' . ' AND ' . DBin_node('t.triggerid', $nodeid) . ' AND ' . DBcondition('t.triggerid', $available_triggers) . ' AND h.status in (' . implode(',', $host_status) . ')';
if ($hostid > 0) {
$sql .= ' AND h.hostid=' . $hostid;
}
$sql .= ' GROUP BY h.host, t.triggerid, t.description, t.expression, t.priority, t.status' . ' ORDER BY h.host,t.description';
$result = DBselect($sql);
while ($row = DBfetch($result)) {
$exp_desc = expand_trigger_description_by_data($row);
$description = new CSpan($exp_desc, 'link');
if ($multiselect) {
$js_action = 'add_selected_values("' . S_TRIGGERS . '", "' . $dstfrm . '", "' . $dstfld1 . '", "' . $dstact . '", "' . $row["triggerid"] . '");';
} else {
$js_action = 'add_value("' . $dstfld1 . '", "' . $dstfld2 . '", "' . $row["triggerid"] . '", "' . $exp_desc . '");';
}
$description->onClick($js_action);
if ($row['dep_count'] > 0) {
$description = array($description, BR(), BR(), bold(S_DEPENDS_ON), BR());
$deps = get_trigger_dependencies_by_triggerid($row["triggerid"]);
foreach ($deps as $val) {
$description[] = array(expand_trigger_description($val), BR());
}
}
switch ($row["status"]) {
case TRIGGER_STATUS_DISABLED:
$status = new CSpan(S_DISABLED, 'disabled');
break;
case TRIGGER_STATUS_UNKNOWN:
$status = new CSpan(S_UNKNOWN, 'unknown');
break;
case TRIGGER_STATUS_ENABLED:
示例12: CSpan
if (!isset($s['timeout'])) {
$s['timeout'] = 15;
}
if (!isset($s['url'])) {
$s['url'] = '';
}
if (!isset($s['posts'])) {
$s['posts'] = '';
}
if (!isset($s['required'])) {
$s['required'] = '';
}
$up = null;
if ($stepid != $first) {
$up = new CSpan(S_UP, 'link');
$up->onClick("return create_var('" . $form->getName() . "','move_up'," . $stepid . ", true);");
}
$down = null;
if ($stepid != $last) {
$down = new CLink(S_DOWN, 'link');
$down->onClick("return create_var('" . $form->getName() . "','move_down'," . $stepid . ", true);");
}
$name = new CSpan($s['name'], 'link');
$name->onClick('return PopUp("popup_httpstep.php?dstfrm=' . $form->getName() . '&list_name=steps&stepid=' . $stepid . url_param($s['name'], false, 'name') . url_param($s['timeout'], false, 'timeout') . url_param($s['url'], false, 'url') . url_param($s['posts'], false, 'posts') . url_param($s['required'], false, 'required') . url_param($s['status_codes'], false, 'status_codes') . '");');
if (zbx_strlen($s['url']) > 70) {
$url = new CTag('span', 'yes', substr($s['url'], 0, 35) . SPACE . '...' . SPACE . substr($s['url'], zbx_strlen($s['url']) - 25, 25));
$url->setHint($s['url']);
} else {
$url = $s['url'];
}
$tblSteps->addRow(array(new CCheckBox('sel_step[]', null, null, $stepid), $name, $s['timeout'] . SPACE . S_SEC_SMALL, $url, $s['required'], $s['status_codes'], array($up, isset($up) && isset($down) ? SPACE : null, $down)));