本文整理汇总了PHP中CWidget::setClass方法的典型用法代码示例。如果您正苦于以下问题:PHP CWidget::setClass方法的具体用法?PHP CWidget::setClass怎么用?PHP CWidget::setClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CWidget
的用法示例。
在下文中一共展示了CWidget::setClass方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
} else {
if (isset($_REQUEST['delete'])) {
$del_groups = get_request('del_groups', array());
foreach ($del_groups as $gnum => $groupid) {
if (!isset($_REQUEST['groupids'][$groupid])) {
continue;
}
unset($_REQUEST['groupids'][$groupid]);
}
}
}
}
$dashboard_wdgt = new CWidget();
// Header
$dashboard_wdgt->setClass('header');
$dashboard_wdgt->addPageHeader(S_DASHBOARD_CONFIGURATION_BIG, SPACE);
//-------------
// GROUPS
$dashForm = new CFormTable(S_FILTER);
$dashForm->addVar('form_refresh', 1);
$dashForm->setName('dashconf');
$dashForm->setAttribute('id', 'dashform');
if (isset($_REQUEST['form_refresh'])) {
$filterEnable = get_request('filterEnable', 0);
$groupids = get_request('groupids', array());
$groupids = zbx_toHash($groupids);
$grpswitch = get_request('grpswitch', 0);
$maintenance = get_request('maintenance', 0);
$extAck = get_request('extAck', 0);
$severity = get_request('trgSeverity', array());
示例2: array
exit;
}
//--------
$options = array('triggerids' => $_REQUEST['triggerid'], 'output' => API_OUTPUT_EXTEND, 'select_hosts' => API_OUTPUT_EXTEND);
$trigger = CTrigger::get($options);
if (!$trigger) {
access_deny();
} else {
$trigger = reset($trigger);
$trigger['host'] = reset($trigger['hosts']);
$trigger['host'] = $trigger['host']['host'];
}
$trigger['exp_expr'] = explode_exp($trigger['expression'], 1, false, true);
$trigger['exp_desc'] = expand_trigger_description_by_data($trigger);
$tr_event_wdgt = new CWidget();
$tr_event_wdgt->setClass('header');
// Main widget header
$text = array(S_EVENTS_BIG . ': "' . $trigger['exp_desc'] . '"');
$fs_icon = get_icon('fullscreen', array('fullscreen' => $_REQUEST['fullscreen']));
$tr_event_wdgt->addHeader($text, $fs_icon);
//-------
$left_tab = new CTable();
$left_tab->setCellPadding(3);
$left_tab->setCellSpacing(3);
$left_tab->setAttribute('border', 0);
// tr details
$tr_dtl = new CWidget('hat_triggerdetails', make_trigger_details($_REQUEST['triggerid'], $trigger));
$tr_dtl->setClass('header');
$tr_dtl->addHeader(S_EVENT . SPACE . S_SOURCE . SPACE . S_DETAILS, SPACE);
$left_tab->addRow($tr_dtl);
//----------------
示例3: array
$submenu = array();
echo 'page_submenu["menu_screens"] = ' . zbx_jsvalue(make_screen_submenu()) . ';';
}
}
}
if ($page['type'] == PAGE_TYPE_JS || $page['type'] == PAGE_TYPE_HTML_BLOCK) {
require_once dirname(__FILE__) . '/include/page_footer.php';
exit;
}
// js templates
require_once dirname(__FILE__) . '/include/views/js/general.script.confirm.js.php';
/*
* Display
*/
$dashboardWidget = new CWidget('dashboard_wdgt');
$dashboardWidget->setClass('header');
$dashboardWidget->addHeader(_('PERSONAL DASHBOARD'), array(new CIcon(_s('Configure (Filter %s)', $dashconf['filterEnable'] ? _('Enabled') : _('Disabled')), $dashconf['filterEnable'] ? 'iconconfig_hl' : 'iconconfig', "document.location = 'dashconf.php';"), SPACE, get_icon('fullscreen', array('fullscreen' => $_REQUEST['fullscreen']))));
// js menu arrays
$menu = array();
$submenu = array();
make_graph_menu($menu, $submenu);
make_sysmap_menu($menu, $submenu);
make_screen_menu($menu, $submenu);
make_refresh_menu('mainpage', 'hat_syssum', CProfile::get('web.dashboard.rf_rate.hat_syssum', 60), null, $menu, $submenu);
make_refresh_menu('mainpage', 'hat_hoststat', CProfile::get('web.dashboard.rf_rate.hat_hoststat', 60), null, $menu, $submenu);
make_refresh_menu('mainpage', 'hat_stszbx', CProfile::get('web.dashboard.rf_rate.hat_stszbx', 60), null, $menu, $submenu);
make_refresh_menu('mainpage', 'hat_lastiss', CProfile::get('web.dashboard.rf_rate.hat_lastiss', 60), null, $menu, $submenu);
make_refresh_menu('mainpage', 'hat_webovr', CProfile::get('web.dashboard.rf_rate.hat_webovr', 60), null, $menu, $submenu);
make_refresh_menu('mainpage', 'hat_dscvry', CProfile::get('web.dashboard.rf_rate.hat_dscvry', 60), null, $menu, $submenu);
insert_js('var page_menu=' . zbx_jsvalue($menu) . ";\n" . 'var page_submenu=' . zbx_jsvalue($submenu) . ";\n");
/*
示例4: CWidget
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
$dashconfWidget = new CWidget();
$dashconfWidget->setClass('header');
$dashconfWidget->addPageHeader(_('DASHBOARD CONFIGURATION'));
// create form
$dashconfForm = new CForm();
$dashconfForm->setName('dashconf');
$dashconfForm->setAttribute('id', 'dashform');
$dashconfForm->addVar('filterEnable', $this->data['isFilterEnable']);
// create form list
$dashconfFormList = new CFormList('dashconfFormList');
// append filter status to form list
if ($this->data['isFilterEnable']) {
$filterStatusSpan = new CSpan(_('Enabled'), 'green underline pointer');
$filterStatusSpan->setAttribute('onclick', "create_var('" . $dashconfForm->getName() . "', 'filterEnable', 0, true);");
} else {
$filterStatusSpan = new CSpan(_('Disabled'), 'red underline pointer');
$filterStatusSpan->setAttribute('onclick', "\$('dashform').enable(); create_var('" . $dashconfForm->getName() . "', 'filterEnable', 1, true);");
示例5: array
}
}
}
if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) {
include_once 'include/page_footer.php';
exit;
}
$admin = uint_in_array($USER_DETAILS['type'], array(USER_TYPE_ZABBIX_ADMIN, USER_TYPE_SUPER_ADMIN));
$rows_per_page = $USER_DETAILS['rows_per_page'];
$search_wdgt = new CWidget('search_wdgt');
$search = get_request('search', '');
// Header
if (zbx_empty($search)) {
$search = S_SEARCH_PATTERN_EMPTY;
}
$search_wdgt->setClass('header');
$search_wdgt->addHeader(array(S_SEARCH_BIG . ': ', bold($search)), SPACE);
//-------------
$left_tab = new CTable();
$left_tab->setCellPadding(3);
$left_tab->setCellSpacing(3);
$left_tab->setAttribute('border', 0);
$right_tab = new CTable();
$right_tab->setCellPadding(3);
$right_tab->setCellSpacing(3);
$right_tab->setAttribute('border', 0);
// FIND Hosts
$params = array('nodeids' => get_current_nodeid(true), 'search' => array('host' => $search, 'dns' => $search, 'ip' => $search), 'limit' => $rows_per_page, 'select_groups' => API_OUTPUT_EXTEND, 'select_items' => API_OUTPUT_COUNT, 'select_triggers' => API_OUTPUT_COUNT, 'select_graphs' => API_OUTPUT_COUNT, 'select_applications' => API_OUTPUT_COUNT, 'output' => API_OUTPUT_EXTEND);
$db_hosts = CHost::get($params);
order_result($db_hosts, 'host');
$hosts = selectByPattern($db_hosts, 'host', $search, $rows_per_page);
示例6: dirname
CProfile::update('web.search.hats.' . $_REQUEST['favref'] . '.state', $_REQUEST['favstate'], PROFILE_TYPE_INT);
}
}
if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) {
require_once dirname(__FILE__) . '/include/page_footer.php';
exit;
}
$admin = in_array(CWebUser::$data['type'], array(USER_TYPE_ZABBIX_ADMIN, USER_TYPE_SUPER_ADMIN));
$rows_per_page = CWebUser::$data['rows_per_page'];
$searchWidget = new CWidget('search_wdgt');
$search = get_request('search', '');
// Header
if (zbx_empty($search)) {
$search = _('Search pattern is empty');
}
$searchWidget->setClass('header');
$searchWidget->addHeader(array(_('SEARCH') . NAME_DELIMITER, bold($search)), SPACE);
// FIND Hosts
$params = array('nodeids' => get_current_nodeid(true), 'search' => array('name' => $search, 'dns' => $search, 'ip' => $search), 'limit' => $rows_per_page, 'selectGroups' => API_OUTPUT_EXTEND, 'selectInterfaces' => API_OUTPUT_EXTEND, 'selectItems' => API_OUTPUT_COUNT, 'selectTriggers' => API_OUTPUT_COUNT, 'selectGraphs' => API_OUTPUT_COUNT, 'selectApplications' => API_OUTPUT_COUNT, 'selectScreens' => API_OUTPUT_COUNT, 'selectHttpTests' => API_OUTPUT_COUNT, 'selectDiscoveries' => API_OUTPUT_COUNT, 'output' => array('name', 'status'), 'searchByAny' => true);
$db_hosts = API::Host()->get($params);
order_result($db_hosts, 'name');
$hosts = selectByPattern($db_hosts, 'name', $search, $rows_per_page);
$hostids = zbx_objectValues($hosts, 'hostid');
$params = array('nodeids' => get_current_nodeid(true), 'hostids' => $hostids, 'editable' => 1);
$rw_hosts = API::Host()->get($params);
$rw_hosts = zbx_toHash($rw_hosts, 'hostid');
$params = array('nodeids' => get_current_nodeid(true), 'search' => array('name' => $search, 'dns' => $search, 'ip' => $search), 'countOutput' => 1, 'searchByAny' => true);
$overalCount = API::Host()->get($params);
$viewCount = count($hosts);
$table = new CTableInfo(_('No hosts found.'));
$table->setHeader(array(ZBX_DISTRIBUTED ? new CCol(_('Node')) : null, new CCol(_('Hosts')), new CCol(_('IP')), new CCol(_('DNS')), new CCol(_('Latest data')), new CCol(_('Triggers')), new CCol(_('Events')), new CCol(_('Graphs')), new CCol(_('Screens')), new CCol(_('Web')), new CCol(_('Applications')), new CCol(_('Items')), new CCol(_('Triggers')), new CCol(_('Graphs')), new CCol(_('Discovery')), new CCol(_('Web'))));
示例7: CTable
$graph_params_tbl1->addRow(array(_('Create graph'), $graphCreate, _('Name') . ':', $graphName, _('Width') . ':', $graphWidth, _('Height') . ':', $graphHeight, _('Graph type') . ':', $cmbGraphType));
$graph_params_tbl2 = new CTable();
$graph_params_tbl2->attr('class', 'formtable');
$graph_params_tbl2->addStyle("width: 100%; align: left; border-width: 0 0 0 0;");
$graph_params_tbl2->addRow(array(_('Function') . ':', $cmbGraphFunc, _('Draw style') . ':', $cmbDrawType, _('Y axis side') . ':', $cmbYaxisside));
$graph_params_tbl->addRow($graph_params_tbl1);
$graph_params_tbl->addRow($graph_params_tbl2);
$graph_params_div->addItem($graph_params_tbl);
$graph_params_w->addItem($graph_params_div);
$right_tab->addRow($empty_row);
$right_tab->addRow($graph_params_w);
//Mib selector
$cmbMibs = new CComboBox('mib', $mib, 'javascript: submit();');
//Action srow
$action_w = new CWidget();
$action_w->setClass('header');
$action_w->addHeader(array(new CButton('save', _('Save'), 'onSaveItems()'), SPACE, new CButton('clear', _('Clear'), 'onClearItems()')));
$right_tab->addRow($empty_row);
$right_tab->addRow($action_w);
// Left panel
$td_l = new CCol($left_tab);
$td_l->setAttribute('valign', 'top');
$td_l->setAttribute('width', $left_widget_width);
//Right panel
$td_r = new CCol($right_tab);
$td_r->setAttribute('valign', 'top');
$td_r->setAttribute('width', '100%');
$outer_table->addRow(array($td_l, $td_r));
$snmp_wdgt->addItem($outer_table);
$snmp_wdgt->show();
// Javascript GUI init
示例8: getRequest
}
// triggers
$triggers = API::Trigger()->get(array('output' => API_OUTPUT_EXTEND, 'selectHosts' => API_OUTPUT_EXTEND, 'triggerids' => getRequest('triggerid')));
if (!$triggers) {
access_deny();
}
$trigger = reset($triggers);
// events
$events = API::Event()->get(array('output' => API_OUTPUT_EXTEND, 'select_alerts' => API_OUTPUT_EXTEND, 'select_acknowledges' => API_OUTPUT_EXTEND, 'selectHosts' => API_OUTPUT_EXTEND, 'source' => EVENT_SOURCE_TRIGGERS, 'object' => EVENT_OBJECT_TRIGGER, 'eventids' => getRequest('eventid'), 'objectids' => getRequest('triggerid')));
$event = reset($events);
/*
* Display
*/
$config = select_config();
$eventWidget = new CWidget();
$eventWidget->setClass('header');
$eventWidget->addHeader(array(_('EVENTS') . ': "' . CMacrosResolverHelper::resolveTriggerName($trigger) . '"'), get_icon('fullscreen', array('fullscreen' => getRequest('fullscreen'))));
// trigger details
$triggerDetailsWidget = new CUiWidget('hat_triggerdetails', make_trigger_details($trigger));
$triggerDetailsWidget->setHeader(_('Event source details'));
// event details
$eventDetailsWidget = new CUiWidget('hat_eventdetails', make_event_details($event, $trigger));
$eventDetailsWidget->setHeader(_('Event details'));
// if acknowledges are not disabled in configuration, let's show them
if ($config['event_ack_enable']) {
$eventAcknowledgesWidget = new CCollapsibleUiWidget('hat_eventack', makeAckTab($event));
$eventAcknowledgesWidget->open = (bool) CProfile::get('web.tr_events.hats.hat_eventack.state', true);
$eventAcknowledgesWidget->setHeader(_('Acknowledges'));
} else {
$eventAcknowledgesWidget = null;
}
示例9: insert_host_form
//.........这里部分代码省略.........
foreach ($host_triggers as $htrigger) {
$trig_lbx->addItem($htrigger['triggerid'], $htrigger['description']);
}
$host_tbl->addRow(array(S_TRIGGERS, $trig_lbx));
}
// Host graphs
$options = array('inherited' => 0, 'hostids' => $_REQUEST['hostid'], 'select_hosts' => API_OUTPUT_REFER, 'output' => API_OUTPUT_EXTEND);
$host_graphs = CGraph::get($options);
if (!empty($host_graphs)) {
$graphs_lbx = new CListBox('graphs', null, 8);
$graphs_lbx->setAttribute('disabled', 'disabled');
order_result($host_graphs, 'name');
foreach ($host_graphs as $hgraph) {
if (count($hgraph['hosts']) > 1) {
continue;
}
$graphs_lbx->addItem($hgraph['graphid'], $hgraph['name']);
}
if ($graphs_lbx->ItemsCount() > 1) {
$host_tbl->addRow(array(S_GRAPHS, $graphs_lbx));
}
}
}
$host_footer = array();
$host_footer[] = new CButton('save', S_SAVE);
if ($_REQUEST['hostid'] > 0 && $_REQUEST['form'] != 'full_clone') {
array_push($host_footer, SPACE, new CButton('clone', S_CLONE), SPACE, new CButton('full_clone', S_FULL_CLONE), SPACE, new CButtonDelete(S_DELETE_SELECTED_HOST_Q, url_param('form') . url_param('hostid') . url_param('groupid')));
}
array_push($host_footer, SPACE, new CButtonCancel(url_param('groupid')));
$host_footer = new CCol($host_footer);
$host_footer->setColSpan(2);
$host_tbl->setFooter($host_footer);
$host_wdgt = new CWidget();
$host_wdgt->setClass('header');
$host_wdgt->addHeader($frm_title);
$host_wdgt->addItem($host_tbl);
// } HOST WIDGET
// TEMPLATES{
$template_tbl = new CTableInfo(S_NO_TEMPLATES_LINKED, 'tablestripped');
$template_tbl->setOddRowClass('form_odd_row');
$template_tbl->setEvenRowClass('form_even_row');
foreach ($templates as $id => $temp_name) {
$frmHost->addVar('templates[' . $id . ']', $temp_name);
$template_tbl->addRow(new CCol(array(new CCheckBox('templates_rem[' . $id . ']', 'no', null, $id), $temp_name)));
}
$footer = new CCol(array(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'), SPACE, new CButton('unlink', S_UNLINK), SPACE, new CButton('unlink_and_clear', S_UNLINK_AND_CLEAR)));
//$footer->setColSpan(2);
$template_tbl->setFooter($footer);
$template_wdgt = new CWidget();
$template_wdgt->setClass('header');
$template_wdgt->addHeader(S_LINKED_TEMPLATES);
$template_wdgt->addItem($template_tbl);
// } TEMPLATES
// MACROS WIDGET {
$macros_wdgt = get_macros_widget($_REQUEST['hostid']);
// } MACROS WIDGET
// PROFILE WIDGET {
$profile_tbl = new CTable('', 'tablestripped');
$profile_tbl->setOddRowClass('form_odd_row');
$profile_tbl->setEvenRowClass('form_even_row');
$profile_tbl->addRow(array(S_USE_PROFILE, new CCheckBox('useprofile', $useprofile, 'submit()')));
if ($useprofile == 'yes') {
$profile_tbl->addRow(array(S_DEVICE_TYPE, new CTextBox('devicetype', $devicetype, 61)));
$profile_tbl->addRow(array(S_NAME, new CTextBox('name', $name, 61)));
$profile_tbl->addRow(array(S_OS, new CTextBox('os', $os, 61)));
$profile_tbl->addRow(array(S_SERIALNO, new CTextBox('serialno', $serialno, 61)));
示例10: CButton
if ($templateid > 0 && $_REQUEST['form'] != 'full_clone') {
$host_footer[] = SPACE;
$host_footer[] = new CButton('clone', S_CLONE);
$host_footer[] = SPACE;
$host_footer[] = new CButton('full_clone', S_FULL_CLONE);
$host_footer[] = SPACE;
$host_footer[] = new CButtonDelete(S_DELETE_TEMPLATE_Q, url_param('form') . url_param('templateid') . url_param('groupid'));
$host_footer[] = SPACE;
$host_footer[] = new CButtonQMessage('delete_and_clear', S_DELETE_AND_CLEAR, S_DELETE_AND_CLEAR_TEMPLATE_Q, url_param('form') . url_param('templateid') . url_param('groupid'));
}
array_push($host_footer, SPACE, new CButtonCancel(url_param('groupid')));
$host_footer = new CCol($host_footer);
$host_footer->setColSpan(2);
$template_tbl->setFooter($host_footer);
$tplForm_wdgt = new CWidget();
$tplForm_wdgt->setClass('header');
$tplForm_wdgt->addHeader($frm_title);
$tplForm_wdgt->addItem($template_tbl);
// } TEMPLATE WIDGET
// MACROS WIDGET {
$macros_wdgt = get_macros_widget($templateid);
// } MACROS WIDGET
$left_table = new CTable();
$left_table->setCellPadding(4);
$left_table->setCellSpacing(4);
$left_table->addRow($tplForm_wdgt);
$right_table = new CTable();
$right_table->setCellPadding(4);
$right_table->setCellSpacing(4);
$right_table->addRow($macros_wdgt);
$td_l = new CCol($left_table);