本文整理汇总了PHP中BR函数的典型用法代码示例。如果您正苦于以下问题:PHP BR函数的具体用法?PHP BR怎么用?PHP BR使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AW
function AW($f)
{
if (AD($f, 'I') !== AI) {
if (BA($f, 1, 2) == 'BB') {
$g = $f;
} else {
$g = 'BB' . $f;
}
} elseif (AD($f, 'BE') !== AI) {
$g = 'BB' . H('BE', 'I', $f);
} elseif (AD($f, 'BE') === AI) {
P::Q();
$h = P::$c->BQ($f);
if (BR($h) == 1) {
return AI;
} elseif (BR($h) == 3) {
$g = $h[1];
} else {
return AI;
}
} else {
$g = $f;
}
if (BV($g)) {
$i = new \BW($g);
if ($g != $i->BX()) {
return AI;
} else {
return $g;
}
} else {
return AI;
}
}
示例2: show_report2_header
function show_report2_header($config, &$PAGE_GROUPS, &$PAGE_HOSTS)
{
global $USER_DETAILS;
$available_groups = $PAGE_GROUPS['groupids'];
$available_hosts = $PAGE_HOSTS['hostids'];
// $available_groups = $PAGE_GROUPS['groupids'];
// $available_hosts = $PAGE_HOSTS['hostids'];
$r_form = new CForm();
$r_form->setMethod('get');
$cmbConf = new CComboBox('config', $config, 'submit()');
$cmbConf->addItem(0, S_BY_HOST);
$cmbConf->addItem(1, S_BY_TRIGGER_TEMPLATE);
$r_form->addItem(array(S_MODE . SPACE, $cmbConf, SPACE));
$cmbGroups = new CComboBox('groupid', $PAGE_GROUPS['selected'], 'javascript: submit();');
$cmbHosts = new CComboBox('hostid', $PAGE_HOSTS['selected'], 'javascript: submit();');
foreach ($PAGE_GROUPS['groups'] as $groupid => $name) {
$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));
if (1 == $config) {
$cmbTrigs = new CComboBox('tpl_triggerid', get_request('tpl_triggerid', 0), 'submit()');
$cmbHGrps = new CComboBox('hostgroupid', get_request('hostgroupid', 0), 'submit()');
$cmbTrigs->addItem(0, S_ALL_SMALL);
$cmbHGrps->addItem(0, S_ALL_SMALL);
}
if (0 == $config) {
show_table_header(S_AVAILABILITY_REPORT_BIG, $r_form);
} else {
$sql_cond = ' AND h.hostid=ht.hostid ';
if ($_REQUEST['hostid'] > 0) {
$sql_cond .= ' AND ht.templateid=' . $_REQUEST['hostid'];
}
if (isset($_REQUEST['tpl_triggerid']) && $_REQUEST['tpl_triggerid'] > 0) {
$sql_cond .= ' AND t.templateid=' . $_REQUEST['tpl_triggerid'];
}
$result = DBselect('SELECT DISTINCT g.groupid,g.name ' . ' FROM triggers t,hosts h,items i,functions f, hosts_templates ht, groups g, hosts_groups hg ' . ' WHERE f.itemid=i.itemid ' . ' AND h.hostid=i.hostid ' . ' AND hg.hostid=h.hostid' . ' AND g.groupid=hg.groupid ' . ' AND ' . DBcondition('h.hostid', $available_hosts) . ' AND t.status=' . TRIGGER_STATUS_ENABLED . ' AND t.triggerid=f.triggerid ' . ' AND ' . DBin_node('t.triggerid') . ' AND i.status=' . ITEM_STATUS_ACTIVE . ' AND h.status=' . HOST_STATUS_MONITORED . $sql_cond . ' ORDER BY g.name');
while ($row = DBfetch($result)) {
$cmbHGrps->addItem($row['groupid'], get_node_name_by_elid($row['groupid']) . $row['name']);
}
$sql_cond = $_REQUEST['hostid'] > 0 ? ' AND h.hostid=' . $_REQUEST['hostid'] : ' AND ' . DBcondition('h.hostid', $available_hosts);
$sql = 'SELECT DISTINCT t.triggerid,t.description ' . ' FROM triggers t,hosts h,items i,functions f ' . ' WHERE f.itemid=i.itemid ' . ' AND h.hostid=i.hostid ' . ' AND t.status=' . TRIGGER_STATUS_ENABLED . ' AND t.triggerid=f.triggerid ' . ' AND h.status=' . HOST_STATUS_TEMPLATE . ' AND ' . DBin_node('t.triggerid') . ' AND i.status=' . ITEM_STATUS_ACTIVE . $sql_cond . ' ORDER BY t.description';
$result = DBselect($sql);
while ($row = DBfetch($result)) {
$cmbTrigs->addItem($row['triggerid'], get_node_name_by_elid($row['triggerid']) . expand_trigger_description($row['triggerid']));
}
$rr_form = new CForm();
$rr_form->setMethod('get');
$rr_form->addVar('config', $config);
$rr_form->addVar('groupid', $_REQUEST['groupid']);
$rr_form->addVar('hostid', $_REQUEST['hostid']);
$rr_form->addItem(array(S_TRIGGER . SPACE, $cmbTrigs, BR(), S_FILTER, SPACE, S_HOST_GROUP . SPACE, $cmbHGrps));
show_table_header(S_AVAILABILITY_REPORT_BIG, array($r_form, $rr_form));
}
}
示例3: get
public function get($caption_l = null, $caption_r = null)
{
if (empty($caption_l)) {
$caption_l = _('In');
}
if (empty($caption_r)) {
$caption_r = _('Other');
}
$grp_tab = (new CTable())->addClass('tweenBoxTable')->setAttribute('name', $this->name)->setId('id', zbx_formatDomId($this->name))->setCellSpacing(0)->setCellPadding(0);
if (!is_null($caption_l) || !is_null($caption_r)) {
$grp_tab->addRow([$caption_l, '', $caption_r]);
}
$add_btn = (new CButton('add', (new CSpan())->addClass('arrow-left')))->addClass(ZBX_STYLE_BTN_GREY)->onClick('moveListBoxSelectedItem("' . $this->varname . '", "' . $this->id_r . '", "' . $this->id_l . '", "add");');
$rmv_btn = (new CButton('remove', (new CSpan())->addClass('arrow-right')))->addClass(ZBX_STYLE_BTN_GREY)->onClick('moveListBoxSelectedItem("' . $this->varname . '", "' . $this->id_l . '", "' . $this->id_r . '", "rmv");');
$grp_tab->addRow([$this->lbox, (new CCol([$add_btn, BR(), $rmv_btn]))->addClass(ZBX_STYLE_CENTER), $this->rbox]);
return $grp_tab;
}
示例4: index
public function index()
{
SubMenu('系统升级');
$available = 0;
if (file_exists($this->update_path . 'upgrade.php') and file_exists($this->update_path . 'version.php')) {
$available = 1;
}
ShowTips('<ul><li>请严格按升级说明进行系统升级, 升级说明一般随附在升级包中.</li>
<li>升级过程一般是先将升级包解压后, 设置FTP工具以 <span class=note>二进制方式</span> 上传到网站替换原文件, 然后在后台运行升级程序.</li>
<li>安全建议: <span class=note>升级完成后删除upgrade目录下的所有文件</span>.</li>
</ul>', '升级提示');
BR(2);
TableHeader('升级操作');
if ($available) {
include $this->update_path . 'version.php';
$new = str_replace('.', '', $NewVersion);
$old = str_replace('.', '', APP_VERSION);
if (intval($new) <= intval($old)) {
$output = '<font class=red>您现在正在使用的版本高于或等于升级程序中的版本, 无需升级!</font><BR>';
} else {
$output = '<form><input type="submit" value="运行升级程序" class="save" id="doupgrade"></form>';
}
TableRow(array('当前使用中的版本是: <span id="version">' . APP_VERSION . '</span>', '正要升级到的版本是: <font class=red>' . $NewVersion . '</font>'));
TableRow("<center><br>{$output}<br></center>");
} else {
TableRow('<center><br><br><b><span class=note>暂无可用的升级程序!</span></b><br><br><br></center>');
}
TableFooter();
echo '<script type="text/javascript">
$(function(){
$("#doupgrade").click(function(e){
var _me=$(this);
showDialog("确定运行升级程序吗?<BR>建议在升级前备份网站数据.", "确认操作", function(){
ajax("' . BURL('upgrade/ajax') . '", {}, function(data){
$("#version").html("' . $NewVersion . '");
_me.parent().parent().html("<br><font class=blueb>升级已完成!</font><br><br>");
});
});
e.preventDefault();
});
});
</script>';
}
示例5: get
/**
* Process screen.
*
* @return CDiv (screen inside container)
*/
public function get()
{
$image = new CImg('map.php?noedit=1&sysmapid=' . $this->screenitem['resourceid'] . '&width=' . $this->screenitem['width'] . '&height=' . $this->screenitem['height'] . '&curtime=' . time());
$image->setAttribute('id', 'map_' . $this->screenitem['screenitemid']);
if ($this->mode == SCREEN_MODE_PREVIEW) {
$sysmap = API::Map()->get(array('sysmapids' => $this->screenitem['resourceid'], 'output' => API_OUTPUT_EXTEND, 'selectSelements' => API_OUTPUT_EXTEND, 'selectLinks' => API_OUTPUT_EXTEND, 'expandUrls' => true, 'nopermissions' => true, 'preservekeys' => true));
$sysmap = reset($sysmap);
$actionMap = getActionMapBySysmap($sysmap);
$image->setMap($actionMap->getName());
$output = array($actionMap, $image);
} elseif ($this->mode == SCREEN_MODE_EDIT) {
$output = array($image, BR(), new CLink(_('Change'), $this->action));
} else {
$output = array($image);
}
$this->insertFlickerfreeJs();
$div = new CDiv($output, 'map-container flickerfreescreen', $this->getScreenId());
$div->setAttribute('data-timestamp', $this->timestamp);
$div->addStyle('position: relative;');
return $div;
}
示例6: index
function index($path)
{
//获取统计数据
$comms = APP::$DB->getOne("SELECT COUNT(cid) AS nums FROM " . TABLE_PREFIX . "comment WHERE readed = 0");
SubMenu('欢迎进入 ' . APP_NAME . ' 管理中心', array(array('查看留言', 'comments'), array('管理客人', 'guests'), array('管理记录', 'messages'), array('管理客服', 'users')));
$welcome = '<ul><li>欢迎 <font class=orange>' . $this->admin['fullname'] . '</font> 进入后台管理面板! 为了确保系统安全, 请在关闭前点击 <a href="#" class="logout">退出</a> 安全离开!</li>
<li>隐私保护: <span class="note2">' . APP_NAME . '[商业版] 郑重承诺, 您在使用本系统时, WeLive开发商不会收集您的任何信息</span>.</li>
<li>您在使用 ' . APP_NAME . '[商业版] 时有任何问题, 请访问: <a href="http://bbs.iimei.com//" target="_blank">我美网BBS</a>!</li></ul>';
ShowTips($welcome, '系统信息');
BR(2);
TableHeader('客服操作技巧说明');
TableRow('<font class=grey>1)</font> 将代码 <span class=note><script type="text/javascript" charset="UTF-8" src="' . BASEURL . 'welive.js"></script></span> 插入网页代码的<head></head>内来调用(显示)客服小面板.<br>  任意网站、任何编码格式的页面均可调用, 包括淘宝, ECShop等商城系统. <span class=note>请勿修改版权, 修改版权将导致无法使用!</span>');
TableRow('<font class=grey>2)</font> 客服窗口中, 按 Ctrl + Alt, 在客服交流区与当前客人小窗口间切换.');
TableRow('<font class=grey>3)</font> 客服窗口中, 按 Ctrl + 下箭头 或 Esc键, 关闭当前客人小窗口. 如果小窗口都关闭了, 自动切换到客服交流区.');
TableRow('<font class=grey>4)</font> 客服窗口中, 按 Ctrl + 上箭头, 展开关闭的客人小窗口.');
TableRow('<font class=grey>5)</font> 客服窗口中, 按 Ctrl + 左或右箭头, 在已展开的客人小窗口间切换.');
TableRow('<font class=grey>6)</font> 客服窗口中, 客人被踢出或禁言后, 刷新页面仍可重新进入客服, 即此两项操作仅作用于当前对话.');
TableRow('<font class=grey>7)</font> WeLive默认安装后, 前台客服小面板不会自动展开, 即不会进入客服. 如何希望自动展开, 可打开根目录下的welive.js文件, 修改 <span class=note>welive_auto=0</span> 代码中的0为N秒.<br>  那么, 当用户浏览器打开页面并停留N秒后, 客服小面板将自动展开, 即进入客服. 如果无客服在线, 将自动显示留言板.');
TableRow('<font class=grey>8)</font> 在客服窗口中的客服交流区, 管理员可发送特殊指令: system die --- Socket服务将中止(<span class=note>慎用</span>); all --- 显示所有连接数; admin --- 显示所有客服及其客人数; guest --- 显示客人数');
TableFooter();
$info_total = $comms['nums'];
//更新顶部提示信息
echo '<script type="text/javascript">
$(function(){
var info_total = ' . $info_total . ';
if(info_total > 0){
$("#topuser dl#info_all").removeClass("none");
$("#topuser #info_total").html(info_total);
$("#topuser #info_comms").html(info_total).attr("class", "orangeb");
}
//将统计数据保存为cookie. 注: header已发送, 此页面不能使用php保存cookie
setCookie("' . COOKIE_KEY . 'backinfos", info_total, 365);
});
</script>';
}
示例7: get
public function get($caption_l = null, $caption_r = null)
{
if (empty($caption_l)) {
$caption_l = _('In');
}
if (empty($caption_r)) {
$caption_r = _('Other');
}
$grp_tab = new CTable();
$grp_tab->attr('name', $this->name);
$grp_tab->attr('id', zbx_formatDomId($this->name));
$grp_tab->setCellSpacing(0);
$grp_tab->setCellPadding(0);
if (!is_null($caption_l) || !is_null($caption_r)) {
$grp_tab->addRow(array($caption_l, SPACE, $caption_r));
}
$add_btn = new CButton('add', ' « ', null, 'formlist');
$add_btn->setAttribute('onclick', 'javascript: moveListBoxSelectedItem("' . $this->form->getName() . '", "' . $this->varname . '", "' . $this->id_r . '", "' . $this->id_l . '", "add");');
$rmv_btn = new CButton('remove', ' » ', null, 'formlist');
$rmv_btn->setAttribute('onclick', 'javascript: moveListBoxSelectedItem("' . $this->form->getName() . '", "' . $this->varname . '", "' . $this->id_l . '", "' . $this->id_r . '", "rmv");');
$grp_tab->addRow(array($this->lbox, new CCol(array($add_btn, BR(), $rmv_btn), 'top'), $this->rbox));
return $grp_tab;
}
示例8: CCheckBox
//HOSTS
// SPACE added to extend CB width in Chrome
$cbMain = new CCheckBox('maintenance', $maintenance, null, '1');
if (!$filterEnable) {
$cbMain->setAttribute('disabled', 'disabled');
}
$dashForm->addRow(S_HOSTS, array($cbMain, S_SHOW_HOSTS_IN_MAINTENANCE));
// Trigger
$severity = zbx_toHash($severity);
$trgSeverities = array();
$severities = array(TRIGGER_SEVERITY_NOT_CLASSIFIED, TRIGGER_SEVERITY_INFORMATION, TRIGGER_SEVERITY_WARNING, TRIGGER_SEVERITY_AVERAGE, TRIGGER_SEVERITY_HIGH, TRIGGER_SEVERITY_DISASTER);
foreach ($severities as $snum => $sever) {
$cb = new CCheckBox('trgSeverity[' . $sever . ']', isset($severity[$sever]), '', 1);
$cb->setEnabled($filterEnable);
$trgSeverities[] = array($cb, getSeverityCaption($sever));
$trgSeverities[] = BR();
}
array_pop($trgSeverities);
$dashForm->addRow(S_TRIGGERS_WITH_SEVERITY, $trgSeverities);
$config = select_config();
$cb = new CComboBox('extAck', $extAck);
$cb->addItems(array(EXTACK_OPTION_ALL => S_O_ALL, EXTACK_OPTION_BOTH => S_O_SEPARATED, EXTACK_OPTION_UNACK => S_O_UNACKNOWLEDGED_ONLY));
$cb->setEnabled($filterEnable && $config['event_ack_enable']);
if (!$config['event_ack_enable']) {
$cb->setAttribute('title', S_EVENT_ACKNOWLEDGING_DISABLED);
}
$dashForm->addRow(S_PROBLEM_DISPLAY, $cb);
//-----
$dashForm->addItemToBottomRow(new CButton('save', S_SAVE));
$dashboard_wdgt->addItem($dashForm);
$dashboard_wdgt->show();
示例9: id2nodeid
$menu_trigger_conf = 'null';
if ($admin_links) {
$menu_trigger_conf = "['" . S_CONFIGURATION_OF_TRIGGERS . "',\"javascript:\n\t\t\t\tredirect('triggers.php?form=update&triggerid=" . $trigger['triggerid'] . '&switch_node=' . id2nodeid($trigger['triggerid']) . "')\",\n\t\t\t\tnull, {'outer' : ['pum_o_item'],'inner' : ['pum_i_item']}]";
}
$menu_trigger_url = 'null';
if (!zbx_empty($trigger['url'])) {
$menu_trigger_url = "['" . S_URL . "',\"javascript: window.location.href='" . $trigger['url'] . "'\",\n\t\t\t\tnull, {'outer' : ['pum_o_item'],'inner' : ['pum_i_item']}]";
}
$description->addAction('onclick', "javascript: create_mon_trigger_menu(event, new Array({'triggerid': '" . $trigger['triggerid'] . "', 'lastchange': '" . $trigger['lastchange'] . "'}, " . $menu_trigger_conf . ", " . $menu_trigger_url . ")," . zbx_jsvalue($items, true) . ");");
// }}} trigger description js menu
if ($_REQUEST['show_details']) {
$font = new CTag('font', 'yes');
$font->setAttribute('color', '#000');
$font->setAttribute('size', '-2');
$font->addItem(explode_exp($trigger['expression'], 1, false, true));
$description = array($description, BR(), $font);
}
// DEPENDENCIES {{{
if (!empty($trigger['dependencies'])) {
$dep_table = new CTableInfo();
$dep_table->setAttribute('style', 'width: 200px;');
$dep_table->addRow(bold(S_DEPENDS_ON . ':'));
foreach ($trigger['dependencies'] as $dep) {
$dep_table->addRow(' - ' . expand_trigger_description($dep['triggerid']));
}
$img = new Cimg('images/general/down_icon.png', 'DEP_UP');
$img->setAttribute('style', 'vertical-align: middle; border: 0px;');
$img->setHint($dep_table);
$description = array($img, SPACE, $description);
}
$dependency = false;
示例10: CFormList
$itemFormList = new CFormList('itemFormList');
// append type to form list
$copyTypeComboBox = new CComboBox('copy_type', $this->data['copy_type'], 'submit()');
$copyTypeComboBox->addItem(0, _('Hosts'));
$copyTypeComboBox->addItem(1, _('Host groups'));
$itemFormList->addRow(_('Target type'), $copyTypeComboBox);
// append targets to form list
$targetList = array();
if ($this->data['copy_type'] == 0) {
$groupComboBox = new CComboBox('copy_groupid', $this->data['copy_groupid'], 'submit()');
foreach ($this->data['groups'] as $group) {
$groupComboBox->addItem($group['groupid'], $group['name']);
}
$itemFormList->addRow(_('Group'), $groupComboBox);
foreach ($this->data['hosts'] as $host) {
array_push($targetList, array(new CCheckBox('copy_targetid[' . $host['hostid'] . ']', uint_in_array($host['hostid'], $this->data['copy_targetid']), null, $host['hostid']), SPACE, $host['name'], BR()));
}
} else {
foreach ($this->data['groups'] as $group) {
array_push($targetList, array(new CCheckBox('copy_targetid[' . $group['groupid'] . ']', uint_in_array($group['groupid'], $this->data['copy_targetid']), null, $group['groupid']), SPACE, $group['name'], BR()));
}
}
$itemFormList->addRow(_('Target'), !empty($targetList) ? $targetList : SPACE);
// append tabs to form
$itemTab = new CTabView();
$itemTab->addTab('itemTab', count($this->data['group_itemid']) . ' ' . _('elements copy to ...'), $itemFormList);
$itemForm->addItem($itemTab);
// append buttons to form
$itemForm->addItem(makeFormFooter(new CSubmit('copy', _('Copy')), new CButtonCancel(url_param('groupid') . url_param('hostid') . url_param('config'))));
$itemWidget->addItem($itemForm);
return $itemWidget;
示例11: CWidget
/*
** Zabbix
** Copyright (C) 2001-2014 Zabbix SIA
**
** 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.
**/
$screenWidget = new CWidget();
$screenWidget->addPageHeader(_('CONFIGURATION OF SCREENS'));
$screenWidget->addHeader($this->data['screen']['name']);
if (!empty($this->data['screen']['templateid'])) {
$screenWidget->addItem(get_header_host_table('screens', $this->data['screen']['templateid']));
}
$screenWidget->addItem(BR());
$screenBuilder = new CScreenBuilder(array('isFlickerfree' => false, 'screen' => $this->data['screen'], 'mode' => SCREEN_MODE_EDIT, 'updateProfile' => false));
$screenWidget->addItem($screenBuilder->show());
$screenBuilder->insertInitScreenJs($this->data['screenid']);
$screenBuilder->insertProcessObjectsJs();
return $screenWidget;
示例12: CWidget
**/
$widget = (new CWidget())->setTitle(_('Actions'))->setControls((new CForm('get'))->cleanItems()->addItem((new CList())->addItem([_('Event source'), SPACE, new CComboBox('eventsource', $data['eventsource'], 'submit()', [EVENT_SOURCE_TRIGGERS => _('Triggers'), EVENT_SOURCE_DISCOVERY => _('Discovery'), EVENT_SOURCE_AUTO_REGISTRATION => _('Auto registration'), EVENT_SOURCE_INTERNAL => _x('Internal', 'event source')])])->addItem(new CSubmit('form', _('Create action')))));
// create form
$actionForm = (new CForm())->setName('actionForm');
// create table
$actionTable = (new CTableInfo())->setHeader([(new CColHeader((new CCheckBox('all_items'))->onClick("checkAll('" . $actionForm->getName() . "', 'all_items', 'g_actionid');")))->addClass(ZBX_STYLE_CELL_WIDTH), make_sorting_header(_('Name'), 'name', $this->data['sort'], $this->data['sortorder']), _('Conditions'), _('Operations'), make_sorting_header(_('Status'), 'status', $this->data['sort'], $this->data['sortorder'])]);
if ($this->data['actions']) {
$actionConditionStringValues = actionConditionValueToString($this->data['actions'], $this->data['config']);
$actionOperationDescriptions = getActionOperationDescriptions($this->data['actions']);
foreach ($this->data['actions'] as $aIdx => $action) {
$conditions = [];
$operations = [];
order_result($action['filter']['conditions'], 'conditiontype', ZBX_SORT_DOWN);
foreach ($action['filter']['conditions'] as $cIdx => $condition) {
$conditions[] = getConditionDescription($condition['conditiontype'], $condition['operator'], $actionConditionStringValues[$aIdx][$cIdx]);
$conditions[] = BR();
}
sortOperations($data['eventsource'], $action['operations']);
foreach ($action['operations'] as $oIdx => $operation) {
$operations[] = $actionOperationDescriptions[$aIdx][$oIdx];
}
if ($action['status'] == ACTION_STATUS_DISABLED) {
$status = (new CLink(_('Disabled'), 'actionconf.php?action=action.massenable&g_actionid[]=' . $action['actionid'] . url_param('eventsource')))->addClass(ZBX_STYLE_LINK_ACTION)->addClass(ZBX_STYLE_RED)->addSID();
} else {
$status = (new CLink(_('Enabled'), 'actionconf.php?action=action.massdisable&g_actionid[]=' . $action['actionid'] . url_param('eventsource')))->addClass(ZBX_STYLE_LINK_ACTION)->addClass(ZBX_STYLE_GREEN)->addSID();
}
$actionTable->addRow([new CCheckBox('g_actionid[' . $action['actionid'] . ']', $action['actionid']), new CLink($action['name'], 'actionconf.php?form=update&actionid=' . $action['actionid']), $conditions, $operations, $status]);
}
}
// append table to form
$actionForm->addItem([$actionTable, $this->data['paging'], new CActionButtonList('action', 'g_actionid', ['action.massenable' => ['name' => _('Enable'), 'confirm' => _('Enable selected actions?')], 'action.massdisable' => ['name' => _('Disable'), 'confirm' => _('Disable selected actions?')], 'action.massdelete' => ['name' => _('Delete'), 'confirm' => _('Delete selected actions?')]])]);
示例13: foreach
foreach ($this->data['groups'] as $group) {
if (empty($this->data['filter_groupid'])) {
$this->data['filter_groupid'] = $group['groupid'];
}
$groupComboBox->addItem($group['groupid'], $group['name']);
}
$triggersFormList->addRow(_('Group'), $groupComboBox);
}
// append targets to form list
$targets = array();
if ($this->data['copy_type'] == 0) {
foreach ($this->data['hosts'] as $host) {
array_push($targets, array(new CCheckBox('copy_targetid[' . $host['hostid'] . ']', uint_in_array($host['hostid'], $this->data['copy_targetid']), null, $host['hostid']), SPACE, $host['name'], BR()));
}
} else {
foreach ($this->data['groups'] as $group) {
array_push($targets, array(new CCheckBox('copy_targetid[' . $group['groupid'] . ']', uint_in_array($group['groupid'], $this->data['copy_targetid']), null, $group['groupid']), SPACE, $group['name'], BR()));
}
}
if (empty($targets)) {
array_push($targets, BR());
}
$triggersFormList->addRow(_('Target'), $targets);
// append tabs to form
$triggersTab = new CTabView();
$triggersTab->addTab('triggersTab', count($this->data['elements']) . SPACE . _('elements copy to ...'), $triggersFormList);
$triggersForm->addItem($triggersTab);
// append buttons to form
$triggersForm->addItem(makeFormFooter(new CSubmit('copy', _('Copy')), new CButtonCancel(url_param('groupid') . url_param('hostid') . url_param('config'))));
$triggersWidget->addItem($triggersForm);
return $triggersWidget;
示例14: next
if (isset($summary[$alert['userid']]['medias'][$alert['mediatypeid']])) {
$summary[$alert['userid']]['medias'][$alert['mediatypeid']]++;
} else {
$summary[$alert['userid']]['medias'][$alert['mediatypeid']] = 1;
}
}
next($alerts);
}
foreach ($summary as $s) {
if ($s['total'] == 0) {
array_push($row, '');
} else {
array_push($row, [$s['total'], $media_type == 0 ? SPACE . '(' . implode('/', $s['medias']) . ')' : '']);
}
}
$table->addRow($row);
}
$widget->addItem($table)->show();
if ($media_type == 0) {
echo BR();
$links = [];
foreach ($media_types as $id => $description) {
$links[] = new CLink($description, 'zabbix.php?action=mediatype.edit&mediatypeid=' . $id);
$links[] = SPACE . '/' . SPACE;
}
array_pop($links);
$linksDiv = new CDiv([SPACE . _('all') . SPACE . '(' . SPACE, $links, SPACE . ')']);
$linksDiv->show();
}
}
require_once dirname(__FILE__) . '/include/page_footer.php';
示例15: time
$session = $this->data['usersSessions'][$userId];
// online time
if ($session['lastaccess']) {
$onlineTime = $user['autologout'] == 0 || ZBX_USER_ONLINE_TIME < $user['autologout'] ? ZBX_USER_ONLINE_TIME : $user['autologout'];
$online = $session['lastaccess'] + $onlineTime >= time() ? new CCol(_('Yes') . ' (' . date('r', $session['lastaccess']) . ')', 'enabled') : new CCol(_('No') . ' (' . date('r', $session['lastaccess']) . ')', 'disabled');
} else {
$online = new CCol(_('No'), 'disabled');
}
// blocked
$blocked = $user['attempt_failed'] >= ZBX_LOGIN_ATTEMPTS ? new CLink(_('Blocked'), 'users.php?go=unblock&group_userid' . SQUAREBRACKETS . '=' . $userId, 'on') : new CSpan(_('Ok'), 'green');
// user groups
order_result($user['usrgrps'], 'name');
$usersGroups = array();
foreach ($user['usrgrps'] as $userGroup) {
$usersGroups[] = new CLink($userGroup['name'], 'usergrps.php?form=update&usrgrpid=' . $userGroup['usrgrpid']);
$usersGroups[] = BR();
}
array_pop($usersGroups);
// user type style
$userTypeStyle = 'enabled';
if ($user['type'] == USER_TYPE_ZABBIX_ADMIN) {
$userTypeStyle = 'orange';
}
if ($user['type'] == USER_TYPE_SUPER_ADMIN) {
$userTypeStyle = 'disabled';
}
// gui access style
$guiAccessStyle = 'green';
if ($user['gui_access'] == GROUP_GUI_ACCESS_INTERNAL) {
$guiAccessStyle = 'orange';
}