本文整理匯總了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';
}