• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP bold函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中bold函数的典型用法代码示例。如果您正苦于以下问题:PHP bold函数的具体用法?PHP bold怎么用?PHP bold使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了bold函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:rennhak,项目名称:zabbix,代码行数:10,代码来源:html.inc.php


示例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;
}
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:17,代码来源:html.inc.php


示例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;
    }
开发者ID:yxw2014,项目名称:adminer,代码行数:23,代码来源:tables-filter.php


示例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";
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:services.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.'));
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:inventory.host.list.php


示例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";
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:srv_status.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();
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:search.php


示例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";
     }
 }
开发者ID:kamrandotpk,项目名称:adminer,代码行数:13,代码来源:adminer.inc.php


示例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;
}
开发者ID:rennhak,项目名称:zabbix,代码行数:57,代码来源:actions.inc.php


示例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']])))));
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:21,代码来源:general.script.execute.php


示例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');
开发者ID:micromachine,项目名称:RackTables-ZABBIX-bridge,代码行数:31,代码来源:hosts.php


示例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;
}
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:47,代码来源:actions.inc.php


示例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));
开发者ID:unpetitlu,项目名称:poo,代码行数:31,代码来源:index.php


示例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('&laquo; ', new CLink(_('Template list'), 'templates.php?templateid=' . $dbHost['hostid'] . url_param('groupid'))));
    } else {
        $list->addItem(array('&laquo; ', 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('&laquo; ', 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 {
//.........这里部分代码省略.........
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:101,代码来源:html.inc.php


示例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:
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:hosts.php


示例16: CTable

     $_REQUEST['filter_field'] = CProfile::get('web.hostinventories.filter_field');
     $_REQUEST['filter_field_value'] = CProfile::get('web.hostinventories.filter_field_value');
     $_REQUEST['filter_exact'] = CProfile::get('web.hostinventories.filter_exact');
 }
 $filter_table = new CTable('', 'filter');
 // getting inventory fields to make a drop down
 $inventoryFields = getHostInventories(true);
 // 'true' means list should be ordered by title
 $inventoryFieldsComboBox = new CComboBox('filter_field', $_REQUEST['filter_field']);
 foreach ($inventoryFields as $inventoryField) {
     $inventoryFieldsComboBox->addItem($inventoryField['db_field'], $inventoryField['title']);
 }
 $exactComboBox = new CComboBox('filter_exact', $_REQUEST['filter_exact']);
 $exactComboBox->addItem('0', _('like'));
 $exactComboBox->addItem('1', _('exactly'));
 $filter_table->addRow(array(array(array(bold(_('Field:')), $inventoryFieldsComboBox), array($exactComboBox, new CTextBox('filter_field_value', $_REQUEST['filter_field_value'], 20)))));
 $filter = new CButton('filter', _('Filter'), "javascript: create_var('zbx_filter', 'filter_set', '1', true);");
 $filter->useJQueryStyle('main');
 $reset = new CButton('reset', _('Reset'), "javascript: clearAllForm('zbx_filter');");
 $reset->useJQueryStyle();
 $div_buttons = new CDiv(array($filter, SPACE, $reset));
 $div_buttons->setAttribute('style', 'padding: 4px 0px;');
 $footer_col = new CCol($div_buttons, 'controls');
 $filter_table->addRow($footer_col);
 $filter_form = new CForm('get');
 $filter_form->setAttribute('name', 'zbx_filter');
 $filter_form->setAttribute('id', 'zbx_filter');
 $filter_form->addItem($filter_table);
 $hostinvent_wdgt->addFlicker($filter_form, CProfile::get('web.hostinventories.filter.state', 0));
 $hostinvent_wdgt->addHeaderRowNumber();
 $table = new CTableInfo(_('No hosts defined.'));
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:hostinventories.php


示例17: unset

unset($db_host);
foreach ($db_hosts as $hostid => $db_host) {
    if (!isset($tab_rows[$hostid])) {
        continue;
    }
    $app_rows = $tab_rows[$hostid];
    if (uint_in_array(0, $_REQUEST['applications']) || isset($show_all_apps)) {
        $url = '?close=1&applicationid=0' . url_param('groupid') . url_param('hostid') . url_param('applications') . url_param('select');
        $link = new CLink(new CImg('images/general/opened.gif'), $url);
        //			$link = new CLink(new CImg('images/general/opened.gif'),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');");
    } else {
        $url = '?open=1&applicationid=0' . url_param('groupid') . url_param('hostid') . url_param('applications') . url_param('select');
        $link = new CLink(new CImg('images/general/closed.gif'), $url);
        //			$link = new CLink(new CImg('images/general/closed.gif'),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');");
    }
    $col = new CCol(array($link, SPACE, bold(S_MINUS_OTHER_MINUS), SPACE . '(' . $db_host['item_cnt'] . SPACE . S_ITEMS . ')'));
    $col->SetColSpan(5);
    $table->AddRow(array(get_node_name_by_elid($db_host['hostid']), $_REQUEST['hostid'] > 0 ? NULL : $db_host['host'], $col));
    foreach ($app_rows as $row) {
        $table->AddRow($row);
    }
}
$p_elements[] = $table;
/*
// Refresh tab
	$refresh_tab = array(
		array('id'	=> ZBX_PAGE_MAIN_HAT,
				'interval' 	=> $USER_DETAILS['refresh'],
				'url'	=>	zbx_empty($_SERVER['QUERY_STRING'])?'':'?'.$_SERVER['QUERY_STRING'],
			)
	);
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:latest.php


示例18: show_messages

function show_messages($bool = true, $okmsg = null, $errmsg = null)
{
    global $page, $ZBX_MESSAGES;
    if (!defined('PAGE_HEADER_LOADED')) {
        return null;
    }
    if (defined('ZBX_API_REQUEST')) {
        return null;
    }
    if (!isset($page['type'])) {
        $page['type'] = PAGE_TYPE_HTML;
    }
    $message = array();
    $width = 0;
    $height = 0;
    if (!$bool && !is_null($errmsg)) {
        $msg = _('ERROR') . ': ' . $errmsg;
    } elseif ($bool && !is_null($okmsg)) {
        $msg = $okmsg;
    }
    if (isset($msg)) {
        switch ($page['type']) {
            case PAGE_TYPE_IMAGE:
                array_push($message, array('text' => $msg, 'color' => !$bool ? array('R' => 255, 'G' => 0, 'B' => 0) : array('R' => 34, 'G' => 51, 'B' => 68), 'font' => 2));
                $width = max($width, imagefontwidth(2) * zbx_strlen($msg) + 1);
                $height += imagefontheight(2) + 1;
                break;
            case PAGE_TYPE_XML:
                echo htmlspecialchars($msg) . "\n";
                break;
            case PAGE_TYPE_HTML:
            default:
                $msg_tab = new CTable($msg, $bool ? 'msgok' : 'msgerr');
                $msg_tab->setCellPadding(0);
                $msg_tab->setCellSpacing(0);
                $row = array();
                $msg_col = new CCol(bold($msg), 'msg_main msg');
                $msg_col->setAttribute('id', 'page_msg');
                $row[] = $msg_col;
                if (isset($ZBX_MESSAGES) && !empty($ZBX_MESSAGES)) {
                    $msg_details = new CDiv(_('Details'), 'blacklink');
                    $msg_details->setAttribute('onclick', 'javascript: showHide("msg_messages", IE ? "block" : "table");');
                    $msg_details->setAttribute('title', _('Maximize') . '/' . _('Minimize'));
                    array_unshift($row, new CCol($msg_details, 'clr'));
                }
                $msg_tab->addRow($row);
                $msg_tab->show();
                break;
        }
    }
    if (isset($ZBX_MESSAGES) && !empty($ZBX_MESSAGES)) {
        if ($page['type'] == PAGE_TYPE_IMAGE) {
            $msg_font = 2;
            foreach ($ZBX_MESSAGES as $msg) {
                if ($msg['type'] == 'error') {
                    array_push($message, array('text' => $msg['message'], 'color' => array('R' => 255, 'G' => 55, 'B' => 55), 'font' => $msg_font));
                } else {
                    array_push($message, array('text' => $msg['message'], 'color' => array('R' => 155, 'G' => 155, 'B' => 55), 'font' => $msg_font));
                }
                $width = max($width, imagefontwidth($msg_font) * zbx_strlen($msg['message']) + 1);
                $height += imagefontheight($msg_font) + 1;
            }
        } elseif ($page['type'] == PAGE_TYPE_XML) {
            foreach ($ZBX_MESSAGES as $msg) {
                echo '[' . $msg['type'] . '] ' . $msg['message'] . "\n";
            }
        } else {
            $lst_error = new CList(null, 'messages');
            foreach ($ZBX_MESSAGES as $msg) {
                $lst_error->addItem($msg['message'], $msg['type']);
                $bool = $bool && 'error' != zbx_strtolower($msg['type']);
            }
            $msg_show = 6;
            $msg_count = count($ZBX_MESSAGES);
            if ($msg_count > $msg_show) {
                $msg_count = $msg_show * 16;
                $lst_error->setAttribute('style', 'height: ' . $msg_count . 'px;');
            }
            $tab = new CTable(null, $bool ? 'msgok' : 'msgerr');
            $tab->setCellPadding(0);
            $tab->setCellSpacing(0);
            $tab->setAttribute('id', 'msg_messages');
            $tab->setAttribute('style', 'width: 100%;');
            if (isset($msg_tab) && $bool) {
                $tab->setAttribute('style', 'display: none;');
            }
            $tab->addRow(new CCol($lst_error, 'msg'));
            $tab->show();
        }
        $ZBX_MESSAGES = null;
    }
    if ($page['type'] == PAGE_TYPE_IMAGE && count($message) > 0) {
        $width += 2;
        $height += 2;
        $canvas = imagecreate($width, $height);
        imagefilledrectangle($canvas, 0, 0, $width, $height, imagecolorallocate($canvas, 255, 255, 255));
        foreach ($message as $id => $msg) {
            $message[$id]['y'] = 1 + (isset($previd) ? $message[$previd]['y'] + $message[$previd]['h'] : 0);
            $message[$id]['h'] = imagefontheight($msg['font']);
            imagestring($canvas, $msg['font'], 1, $message[$id]['y'], $msg['text'], imagecolorallocate($canvas, $msg['color']['R'], $msg['color']['G'], $msg['color']['B']));
//.........这里部分代码省略.........
开发者ID:itnihao,项目名称:Zabbix_,代码行数:101,代码来源:func.inc.php


示例19: get_trigger_overview_cells

function get_trigger_overview_cells(&$table_row, &$trhosts, &$hostname)
{
    $css_class = NULL;
    unset($tr_ov_menu);
    $ack = null;
    if (isset($trhosts[$hostname])) {
        unset($ack_menu);
        switch ($trhosts[$hostname]['value']) {
            case TRIGGER_VALUE_TRUE:
                $css_class = get_severity_style($trhosts[$hostname]['priority']);
                if ($ack = get_last_event_by_triggerid($trhosts[$hostname]['triggerid'])) {
                    $ack_menu = array(S_ACKNOWLEDGE, 'acknow.php?eventid=' . $ack['eventid'], array('tw' => '_blank'));
                }
                if (1 == $ack['acknowledged']) {
                    $ack = new CImg('images/general/tick.png', 'ack');
                } else {
                    $ack = null;
                }
                break;
            case TRIGGER_VALUE_FALSE:
                $css_class = 'normal';
                break;
            default:
                $css_class = 'unknown_trigger';
        }
        $style = 'cursor: pointer; ';
        if (time(NULL) - $trhosts[$hostname]['lastchange'] < 300) {
            $style .= 'background-image: url(images/gradients/blink1.gif); ' . 'background-position: top left; ' . 'background-repeat: repeat;';
        } else {
            if (time(NULL) - $trhosts[$hostname]['lastchange'] < 900) {
                $style .= 'background-image: url(images/gradients/blink2.gif); ' . 'background-position: top left; ' . 'background-repeat: repeat;';
            }
        }
        unset($item_menu);
        $tr_ov_menu = array(array(S_TRIGGER, null, null, array('outer' => array('pum_oheader'), 'inner' => array('pum_iheader'))), array(S_EVENTS, 'events.php?triggerid=' . $trhosts[$hostname]['triggerid'], array('tw' => '_blank')));
        if (isset($ack_menu)) {
            $tr_ov_menu[] = $ack_menu;
        }
        $db_items = DBselect('select distinct i.itemid, i.description, i.key_, i.value_type ' . ' from items i, functions f ' . ' where f.itemid=i.itemid and f.triggerid=' . $trhosts[$hostname]['triggerid']);
        while ($item_data = DBfetch($db_items)) {
            $description = item_description($item_data);
            switch ($item_data['value_type']) {
                case ITEM_VALUE_TYPE_UINT64:
                case ITEM_VALUE_TYPE_FLOAT:
                    $action = 'showgraph';
                    $status_bar = S_SHOW_GRAPH_OF_ITEM . ' \'' . $description . '\'';
                    break;
                case ITEM_VALUE_TYPE_LOG:
                case ITEM_VALUE_TYPE_STR:
                case ITEM_VALUE_TYPE_TEXT:
                default:
                    $action = 'showlatest';
                    $status_bar = S_SHOW_VALUES_OF_ITEM . ' \'' . $description . '\'';
                    break;
            }
            if (strlen($description) > 25) {
                $description = substr($description, 0, 22) . '...';
            }
            $item_menu[$action][] = array($description, 'history.php?action=' . $action . '&itemid=' . $item_data['itemid'] . '&period=3600', array('tw' => '', 'sb' => $status_bar));
        }
        if (isset($item_menu['showgraph'])) {
            $tr_ov_menu[] = array(S_GRAPHS, null, null, array('outer' => array('pum_oheader'), 'inner' => array('pum_iheader')));
            $tr_ov_menu = array_merge($tr_ov_menu, $item_menu['showgraph']);
        }
        if (isset($item_menu['showlatest'])) {
            $tr_ov_menu[] = array(S_VALUES, null, null, array('outer' => array('pum_oheader'), 'inner' => array('pum_iheader')));
            $tr_ov_menu = array_merge($tr_ov_menu, $item_menu['showlatest']);
        }
        unset($item_menu);
    }
    // dependency
    // TRIGGERS ON WHICH DEPENDS THIS
    $desc = array();
    if (isset($trhosts[$hostname])) {
        $triggerid = $trhosts[$hostname]['triggerid'];
        $dependency = false;
        $dep_table = new CTableInfo();
        $dep_table->AddOption('style', 'width: 200px;');
        $dep_table->addRow(bold(S_DEPENDS_ON . ':'));
        $sql_dep = 'SELECT * FROM trigger_depends WHERE triggerid_down= 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP bon_get_option函数代码示例发布时间:2022-05-24
下一篇:
PHP body_tag函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap