本文整理汇总了PHP中bold函数的典型用法代码示例。如果您正苦于以下问题:PHP bold函数的具体用法?PHP bold怎么用?PHP bold使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bold函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bfirst
function bfirst($str)
{
// mark first symbol of string as bold
$res = bold($str[0]);
for ($i = 1, $max = strlen($str); $i < $max; $i++) {
$res .= $str[$i];
}
$str = $res;
return $str;
}
示例2: make_decoration
function make_decoration($haystack, $needle, $class = null)
{
$result = $haystack;
$pos = stripos($haystack, $needle);
if ($pos !== FALSE) {
$start = zbx_substring($haystack, 0, $pos);
// $middle = substr($haystack, $pos, zbx_strlen($needle));
$middle = $needle;
$end = substr($haystack, $pos + zbx_strlen($needle));
if (is_null($class)) {
$result = array($start, bold($middle), $end);
} else {
$result = array($start, new CSpan($middle, $class), $end);
}
}
return $result;
}
示例3: tablesPrint
function tablesPrint($tables)
{
?>
<script type="text/javascript">
function tablesFilter(value) {
var tables = document.getElementById('tables').getElementsByTagName('span');
for (var i = tables.length; i--; ) {
var a = tables[i].children[1];
var text = a.innerText || a.textContent;
tables[i].className = (text.indexOf(value) == -1 ? 'hidden' : '');
a.innerHTML = text.replace(value, '<b>' + value + '</b>');
}
}
</script>
<p class="jsonly"><input onkeyup="tablesFilter(this.value);">
<?php
echo "<p id='tables' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";
foreach ($tables as $table => $type) {
echo '<span><a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table) . ">" . lang('select') . "</a> ";
echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold($_GET["table"] == $table) . ">" . h($table) . "</a><br></span>\n";
}
return true;
}
示例4: array
if (isset($row['serviceupid'])) {
$services[$row['serviceupid']]['childs'][] = array('id' => $row['serviceid'], 'soft' => 0, 'linkid' => 0);
}
if (isset($row['servicedownid'])) {
$services[$row['serviceid']]['childs'][] = array('id' => $row['servicedownid'], 'soft' => 1, 'linkid' => $row['linkid']);
}
}
$treeServ = array();
createServiceTree($services, $treeServ);
//return into $treeServ parametr
//permission issue
$treeServ = del_empty_nodes($treeServ);
//----
if (isset($_REQUEST['msg']) && !empty($_REQUEST['msg'])) {
show_messages(true, $_REQUEST['msg']);
}
//show_table_header(S_IT_SERVICES_BIG);
$tree = new CTree('service_conf_tree', $treeServ, array('caption' => bold(S_SERVICE), 'algorithm' => bold(S_STATUS_CALCULATION), 'description' => bold(S_TRIGGER)));
if ($tree) {
$serv_wdgt = new CWidget();
$serv_wdgt->addHeader(S_IT_SERVICES_BIG, SPACE);
$serv_wdgt->addItem($tree->getHTML());
$serv_wdgt->show();
} else {
error(S_CANT_FORMAT_TREE);
}
$tr_ov_menu[] = array('test1', null, null, array('outer' => array('pum_oheader'), 'inner' => array('pum_iheader')));
$tr_ov_menu[] = array('test2', null, null, array('outer' => array('pum_oheader'), 'inner' => array('pum_iheader')));
$jsmenu = new CPUMenu($tr_ov_menu, 170);
$jsmenu->InsertJavaScript();
include_once "include/page_footer.php";
示例5: CForm
$rForm = new CForm('get');
$rForm->addItem(array(_('Group'), SPACE, $this->data['pageFilter']->getGroupsCB()));
$hostInventoryWidget->addPageHeader(_('HOST INVENTORY'), SPACE);
$hostInventoryWidget->addHeader(_('Hosts'), $rForm);
$filterTable = new CTable('', 'filter filter-center');
// getting inventory fields to make a drop down
$inventoryFields = getHostInventories(true);
// 'true' means list should be ordered by title
$inventoryFieldsComboBox = new CComboBox('filter_field', $this->data['filterField']);
foreach ($inventoryFields as $inventoryField) {
$inventoryFieldsComboBox->addItem($inventoryField['db_field'], $inventoryField['title']);
}
$exactComboBox = new CComboBox('filter_exact', $this->data['filterExact']);
$exactComboBox->addItem('0', _('like'));
$exactComboBox->addItem('1', _('exactly'));
$filterTable->addRow(array(array(array(bold(_('Field')), SPACE, $inventoryFieldsComboBox), array($exactComboBox, new CTextBox('filter_field_value', $this->data['filterFieldValue'], 20)))), 'host-inventories');
$filter = new CSubmit('filter_set', _('Filter'));
$filter->useJQueryStyle('main');
$reset = new CSubmit('filter_rst', _('Reset'));
$reset->useJQueryStyle();
$divButtons = new CDiv(array($filter, SPACE, $reset));
$divButtons->setAttribute('style', 'padding: 4px 0px;');
$footerCol = new CCol($divButtons, 'controls');
$filterTable->addRow($footerCol);
$filterForm = new CForm('get');
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$filterForm->addItem($filterTable);
$hostInventoryWidget->addFlicker($filterForm, CProfile::get('web.hostinventories.filter.state', 0));
$hostInventoryWidget->addHeaderRowNumber();
$table = new CTableInfo(_('No hosts found.'));
示例6: array_merge
if (isset($services[$row['serviceid']])) {
$services[$row['serviceid']] = array_merge($services[$row['serviceid']], $row);
} else {
$services[$row['serviceid']] = $row;
}
if (isset($row['serviceupid'])) {
$services[$row['serviceupid']]['childs'][] = array('id' => $row['serviceid'], 'soft' => 0, 'linkid' => 0);
}
if (isset($row['servicedownid'])) {
$services[$row['serviceid']]['childs'][] = array('id' => $row['servicedownid'], 'soft' => 1, 'linkid' => $row['linkid']);
}
}
$treeServ = array();
createShowServiceTree($services, $treeServ);
//return into $treeServ parametr
//permission issue
$treeServ = del_empty_nodes($treeServ);
$tree = new CTree($treeServ, array('caption' => bold(S_SERVICE), 'status' => bold(S_STATUS), 'reason' => bold(S_REASON), 'sla' => bold(S_SLA_LAST_7_DAYS), 'sla2' => bold(nbsp(S_SLA)), 'graph' => bold(S_GRAPH)));
if ($tree) {
$url = '?fullscreen=' . ($_REQUEST['fullscreen'] ? '0' : '1');
$fs_icon = new CDiv(SPACE, 'fullscreen');
$fs_icon->AddOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
$fs_icon->AddAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
$tab = create_hat(S_IT_SERVICES_BIG, $tree->getHTML(), null, 'hat_services', get_profile('web.srv_status.hats.hat_services.state', 1));
$tab->Show();
unset($tab);
} else {
error('Can not format Tree. Check logik structure in service links');
}
}
include_once "include/page_footer.php";
示例7: uint_in_array
break;
}
}
}
if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) {
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 = 'Search pattern is empty';
}
$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(), 'extendoutput' => true, 'pattern' => $search, 'extend_pattern' => true, 'limit' => $rows_per_page, 'order' => 'host');
$db_hosts = CHost::get($params);
$hosts = selectByPattern($db_hosts, 'host', $search, $rows_per_page);
$hostids = array_keys($hosts);
$hostsgroups = array();
示例8: tablesPrint
/** Prints table list in menu
* @param array result of table_status('', true)
* @return null
*/
function tablesPrint($tables)
{
echo "<p id='tables' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";
foreach ($tables as $table => $status) {
echo '<a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table || $_GET["edit"] == $table, "select") . ">" . lang('select') . "</a> ";
$name = $this->tableName($status);
echo (support("table") || support("indexes") ? '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold(in_array($table, array($_GET["table"], $_GET["create"], $_GET["indexes"], $_GET["foreign"], $_GET["trigger"])), is_view($status) ? "view" : "", "structure") . " title='" . lang('Show structure') . "'>{$name}</a>" : "<span>{$name}</span>") . "<br>\n";
}
}
示例9: get_actions_hint_by_eventid
function get_actions_hint_by_eventid($eventid, $status = NULL)
{
$hostids = array();
$sql = 'SELECT DISTINCT i.hostid ' . ' FROM events e, functions f, items i ' . ' WHERE e.eventid=' . $eventid . ' AND e.objectid=' . EVENT_SOURCE_TRIGGERS . ' AND f.triggerid=' . $_REQUEST['triggerid'] . ' AND i.itemid=f.itemid';
if ($host = DBfetch(DBselect($sql, 1))) {
$hostids[$host['hostid']] = $host['hostid'];
}
$available_triggers = get_accessible_triggers(PERM_READ_ONLY, $hostids);
$tab_hint = new CTableInfo(S_NO_ACTIONS_FOUND);
$tab_hint->addOption('style', 'width: 300px;');
$tab_hint->SetHeader(array(is_show_subnodes() ? S_NODES : null, S_USER, S_DETAILS, S_STATUS));
/*
$sql = 'SELECT DISTINCT a.alertid,mt.description,a.sendto,a.status,u.alias,a.retries '.
' FROM events e,users u,alerts a'.
' left join media_type mt on mt.mediatypeid=a.mediatypeid'.
' WHERE a.eventid='.$eventid.
(is_null($status)?'':' AND a.status='.$status).
' AND e.eventid = a.eventid'.
' AND a.alerttype IN ('.ALERT_TYPE_MESSAGE.','.ALERT_TYPE_COMMAND.')'.
' AND '.DBcondition('e.objectid',$available_triggers).
' AND '.DBin_node('a.alertid').
' AND u.userid=a.userid '.
' ORDER BY mt.description';
//*/
$sql = 'SELECT DISTINCT a.alertid,mt.description,u.alias,a.subject,a.message,a.sendto,a.status,a.retries,a.alerttype ' . ' FROM events e,alerts a ' . ' LEFT JOIN users u ON u.userid=a.userid ' . ' LEFT JOIN media_type mt ON mt.mediatypeid=a.mediatypeid' . ' WHERE a.eventid=' . $eventid . (is_null($status) ? '' : ' AND a.status=' . $status) . ' AND e.eventid = a.eventid' . ' AND a.alerttype IN (' . ALERT_TYPE_MESSAGE . ',' . ALERT_TYPE_COMMAND . ')' . ' AND ' . DBcondition('e.objectid', $available_triggers) . ' AND ' . DBin_node('a.alertid') . ' ORDER BY a.alertid';
$result = DBselect($sql, 30);
while ($row = DBfetch($result)) {
if ($row["status"] == ALERT_STATUS_SENT) {
$status = new CSpan(S_SENT, "green");
$retries = new CSpan(SPACE, "green");
} else {
if ($row["status"] == ALERT_STATUS_NOT_SENT) {
$status = new CSpan(S_IN_PROGRESS, "orange");
$retries = new CSpan(ALERT_MAX_RETRIES - $row["retries"], "orange");
} else {
$status = new CSpan(S_NOT_SENT, "red");
$retries = new CSpan(0, "red");
}
}
switch ($row['alerttype']) {
case ALERT_TYPE_MESSAGE:
$message = empty($row['description']) ? '-' : $row['description'];
break;
case ALERT_TYPE_COMMAND:
$message = array(bold(S_COMMAND . ':'));
$msg = explode("\n", $row['message']);
foreach ($msg as $m) {
array_push($message, BR(), $m);
}
break;
default:
$message = '-';
}
$tab_hint->addRow(array(get_node_name_by_elid($row['alertid']), empty($row['alias']) ? ' - ' : $row['alias'], $message, $status));
}
return $tab_hint;
}
示例10: return
<?php
/*
** Zabbix
** Copyright (C) 2001-2016 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.
**/
return (new CWidget())->setTitle($data['name'])->addItem((new CForm())->addItem((new CTabView())->addTab('scriptTab', null, new CPre(new CList([bold($data['command']), SPACE, $data['message']])))));
示例11: is_array
$hostsWidget->setRootClass($rootClass);
} else {
$displayNodes = is_array(get_current_nodeid()) && $pageFilter->groupid == 0;
$frmForm = new CForm();
$frmForm->cleanItems();
$frmForm->addItem(new CDiv(array(new CSubmit('form', _('Create host')), new CButton('form', _('Import'), 'redirect("conf.import.php?rules_preset=host")'))));
$frmForm->addItem(new CVar('groupid', $_REQUEST['groupid'], 'filter_groupid_id'));
$hostsWidget->addPageHeader(_('CONFIGURATION OF HOSTS'), $frmForm);
$frmGroup = new CForm('get');
$frmGroup->addItem(array(_('Group') . SPACE, $pageFilter->getGroupsCB(true)));
$hostsWidget->addHeader(_('Hosts'), $frmGroup);
$hostsWidget->addHeaderRowNumber();
$hostsWidget->setRootClass('host-list');
// filter
$filterTable = new CTable('', 'filter');
$filterTable->addRow(array(array(array(bold(_('Name')), SPACE . _('like') . NAME_DELIMITER), new CTextBox('filter_host', $_REQUEST['filter_host'], 20)), array(array(bold(_('DNS')), SPACE . _('like') . NAME_DELIMITER), new CTextBox('filter_dns', $_REQUEST['filter_dns'], 20)), array(array(bold(_('IP')), SPACE . _('like') . NAME_DELIMITER), new CTextBox('filter_ip', $_REQUEST['filter_ip'], 20)), array(bold(_('Port') . NAME_DELIMITER), new CTextBox('filter_port', $_REQUEST['filter_port'], 20))));
$filter = new CButton('filter', _('Filter'), "javascript: create_var('zbx_filter', 'filter_set', '1', true); chkbxRange.clearSelectedOnFilterChange();");
$filter->useJQueryStyle('main');
$reset = new CButton('reset', _('Reset'), "javascript: clearAllForm('zbx_filter');");
$reset->useJQueryStyle();
$divButtons = new CDiv(array($filter, SPACE, $reset));
$divButtons->setAttribute('style', 'padding: 4px 0;');
$filterTable->addRow(new CCol($divButtons, 'center', 4));
$filterForm = new CForm('get');
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$filterForm->addItem($filterTable);
$hostsWidget->addFlicker($filterForm, CProfile::get('web.hosts.filter.state', 0));
// table hosts
$form = new CForm();
$form->setName('hosts');
示例12: get_actions_hint_by_eventid
function get_actions_hint_by_eventid($eventid, $status = null)
{
$tab_hint = new CTableInfo(_('No actions found.'));
$tab_hint->setAttribute('style', 'width: 300px;');
$tab_hint->setHeader(array(is_show_all_nodes() ? _('Nodes') : null, _('User'), _('Details'), _('Status')));
$sql = 'SELECT a.alertid,mt.description,u.alias,u.name,u.surname,a.subject,a.message,a.sendto,a.status,a.retries,a.alerttype' . ' FROM events e,alerts a' . ' LEFT JOIN users u ON u.userid=a.userid' . ' LEFT JOIN media_type mt ON mt.mediatypeid=a.mediatypeid' . ' WHERE a.eventid=' . zbx_dbstr($eventid) . (is_null($status) ? '' : ' AND a.status=' . $status) . ' AND e.eventid=a.eventid' . ' AND a.alerttype IN (' . ALERT_TYPE_MESSAGE . ',' . ALERT_TYPE_COMMAND . ')' . andDbNode('a.alertid') . ' ORDER BY a.alertid';
$result = DBselect($sql, 30);
while ($row = DBfetch($result)) {
if ($row['status'] == ALERT_STATUS_SENT) {
$status = new CSpan(_('Sent'), 'green');
} elseif ($row['status'] == ALERT_STATUS_NOT_SENT) {
$status = new CSpan(_('In progress'), 'orange');
} else {
$status = new CSpan(_('not sent'), 'red');
}
switch ($row['alerttype']) {
case ALERT_TYPE_MESSAGE:
$message = empty($row['description']) ? '-' : $row['description'];
break;
case ALERT_TYPE_COMMAND:
$message = array(bold(_('Command') . NAME_DELIMITER));
$msg = explode("\n", $row['message']);
foreach ($msg as $m) {
array_push($message, BR(), $m);
}
break;
default:
$message = '-';
}
if (!$row['alias']) {
$row['alias'] = ' - ';
} else {
$fullname = '';
if ($row['name']) {
$fullname = $row['name'];
}
if ($row['surname']) {
$fullname .= $fullname ? ' ' . $row['surname'] : $row['surname'];
}
if ($fullname) {
$row['alias'] .= ' (' . $fullname . ')';
}
}
$tab_hint->addRow(array(get_node_name_by_elid($row['alertid']), $row['alias'], $message, $status));
}
return $tab_hint;
}
示例13: User
// $date = new \DateTime('06/01/2014');
$date = \DateTime::createFromFormat('d/m/Y', '06/01/2014');
echo "Date " . $date->format('d/m/Y');
//instanciation : création de 2 objets User
$user1 = new User('Vincent', 'Phillippe');
$user2 = new User('Elodie', 'Perrotton');
//var_dump($user1);
// une constante d'appel depuis un objet de la clase
echo beautiful($user1->getNom()) . "<br />";
echo beautiful($user1::FORMATION) . "<br />";
// un attribut static s'appel depuis la classe
echo beautiful(User::getLangue()) . "<br />";
echo "<h3>Noms: </h3>";
// appel d'un helper bold() comme beautiful() en dessus en affichant le nom de chaque utilisateur
echo bold($user1->getNom()) . "<br />";
echo bold($user2->getNom()) . "<br />";
$user1->setEnabled(0);
echo beautiful("L'utilisateur " . $user1->getNom() . " est inactif");
echo "<h3>Prenoms: </h3>";
echo $user1->getPrenom() . "<br />";
echo $user2->getPrenom() . "<br />";
echo "<h3>Réactions: </h3>";
echo $user1->reagir("François Hollande est un tres bon président !") . "<br />";
echo $user2->reagir("Nicolas Sarkozy est pas mal physiquement...") . "<br />";
//appel d'une méthodes repond() en envoyant l'utilisateur
echo $user1->repond($user2, "Il ne me plait pas beaucoups le nain de jardin!") . "<br />";
echo $user2->repond($user1, "Remarque le tient, il est aussi grand que sa réputation!") . "<br />";
echo $user1->noter(4);
echo "<h2>Moderateur </h2>";
$moderateur1 = new Moderateur("Oussama", "Ben-Laden", 4);
echo beautiful($moderateur1->modererUser($user2));
示例14: get_header_host_table
/**
* Create CDiv with host/template information and references to it's elements
*
* @param string $currentElement
* @param int $hostid
* @param int $discoveryid
*
* @return object
*/
function get_header_host_table($currentElement, $hostid, $discoveryid = null)
{
$elements = array('items' => 'items', 'triggers' => 'triggers', 'graphs' => 'graphs', 'applications' => 'applications', 'screens' => 'screens', 'discoveries' => 'discoveries');
if (!empty($discoveryid)) {
unset($elements['applications'], $elements['screens'], $elements['discoveries']);
}
$options = array('hostids' => $hostid, 'output' => API_OUTPUT_EXTEND, 'templated_hosts' => true);
if (isset($elements['items'])) {
$options['selectItems'] = API_OUTPUT_COUNT;
}
if (isset($elements['triggers'])) {
$options['selectTriggers'] = API_OUTPUT_COUNT;
}
if (isset($elements['graphs'])) {
$options['selectGraphs'] = API_OUTPUT_COUNT;
}
if (isset($elements['applications'])) {
$options['selectApplications'] = API_OUTPUT_COUNT;
}
if (isset($elements['screens'])) {
$options['selectScreens'] = API_OUTPUT_COUNT;
}
if (isset($elements['discoveries'])) {
$options['selectDiscoveries'] = API_OUTPUT_COUNT;
}
// get hosts
$dbHost = API::Host()->get($options);
$dbHost = reset($dbHost);
// get discoveries
if (!empty($discoveryid)) {
$options['itemids'] = $discoveryid;
$options['output'] = array('name');
unset($options['hostids'], $options['templated_hosts']);
$dbDiscovery = API::DiscoveryRule()->get($options);
$dbDiscovery = reset($dbDiscovery);
}
/*
* Back
*/
$list = new CList(null, 'objectlist');
if ($dbHost['status'] == HOST_STATUS_TEMPLATE) {
$list->addItem(array('« ', new CLink(_('Template list'), 'templates.php?templateid=' . $dbHost['hostid'] . url_param('groupid'))));
} else {
$list->addItem(array('« ', new CLink(_('Host list'), 'hosts.php?hostid=' . $dbHost['hostid'] . url_param('groupid'))));
}
/*
* Name
*/
$description = '';
if ($dbHost['proxy_hostid']) {
$proxy = get_host_by_hostid($dbHost['proxy_hostid']);
$description .= $proxy['host'] . ': ';
}
$description .= $dbHost['name'];
if ($dbHost['status'] == HOST_STATUS_TEMPLATE) {
$list->addItem(array(bold(_('Template') . ': '), new CLink($description, 'templates.php?form=update&templateid=' . $dbHost['hostid'])));
} else {
switch ($dbHost['status']) {
case HOST_STATUS_MONITORED:
$status = new CSpan(_('Monitored'), 'off');
break;
case HOST_STATUS_NOT_MONITORED:
$status = new CSpan(_('Not monitored'), 'on');
break;
default:
$status = _('Unknown');
break;
}
$list->addItem(array(bold(_('Host') . ': '), new CLink($description, 'hosts.php?form=update&hostid=' . $dbHost['hostid'])));
$list->addItem($status);
$list->addItem(getAvailabilityTable($dbHost));
}
if (!empty($dbDiscovery)) {
$list->addItem(array('« ', new CLink(_('Discovery list'), 'host_discovery.php?hostid=' . $dbHost['hostid'] . url_param('groupid'))));
$list->addItem(array(bold(_('Discovery') . ': '), new CLink($dbDiscovery['name'], 'host_discovery.php?form=update&itemid=' . $dbDiscovery['itemid'])));
}
/*
* Rowcount
*/
if (isset($elements['applications'])) {
if ($currentElement == 'applications') {
$list->addItem(_('Applications') . ' (' . $dbHost['applications'] . ')');
} else {
$list->addItem(array(new CLink(_('Applications'), 'applications.php?hostid=' . $dbHost['hostid']), ' (' . $dbHost['applications'] . ')'));
}
}
if (isset($elements['items'])) {
if (!empty($dbDiscovery)) {
if ($currentElement == 'items') {
$list->addItem(_('Item prototypes') . ' (' . $dbDiscovery['items'] . ')');
} else {
//.........这里部分代码省略.........
示例15: CCol
$host = new CCol(array(new CCheckBox('hosts[' . $row['hostid'] . ']', NULL, NULL, $row['hostid']), SPACE, $description));
if ($show_only_tmp) {
$dns = NULL;
$ip = NULL;
$port = NULL;
$status = NULL;
$available = NULL;
$error = NULL;
} else {
$dns = empty($row['dns']) ? '-' : $row['dns'];
$ip = empty($row['ip']) ? '-' : $row['ip'];
$port = empty($row['port']) ? '-' : $row['port'];
if (1 == $row['useip']) {
$ip = bold($ip);
} else {
$dns = bold($dns);
}
switch ($row['status']) {
case HOST_STATUS_MONITORED:
$status = new CLink(S_MONITORED, 'hosts.php?hosts%5B%5D=' . $row['hostid'] . '&disable=1' . url_param('config') . url_param('groupid'), 'off');
break;
case HOST_STATUS_NOT_MONITORED:
$status = new CLink(S_NOT_MONITORED, 'hosts.php?hosts%5B%5D=' . $row['hostid'] . '&activate=1' . url_param('config') . url_param('groupid'), 'on');
break;
case HOST_STATUS_TEMPLAT:
$status = new CCol(S_TEMPLATE, 'unknown');
break;
case HOST_STATUS_DELETED:
$status = new CCol(S_DELETED, 'unknown');
break;
default: