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


PHP CTag::addItem方法代码示例

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


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

示例1: addItem

 public function addItem($value)
 {
     if (is_object($value) && zbx_strtolower(get_class($value)) != 'carea') {
         return $this->error('Incorrect value for addItem "' . $value . '".');
     }
     return parent::addItem($value);
 }
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:7,代码来源:class.careamap.php

示例2: addItem

 public function addItem($value, $caption = '', $selected = null, $enabled = true, $class = null)
 {
     if ($value instanceof CComboItem || $value instanceof COptGroup) {
         parent::addItem($value);
     } else {
         if (is_null($selected)) {
             $selected = 'no';
             if (is_array($this->value)) {
                 if (str_in_array($value, $this->value)) {
                     $selected = 'yes';
                 }
             } elseif (strcmp($value, $this->value) == 0) {
                 $selected = 'yes';
             }
         } else {
             $selected = 'yes';
         }
         $citem = new CComboItem($value, $caption, $selected, $enabled);
         if ($class !== null) {
             $citem->addClass($class);
         }
         parent::addItem($citem);
     }
     return $this;
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:25,代码来源:CComboBox.php

示例3: addItem

 public function addItem($value)
 {
     if (strtolower(get_class($value)) != 'carea') {
         return $this->error('Incorrect value for addItem [' . $value . ']');
     }
     return parent::addItem($value);
 }
开发者ID:rennhak,项目名称:zabbix,代码行数:7,代码来源:class.cmap.php

示例4: addItem

 public function addItem($value, $class = null, $id = null)
 {
     if (!is_null($value) && $this->emptyList) {
         $this->emptyList = false;
         $this->items = array();
     }
     parent::addItem($this->prepareItem($value, $class, $id));
 }
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:8,代码来源:class.clist.php

示例5: addItemsInGroup

 public function addItemsInGroup($label, $items)
 {
     $group = new COptGroup($label);
     foreach ($items as $value => $caption) {
         $selected = (int) ($value == $this->value);
         $group->addItem(new CComboItem($value, $caption, $selected));
     }
     parent::addItem($group);
 }
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:9,代码来源:class.ccombobox.php

示例6: addItem

 public function addItem($value, $class = null)
 {
     if (is_array($value)) {
         foreach ($value as $el) {
             parent::addItem($this->prepareItem($el, $class));
         }
     } else {
         parent::addItem($this->prepareItem($value, $class));
     }
 }
开发者ID:rennhak,项目名称:zabbix,代码行数:10,代码来源:class.clist.php

示例7: addItem

 public function addItem($value, $class = null, $id = null)
 {
     if (!is_null($value) && $this->emptyList) {
         $this->emptyList = false;
         $this->items = [];
     }
     if ($value instanceof CListItem) {
         parent::addItem($value);
     } else {
         parent::addItem($this->prepareItem($value, $class, $id));
     }
     return $this;
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:13,代码来源:CList.php

示例8: addItem

 public function addItem($item)
 {
     if (is_object($item) && strtolower(get_class($item)) === 'ccol') {
         parent::addItem($item);
     } elseif (is_array($item)) {
         foreach ($item as $el) {
             if (is_object($el) && strtolower(get_class($el)) === 'ccol') {
                 parent::addItem($el);
             } elseif (!is_null($el)) {
                 parent::addItem(new CCol($el));
             }
         }
     } elseif (!is_null($item)) {
         parent::addItem(new CCol($item));
     }
 }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:16,代码来源:CRow.php

示例9: italic

function italic($str)
{
    if (is_array($str)) {
        foreach ($str as $key => $val) {
            if (is_string($val)) {
                $em = new CTag('em', true);
                $em->addItem($val);
                $str[$key] = $em;
            }
        }
    } elseif (is_string($str)) {
        $em = new CTag('em', true, '');
        $em->addItem($str);
        $str = $em;
    }
    return $str;
}
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:17,代码来源:html.inc.php

示例10: __construct

 public function __construct($tagname = NULL, $paired = 'no', $body = NULL, $class = null)
 {
     parent::__construct();
     $this->options = array();
     if (!is_string($tagname)) {
         return $this->error('Incorrect tagname for CTag [' . $tagname . ']');
     }
     $this->tagname = $tagname;
     $this->paired = $paired;
     $this->tag_start = $this->tag_end = $this->tag_body_start = $this->tag_body_end = '';
     if (is_null($body)) {
         $this->tag_end = $this->tag_body_start = "\n";
     } else {
         CTag::addItem($body);
     }
     $this->setClass($class);
 }
开发者ID:rennhak,项目名称:zabbix,代码行数:17,代码来源:class.ctag.php

示例11: bold

function bold($str)
{
    if (is_array($str)) {
        foreach ($str as $key => $val) {
            if (is_string($val)) {
                $b = new CTag('strong', 'yes');
                $b->addItem($val);
                $str[$key] = $b;
            }
        }
    } else {
        $b = new CTag('strong', 'yes', '');
        $b->addItem($str);
        $str = $b;
    }
    return $str;
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:17,代码来源:html.inc.php

示例12: addItem

 public function addItem($value, $caption = '', $selected = NULL, $enabled = 'yes')
 {
     //			if($enabled=='no') return;	/* disable item method 1 */
     if (strtolower(get_class($value)) == 'ccomboitem') {
         parent::addItem($value);
     } else {
         if (is_null($selected)) {
             $selected = 'no';
             if (is_array($this->value)) {
                 if (str_in_array($value, $this->value)) {
                     $selected = 'yes';
                 }
             } else {
                 if (strcmp($value, $this->value) == 0) {
                     $selected = 'yes';
                 }
             }
         }
         parent::addItem(new CComboItem($value, $caption, $selected, $enabled));
     }
 }
开发者ID:rennhak,项目名称:zabbix,代码行数:21,代码来源:class.ccombobox.php

示例13: explode_exp

function explode_exp($expression, $html, $template = false)
{
    //		echo "EXPRESSION:",$expression,"<Br>";
    $functionid = '';
    if (0 == $html) {
        $exp = '';
    } else {
        $exp = array();
    }
    $state = '';
    for ($i = 0, $max = strlen($expression); $i < $max; $i++) {
        if ($expression[$i] == '{') {
            $functionid = '';
            $state = 'FUNCTIONID';
            continue;
        }
        if ($expression[$i] == '}') {
            $state = '';
            if ($functionid == "TRIGGER.VALUE") {
                if (0 == $html) {
                    $exp .= '{' . $functionid . '}';
                } else {
                    array_push($exp, '{' . $functionid . '}');
                }
            } else {
                if (is_numeric($functionid) && ($function_data = DBfetch(DBselect('SELECT h.host,i.key_,f.function,f.parameter,i.itemid,i.value_type' . ' FROM items i,functions f,hosts h' . ' WHERE f.functionid=' . $functionid . ' AND i.itemid=f.itemid ' . ' AND h.hostid=i.hostid')))) {
                    if ($template) {
                        $function_data["host"] = '{HOSTNAME}';
                    }
                    if ($html == 0) {
                        $exp .= '{' . $function_data['host'] . ':' . $function_data['key_'] . '.' . $function_data['function'] . '(' . $function_data['parameter'] . ')}';
                    } else {
                        $link = new CLink($function_data['host'] . ':' . $function_data['key_'], 'history.php?action=' . ($function_data['value_type'] == ITEM_VALUE_TYPE_FLOAT || $function_data['value_type'] == ITEM_VALUE_TYPE_UINT64 ? 'showgraph' : 'showvalues') . '&itemid=' . $function_data['itemid']);
                        array_push($exp, array('{', $link, '.', bold($function_data['function'] . '('), $function_data['parameter'], bold(')'), '}'));
                    }
                } else {
                    if (1 == $html) {
                        $font = new CTag('font', 'yes');
                        $font->addOption('color', '#AA0000');
                        $font->addItem('*ERROR*');
                        array_push($exp, $font);
                    } else {
                        $exp .= '*ERROR*';
                    }
                }
            }
            continue;
        }
        if ($state == "FUNCTIONID") {
            $functionid = $functionid . $expression[$i];
            continue;
        }
        if (1 == $html) {
            array_push($exp, $expression[$i]);
        } else {
            $exp .= $expression[$i];
        }
    }
    #		echo "EXP:",$exp,"<Br>";
    return $exp;
}
开发者ID:rennhak,项目名称:zabbix,代码行数:61,代码来源:triggers.inc.php

示例14: reset

    $profileIdx = 'web.item.graph';
    $profileIdx2 = reset($this->data['itemids']);
    $updateProfile = $this->data['action'] != HISTORY_BATCH_GRAPH;
}
// create history screen
$screen = CScreenBuilder::getScreen(array('resourcetype' => SCREEN_RESOURCE_HISTORY, 'action' => $this->data['action'], 'items' => $this->data['items'], 'profileIdx' => $profileIdx, 'profileIdx2' => $profileIdx2, 'updateProfile' => $updateProfile, 'period' => $this->data['period'], 'stime' => $this->data['stime'], 'filter' => getRequest('filter'), 'filter_task' => getRequest('filter_task'), 'mark_color' => getRequest('mark_color'), 'plaintext' => $this->data['plaintext'], 'graphtype' => $this->data['graphtype']));
// 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(BR());
    if (isset($this->data['iv_string'][$this->data['value_type']])) {
        $historyWidget->addFlicker($filterForm, CProfile::get('web.history.filter.state', 1));
    }
    $historyTable = new CTable(null, 'maxwidth');
    $historyTable->addRow($screen->get());
    $historyWidget->addItem($historyTable);
    if (in_array($this->data['action'], array(HISTORY_VALUES, HISTORY_GRAPH, HISTORY_BATCH_GRAPH))) {
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:monitoring.history.php

示例15: addItem

 public function addItem($value, $caption = '', $selected = null, $enabled = 'yes')
 {
     if ($value instanceof CComboItem || $value instanceof COptGroup) {
         parent::addItem($value);
     } else {
         $title = false;
         // if caption is too long ( > 44 symbols), we add new class - 'selectShorten',
         // so that the select box would not stretch
         if (zbx_strlen($caption) > 44 && !$this->hasClass('selectShorten')) {
             $this->setAttribute('class', $this->getAttribute('class') . ' selectShorten');
             $title = true;
         }
         if (is_null($selected)) {
             $selected = 'no';
             if (is_array($this->value)) {
                 if (str_in_array($value, $this->value)) {
                     $selected = 'yes';
                 }
             } elseif (strcmp($value, $this->value) == 0) {
                 $selected = 'yes';
             }
         } else {
             $selected = 'yes';
         }
         $citem = new CComboItem($value, $caption, $selected, $enabled);
         if ($title) {
             $citem->setTitle($caption);
         }
         parent::addItem($citem);
     }
 }
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:class.ccombobox.php


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