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


PHP OOArticle::getRootArticles方法代码示例

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


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

示例1: navi

function navi()
{
    echo "<ul>";
    // start HTML-List
    $max_depth = 3;
    // max nesting-depth root is depth=0
    $inc_art = true;
    // include articles
    $inc_root_art = false;
    // include root articles
    $inc_start_art = false;
    // include start article
    $config = array($max_depth, $inc_art, $inc_start_art, $inc_root_art);
    // config array
    $items = [];
    // wrapper for subitem sizes
    $count = 0;
    // items per nesting level
    foreach (OOCategory::getRootCategories() as $item) {
        if (!$item->isOnline()) {
            continue;
        }
        $count++;
        // initalize each root-item
        // print root-item
        echo '<li><a href="' . $item->getUrl() . '" title="' . $item->getName() . '">' . $item->getName() . '</a></li>';
        $d = 0;
        // set nesting-depth for root-item
        getSubItems($item, $d, $config);
        $d = 0;
        // REset nesting-depth for root-item
    }
    // get Root Articles
    if (sizeof(OOArticle::getRootArticles()) >= 1 && $config[3]) {
        foreach (OOArticle::getRootArticles() as $art) {
            if (!$art->isOnline()) {
                continue;
            }
            echo '<li><a href="' . $art->getUrl() . '" title="' . $art->getName() . '">' . $art->getName() . '</a></li>';
        }
    }
    echo "</ul>";
}
开发者ID:nilsology,项目名称:addcode_includes,代码行数:43,代码来源:function.navigation.frontend.php

示例2: rex_linkmap_tree

echo rex_linkmap_tree($tree, $category_id, $roots, $GlobalParams);
?>
            </div>
        </div>

        <div class="rex-area-col-b">
            <h3 class="rex-hl2"><?php 
echo $I18N->msg('lmap_articles');
?>
</h3>
            <div class="rex-area-content">
            <ul>
            <?php 
$articles = null;
if ($isRoot && count($mountpoints) == 0) {
    $articles = OOArticle::getRootArticles();
} elseif ($category) {
    $articles = $category->getArticles();
}
if ($articles) {
    foreach ($articles as $article) {
        $liClass = $article->isStartpage() ? ' class="rex-linkmap-startpage"' : '';
        $url = rex_linkmap_backlink($article->getId(), htmlspecialchars($article->getName()));
        echo rex_linkmap_format_li($article, $category_id, $GlobalParams, $liClass, ' href="' . $url . '"');
        echo '</li>' . "\n";
    }
}
?>
            </ul>
            </div>
        </div>
开发者ID:Barnhiac,项目名称:MTW_REDAXO,代码行数:31,代码来源:linkmap.inc.php

示例3: get

 function get()
 {
     $s = '';
     $s_self = '';
     $this->_depth = 0;
     if ($this->root_category === null) {
         $root_nodes = OOCategory::getRootCategories($this->ignore_offlines, $this->clang);
     } else {
         if (is_int($this->root_category) && $this->root_category === 0) {
             $root_nodes = OOArticle::getRootArticles($this->ignore_offlines, $this->clang);
         } else {
             $root_nodes = array();
             $root_category = OOCategory::_getCategoryObject($this->root_category);
             // Rootkategorien selbst nicht anzeigen, nur deren Kind-Elemente
             if (is_array($root_category)) {
                 foreach ($root_category as $root_cat) {
                     $this->_appendChilds($root_cat, $root_nodes);
                     $this->_appendArticles($root_cat, $root_nodes);
                 }
             } else {
                 $this->_appendChilds($root_category, $root_nodes);
                 $this->_appendArticles($root_category, $root_nodes);
             }
         }
     }
     if (is_array($root_nodes)) {
         foreach ($root_nodes as $node) {
             $s_self .= $this->_formatNode($node);
         }
         // Parent Tag nur erstellen, wenn auch Childs vorhanden sind
         if ($s_self != '') {
             $s .= '<' . $this->main_tag . $this->main_attr . '>';
             $s .= $s_self;
             $s .= '</' . $this->main_tag . '>';
         }
     }
     return $s;
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-addons,代码行数:38,代码来源:class.oostructure.inc.php


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