当前位置: 首页>>代码示例>>PHP>>正文


PHP CSpan::addItem方法代码示例

本文整理汇总了PHP中CSpan::addItem方法的典型用法代码示例。如果您正苦于以下问题:PHP CSpan::addItem方法的具体用法?PHP CSpan::addItem怎么用?PHP CSpan::addItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSpan的用法示例。


在下文中一共展示了CSpan::addItem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: make_sorting_header

function make_sorting_header($obj, $tabfield, $sortField, $sortOrder)
{
    global $page;
    $sortorder = $sortField == $tabfield && $sortOrder == ZBX_SORT_UP ? ZBX_SORT_DOWN : ZBX_SORT_UP;
    $link = CUrlFactory::getContextUrl();
    $link->setArgument('sort', $tabfield);
    $link->setArgument('sortorder', $sortorder);
    $url = $link->getUrl();
    if ($page['type'] != PAGE_TYPE_HTML && defined('ZBX_PAGE_MAIN_HAT')) {
        $script = "javascript: return updater.onetime_update('" . ZBX_PAGE_MAIN_HAT . "', '" . $url . "');";
    } else {
        $script = 'javascript: redirect("' . $url . '");';
    }
    zbx_value2array($obj);
    $cont = new CSpan();
    foreach ($obj as $el) {
        if (is_object($el) || $el === SPACE) {
            $cont->addItem($el);
        } else {
            $cont->addItem(new CSpan($el, 'underline'));
        }
    }
    $cont->addItem(SPACE);
    $img = null;
    if ($tabfield == $sortField) {
        if ($sortorder == ZBX_SORT_UP) {
            $img = new CSpan(SPACE, 'icon_sortdown');
        } else {
            $img = new CSpan(SPACE, 'icon_sortup');
        }
    }
    $col = new CCol(array($cont, $img), 'nowrap hover_grey');
    $col->setAttribute('onclick', $script);
    return $col;
}
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:35,代码来源:func.inc.php

示例2: CSubmit

            $colorComboBox->addItem(MARK_COLOR_GREEN, _('as Green'));
            $colorComboBox->addItem(MARK_COLOR_BLUE, _('as Blue'));
            $tasks[] = SPACE;
            $tasks[] = $colorComboBox;
        }
        $filterForm->addRow(_('Selected'), $tasks);
        $filterForm->addItemToBottomRow(new CSubmit('select', _('Filter')));
    }
}
// create history screen
$screen = CScreenBuilder::getScreen(array('resourcetype' => SCREEN_RESOURCE_HISTORY, 'action' => $this->data['action'], 'items' => $this->data['items'], 'item' => $this->data['item'], 'itemids' => $this->data['itemids'], 'profileIdx' => 'web.item.graph', 'profileIdx2' => reset($this->data['itemids']), 'period' => $this->data['period'], 'stime' => $this->data['stime'], 'filter' => get_request('filter'), 'filter_task' => get_request('filter_task'), 'mark_color' => get_request('mark_color'), 'plaintext' => $this->data['plaintext']));
// append plaintext to widget
if ($this->data['plaintext']) {
    $plaintextSpan = new CSpan(null, 'textblackwhite');
    foreach ($headerPlaintext as $text) {
        $plaintextSpan->addItem(array(new CJSscript($text), BR()));
    }
    $screen = $screen->get();
    $pre = new CTag('pre', true);
    foreach ($screen as $text) {
        $pre->addItem(new CJSscript($text));
    }
    $plaintextSpan->addItem($pre);
    $historyWidget->addItem($plaintextSpan);
} else {
    $right = new CTable();
    $right->addRow($header['right']);
    $historyWidget->addPageHeader($header['left'], $right);
    $historyWidget->addItem(SPACE);
    if (isset($this->data['iv_string'][$this->data['item']['value_type']])) {
        $historyWidget->addFlicker($filterForm, CProfile::get('web.history.filter.state', 1));
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:monitoring.history.php

示例3: addPopupValues

    if (isset($iv_string[$item['value_type']])) {
        $historyWidget->addFlicker($filterForm, CProfile::get('web.history.filter.state', 1));
    }
    $historyWidget->addItem($table);
    if (str_in_array($_REQUEST['action'], array('showvalues', 'showgraph'))) {
        zbx_add_post_js('timeControl.addObject("' . $dom_graph_id . '",' . zbx_jsvalue($timeline) . ',' . zbx_jsvalue($objData) . ');');
        zbx_add_post_js('timeControl.processObjects();');
        $scroll_div = new CDiv();
        $scroll_div->setAttribute('id', 'scrollbar_cntr');
        $historyWidget->addFlicker($scroll_div, CProfile::get('web.history.filter.state', 1));
    }
    $historyWidget->show();
} else {
    $span = new CSpan(null, 'textblackwhite');
    foreach ($ptData['header'] as $bnum => $text) {
        $span->addItem(array(new CJSscript($text), BR()));
    }
    $pre = new CTag('pre', true);
    foreach ($ptData['body'] as $bnum => $text) {
        $pre->addItem(new CJSscript($text));
    }
    $span->addItem($pre);
    $span->show();
}
?>
<script type="text/javascript">
//<!--<![CDATA[
function addPopupValues(list){
	if(!isset('object', list)){
		throw("Error hash attribute 'list' doesn't contain 'object' index");
		return false;
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:history.php

示例4: makeCell

 private function makeCell($id)
 {
     $td = new CCol();
     $caption = new CSpan();
     if ($id != 0 && array_key_exists('childnodes', $this->tree[$id])) {
         $caption->addItem((new CDiv((new CSpan())->addClass('arrow-right')))->addClass('treeview')->onClick($this->treename . '.closeSNodeX("' . $id . '", this.getElementsByTagName(\'span\')[0]);')->setId('idi_' . $id));
     }
     $caption->addItem($this->tree[$id]['caption']);
     if ($this->tree[$id]['Level'] != 0) {
         $level = $this->tree[$id]['Level'];
         $caption->setAttribute('style', 'padding-left:' . 2 * $level . 'em;');
     }
     $td->addItem($caption);
     return $td;
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:15,代码来源:CTree.php

示例5: CSpan

     $hostName = new CSpan($triggerHost['name'], 'link_menu');
     $hostName->setMenuPopup(CMenuPopupHelper::getHost($hosts[$triggerHost['hostid']], $scripts));
     // add maintenance icon with hint if host is in maintenance
     if ($triggerHost['maintenance_status']) {
         $maintenanceIcon = new CDiv(null, 'icon-maintenance-inline');
         $maintenances = API::Maintenance()->get(array('maintenanceids' => $triggerHost['maintenanceid'], 'output' => API_OUTPUT_EXTEND, 'limit' => 1));
         if ($maintenance = reset($maintenances)) {
             $hint = $maintenance['name'] . ' [' . ($triggerHost['maintenance_type'] ? _('Maintenance without data collection') : _('Maintenance with data collection')) . ']';
             if (isset($maintenance['description'])) {
                 // double quotes mandatory
                 $hint .= "\n" . $maintenance['description'];
             }
             $maintenanceIcon->setHint($hint);
             $maintenanceIcon->addClass('pointer');
         }
         $hostName->addItem($maintenanceIcon);
     }
     $hostList[] = $hostName;
     $hostList[] = ', ';
 }
 array_pop($hostList);
 // host
 $hostColumn = new CCol($hostList);
 $hostColumn->addStyle('white-space: normal;');
 // status
 $statusSpan = new CSpan(trigger_value2str($trigger['value']));
 // add colors and blinking to span depending on configuration and trigger parameters
 addTriggerValueStyle($statusSpan, $trigger['value'], $trigger['lastchange'], $config['event_ack_enable'] ? $trigger['event_count'] == 0 : false);
 $lastChangeDate = zbx_date2str(DATE_TIME_FORMAT_SECONDS, $trigger['lastchange']);
 $lastChange = empty($trigger['lastchange']) ? $lastChangeDate : new CLink($lastChangeDate, 'events.php?filter_set=1&triggerid=' . $trigger['triggerid'] . '&source=' . EVENT_SOURCE_TRIGGERS . '&stime=' . date(TIMESTAMP_FORMAT, $trigger['lastchange']) . '&period=' . ZBX_PERIOD_DEFAULT);
 // acknowledge
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:tr_status.php


注:本文中的CSpan::addItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。