コード例 #1
0
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>";
}
コード例 #2
0
 function _getNavigation($category_id, $ignore_offlines = TRUE)
 {
     static $depth = 0;
     if ($category_id < 1) {
         $nav_obj = OOCategory::getRootCategories($ignore_offlines);
     } else {
         $nav_obj = OOCategory::getChildrenById($category_id, $ignore_offlines);
     }
     $return = "";
     if (count($nav_obj) > 0) {
         $return .= '<ul class="rex-navi' . ($depth + 1) . '">';
     }
     foreach ($nav_obj as $nav) {
         $liClass = '';
         $linkClass = '';
         // classes abhaengig vom pfad
         if ($nav->getId() == $this->current_category_id) {
             $liClass .= ' rex-current';
             $linkClass .= ' rex-current';
         } elseif (in_array($nav->getId(), $this->path)) {
             $liClass .= ' rex-active';
             $linkClass .= ' rex-active';
         } else {
             $liClass .= ' rex-normal';
         }
         // classes abhaengig vom level
         if (isset($this->classes[$depth])) {
             $liClass .= ' ' . $this->classes[$depth];
         }
         if (isset($this->linkclasses[$depth])) {
             $linkClass .= ' ' . $this->linkclasses[$depth];
         }
         $linkClass = $linkClass == '' ? '' : ' class="' . ltrim($linkClass) . '"';
         $return .= '<li class="rex-article-' . $nav->getId() . $liClass . '">';
         $return .= '<a' . $linkClass . ' href="' . $nav->getUrl() . '">' . htmlspecialchars($nav->getName()) . '</a>';
         $depth++;
         if (($this->open || $nav->getId() == $this->current_category_id || in_array($nav->getId(), $this->path)) && ($this->depth > $depth || $this->depth < 0)) {
             $return .= $this->_getNavigation($nav->getId(), $ignore_offlines);
         }
         $depth--;
         $return .= '</li>';
     }
     if (count($nav_obj) > 0) {
         $return .= '</ul>';
     }
     return $return;
 }
コード例 #3
0
ファイル: class.nav42.inc.php プロジェクト: omphteliba/seo42
 protected function _getNavigation($categoryId)
 {
     global $REX;
     static $depth = 0;
     if ($categoryId < 1) {
         $cats = OOCategory::getRootCategories($this->ignoreOfflines);
     } else {
         $cats = OOCategory::getChildrenById($categoryId, $this->ignoreOfflines);
     }
     $return = '';
     $ulIdAttribute = '';
     $ulClassAttribute = '';
     if (count($cats) > 0) {
         if (isset($this->ulId[$depth])) {
             $ulIdAttribute = ' id="' . $this->ulId[$depth] . '"';
         }
         if (isset($this->ulClass[$depth])) {
             $ulClassAttribute = ' class="' . $this->ulClass[$depth] . '"';
         }
         $return .= '<ul' . $ulIdAttribute . $ulClassAttribute . '>';
     }
     foreach ($cats as $cat) {
         if ($this->_checkCallbacks($cat, $depth)) {
             $cssClasses = '';
             $idAttribute = '';
             // default li class
             if ($this->liClass != '') {
                 $cssClasses .= ' ' . $this->liClass;
             }
             // li class
             if (is_array($this->liClassFromCategoryId) && isset($this->liClassFromCategoryId[$cat->getId()])) {
                 $cssClasses .= ' ' . $this->liClassFromCategoryId[$cat->getId()];
             }
             if ($this->liClassFromMetaField != '' && $cat->getValue($this->liClassFromMetaField) != '') {
                 $cssClasses .= ' ' . $cat->getValue($this->liClassFromMetaField);
             }
             // li id
             if (is_array($this->liIdFromCategoryId) && isset($this->liIdFromCategoryId[$cat->getId()])) {
                 $idAttribute = ' id="' . $this->liIdFromCategoryId[$cat->getId()] . '"';
             } elseif ($this->liIdFromMetaField != '' && $cat->getValue($this->liIdFromMetaField) != '') {
                 $idAttribute = ' id="' . $cat->getValue($this->liIdFromMetaField) . '"';
             }
             // selected class
             if ($cat->getId() == $this->current_category_id) {
                 // active menuitem
                 $cssClasses .= ' ' . $this->activeClass;
             } elseif (in_array($cat->getId(), $this->path)) {
                 // current menuitem
                 $cssClasses .= ' ' . $this->selectedClass;
             } else {
                 // do nothing
             }
             $trimmedCssClasses = trim($cssClasses);
             // build class attribute
             if ($trimmedCssClasses != '') {
                 $classAttribute = ' class="' . $trimmedCssClasses . '"';
             } else {
                 $classAttribute = '';
             }
             if ($this->hideWebsiteStartArticle && $cat->getId() == $REX['START_ARTICLE_ID'] || in_array($cat->getId(), $this->hideIds)) {
                 // do nothing
             } else {
                 $depth++;
                 $urlType = 0;
                 // default
                 $return .= '<li' . $idAttribute . $classAttribute . '>';
                 if ($this->linkFromUserFunc != '') {
                     $defaultLink = call_user_func($this->linkFromUserFunc, $cat, $depth);
                 } else {
                     $defaultLink = '<a href="' . $cat->getUrl() . '">' . htmlspecialchars($cat->getName()) . '</a>';
                 }
                 if (!class_exists('seo42')) {
                     // normal behaviour
                     $return .= $defaultLink;
                 } else {
                     // only with seo42 2.0.0+
                     $urlData = seo42::getCustomUrlData($cat);
                     // check if default lang has url clone option (but only if current categoy has no url data set)
                     if (count($REX['CLANG']) > 1 && !isset($urlData['url_type'])) {
                         $defaultLangCat = OOCategory::getCategoryById($cat->getId(), $REX['START_CLANG_ID']);
                         $urlDataDefaultLang = seo42::getCustomUrlData($defaultLangCat);
                         if (isset($urlDataDefaultLang['url_clone']) && $urlDataDefaultLang['url_clone']) {
                             // clone url data from default language to current language
                             $urlData = $urlDataDefaultLang;
                         }
                     }
                     if (isset($urlData['url_type'])) {
                         switch ($urlData['url_type']) {
                             case 5:
                                 // SEO42_URL_TYPE_NONE
                                 $return .= htmlspecialchars($cat->getName());
                                 break;
                             case 4:
                                 // SEO42_URL_TYPE_LANGSWITCH
                                 $newClangId = $urlData['clang_id'];
                                 $newArticleId = $REX['ARTICLE_ID'];
                                 $catNewLang = OOCategory::getCategoryById($newArticleId, $newClangId);
                                 // if category that should be switched is not online, switch to start article of website
                                 if (OOCategory::isValid($catNewLang) && !$catNewLang->isOnline()) {
                                     $newArticleId = $REX['START_ARTICLE_ID'];
                                 }
                                 // select li that is current language
                                 if ($REX['CUR_CLANG'] == $newClangId) {
                                     $return = substr($return, 0, strlen($return) - strlen('<li>'));
                                     $return .= '<li class="' . $this->selectedClass . '">';
                                 }
                                 $return .= '<a href="' . rex_getUrl($newArticleId, $newClangId) . '">' . htmlspecialchars($cat->getName()) . '</a>';
                                 break;
                             case 8:
                                 // SEO42_URL_TYPE_CALL_FUNC
                                 $return .= call_user_func($urlData['func'], $cat);
                                 break;
                             default:
                                 $return .= $defaultLink;
                                 break;
                         }
                     } else {
                         $return .= $defaultLink;
                     }
                 }
                 if (($this->showAll || $cat->getId() == $this->current_category_id || in_array($cat->getId(), $this->path)) && ($this->levelDepth > $depth || $this->levelDepth < 0)) {
                     $return .= $this->_getNavigation($cat->getId());
                 }
                 $depth--;
                 $return .= '</li>';
             }
         }
     }
     if (count($cats) > 0) {
         $return .= '</ul>';
     }
     return $return;
 }
コード例 #4
0
                 }
             }
             echo "<tr>\n\t\t\t\t\t\t<td class=grey width=150>" . $I18N->msg("copy_article") . "</td>\n\t\t\t\t\t\t<td class=grey>" . $move_a->out() . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=grey>&nbsp;</td>\n\t\t\t\t\t\t<td class=grey><input type=submit value='" . $I18N->msg("content_submitcopyarticle") . "' size=8></td>\n\t\t\t\t\t</tr>";
             print '</form>';
         }
         // --------------------------------------------------- ARTIKEL KOPIEREN ENDE
         // --------------------------------------------------- KATEGORIE/STARTARTIKEL VERSCHIEBEN START
         if ($article->getValue("startpage") == 1 && ($REX_USER->isValueOf("rights", "admin[]") || $REX_USER->isValueOf("rights", "moveCategory[]"))) {
             print "<form action=index.php method=get>\n\t\t\t\t\t\t<input type=hidden name=page value=content>\n\t\t\t\t\t\t<input type=hidden name=article_id value='{$article_id}'>\n\t\t\t\t\t\t<input type=hidden name=mode value='meta'>\n\t\t\t\t\t\t<input type=hidden name=clang value={$clang}>\n\t\t\t\t\t\t<input type=hidden name=ctype value={$ctype}>\n\t\t\t\t\t\t<input type=hidden name=function value=movecategory>";
             $move_a = new select();
             $move_a->set_name("category_id_new");
             $move_a->set_style("width:100%;");
             $move_a->set_size(1);
             $move_a->set_selected($article_id);
             $move_a->add_option("---", 0);
             if ($cats = OOCategory::getRootCategories()) {
                 foreach ($cats as $cat) {
                     add_cat_options($move_a, $cat, $cat_ids, "", "&nbsp;&nbsp;");
                 }
             }
             echo "<tr>\n\t\t\t\t\t\t<td class=grey width=150>" . $I18N->msg("move_category") . "</td>\n\t\t\t\t\t\t<td class=grey>" . $move_a->out() . "</td>\n\t\t\t\t\t  </tr>\n\t\t\t\t\t  <tr>\n\t\t\t\t\t    <td class=grey>&nbsp;</td>\n\t\t\t\t\t\t<td class=grey><input type=submit value='" . $I18N->msg("content_submitmovecategory") . "' size=8></td>\n\t\t\t\t\t</tr>";
             print '</form>';
         }
         // ------------------------------------------------ KATEGROIE/STARTARTIKEL VERSCHIEBEN ENDE
         echo "</table>";
     }
     // ------------------------------------------------------------- SONSTIGES ENDE
     // ------------------------------------------ END: META VIEW
 }
 echo "    </td>\n    \t<td class=lgrey>&nbsp;</td>\n        </tr>\n        </table>";
 // ------------------------------------------ END: AUSGABE
コード例 #5
0
  else if (isDomIE)
    document.all[layerName].style.top=y
  else if (isDomNN)
    document.layers[layerName].top=y
}

var id2treeIndex = new Array()


function initArray()
{

<?php 
###################### FILL THE LINKMAP ARRAY #########################################
print "Note(0,-1,'','')\n";
foreach (OOCategory::getRootCategories(false) as $cat) {
    $parent = $cat->getId() * 9999;
    $color = $cat->_status != 1 ? "red" : "green";
    print "Note(" . $parent . ",0,'<font color=" . $color . ">" . ereg_replace("\n|\r|\"|'", "", $cat->getName()) . "</font>','')\n";
    foreach ($cat->getArticles(false) as $art) {
        $color = $art->_status != 1 ? "red" : "green";
        print "Note(" . $art->getId() . "," . $parent . ",'<font color=" . $color . ">" . ereg_replace("\n|\r|\"|'", "", $art->getName()) . "</font>','redaxo://" . $art->getId() . "')\n";
    }
    foreach ($cat->getChildren(false) as $sub1) {
        $parent1 = $sub1->getId() * 9999;
        $color = $sub1->_status != 1 ? "red" : "green";
        print "Note(" . $parent1 . "," . $parent . ",'<font color=" . $color . ">" . ereg_replace("\n|\r|\"|'", "", $sub1->getName()) . "</font>','')\n";
        foreach ($sub1->getArticles(false) as $art) {
            $color = $art->_status != 1 ? "red" : "green";
            print "Note(" . $art->getId() . "," . $parent1 . ",'<font color=" . $color . ">" . ereg_replace("\n|\r|\"|'", "", $art->getName()) . "</font>','redaxo://" . $art->getId() . "')\n";
        }
コード例 #6
0
  else if (isDomIE)
    document.all[layerName].style.top=y
  else if (isDomNN)
    document.layers[layerName].top=y
}

var id2treeIndex = new Array()


function initArray()
{

<?php 
###################### FILL THE LINKMAP ARRAY #########################################
print "Note(0,-1,'','')\n";
foreach (OOCategory::getRootCategories(true) as $cat) {
    $parent = $cat->getId() * 9999;
    print "Note(" . $parent . ",0,'" . $cat->getName() . "','')\n";
    foreach ($cat->getArticles(false) as $art) {
        print "Note(" . $art->getId() . "," . $parent . ",'" . $art->getName() . "','redaxo://" . $art->getId() . "')\n";
    }
    foreach ($cat->getChildren(true) as $sub1) {
        $parent1 = $sub1->getId() * 9999;
        print "Note(" . $parent1 . "," . $parent . ",'" . $sub1->getName() . "','')\n";
        foreach ($sub1->getArticles(false) as $art) {
            print "Note(" . $art->getId() . "," . $parent1 . ",'" . $art->getName() . "','redaxo://" . $art->getId() . "')\n";
        }
        foreach ($sub1->getChildren(true) as $sub2) {
            $parent2 = $sub2->getId() * 9999;
            print "Note(" . $parent2 . "," . $parent1 . ",'" . $sub2->getName() . "','')\n";
            foreach ($sub2->getArticles(false) as $art) {
コード例 #7
0
ファイル: linkmap.inc.php プロジェクト: Barnhiac/MTW_REDAXO
rex_title('Linkmap', $navi_path);
?>




<div id="rex-linkmap">
    <div class="rex-area-col-2">
        <div class="rex-area-col-a">
            <h3 class="rex-hl2"><?php 
echo $I18N->msg('lmap_categories');
?>
</h3>
            <div class="rex-area-content">
            <?php 
$roots = OOCategory::getRootCategories();
$mountpoints = $REX['USER']->getMountpoints();
if (count($mountpoints) > 0) {
    $roots = array();
    foreach ($mountpoints as $mp) {
        if (OOCategory::getCategoryById($mp)) {
            $roots[] = OOCategory::getCategoryById($mp);
        }
    }
}
echo rex_linkmap_tree($tree, $category_id, $roots, $GlobalParams);
?>
            </div>
        </div>

        <div class="rex-area-col-b">
コード例 #8
0
 function enterObject()
 {
     global $REX;
     $multiple = $this->getElement('multiple') == 1;
     $options = array();
     if ($this->getElement('homepage')) {
         $options[0] = 'Homepage';
     }
     $ignoreOfflines = $this->getElement('ignore_offlines');
     $checkPerms = $this->getElement('check_perms');
     $clang = (int) $this->getElement('clang');
     $add = function (OOCategory $cat, $level = 0) use(&$add, &$options, $ignoreOfflines, $checkPerms, $clang) {
         global $REX;
         if (!$checkPerms || $REX['USER']->hasCategoryPerm($cat->getId(), false)) {
             $cid = $cat->getId();
             $cname = $cat->getName();
             if ($REX['USER']->hasPerm('advancedMode[]')) {
                 $cname .= ' [' . $cid . ']';
             }
             $options[$cid] = str_repeat('&nbsp;&nbsp;&nbsp;', $level) . $cname;
             $childs = $cat->getChildren($ignoreOfflines, $clang);
             if (is_array($childs)) {
                 foreach ($childs as $child) {
                     $add($child, $level + 1);
                 }
             }
         }
     };
     if ($rootId = $this->getElement('category')) {
         if ($rootCat = OOCategory::getCategoryById($rootId, $clang)) {
             $add($rootCat);
         }
     } else {
         if (!$checkPerms || $REX['USER']->isAdmin() || $REX['USER']->hasPerm('csw[0]')) {
             if ($rootCats = OOCategory::getRootCategories($ignoreOfflines, $clang)) {
                 foreach ($rootCats as $rootCat) {
                     $add($rootCat);
                 }
             }
         } elseif ($REX['USER']->hasMountpoints()) {
             $mountpoints = $REX['USER']->getMountpoints();
             foreach ($mountpoints as $id) {
                 $cat = OOCategory::getCategoryById($id, $clang);
                 if ($cat && !$REX['USER']->hasCategoryPerm($cat->getParentId())) {
                     $add($cat);
                 }
             }
         }
     }
     if ($multiple) {
         $size = (int) $this->getElement('size');
         if ($size < 2) {
             $size = count($options);
         }
     } else {
         $size = 1;
     }
     if (!is_array($this->getValue())) {
         $this->setValue(explode(',', $this->getValue()));
     }
     $this->params['form_output'][$this->getId()] = $this->parse('value.select.tpl.php', compact('options', 'multiple', 'size'));
     $this->setValue(implode(',', $this->getValue()));
     $this->params['value_pool']['email'][$this->getName()] = $this->getValue();
     if ($this->getElement(4) != 'no_db') {
         $this->params['value_pool']['sql'][$this->getName()] = $this->getValue();
     }
 }
コード例 #9
0
                $parent1 = $sub1->getId();
                print "Note(" . $parent1 . "," . $parent . ",'" . ereg_replace("\n|\r|\"|'", "", $sub1->getName()) . "','')\n";
                // hat artikel ?!?
                $myart = $sub1->getArticles(false);
                if (sizeof($myart) > 0) {
                    foreach ($myart as $art) {
                        print "Note(" . (100000 + $art->getId()) . "," . $parent1 . ",'" . ereg_replace("\n|\r|\"|'", "", $art->getName()) . "','redaxo://" . $art->getId() . "')\n";
                    }
                }
                // ist knoten und hat unterartikel ?
                rex_linkFolder($sub1->getChildren(), $parent1, $faktor + 1);
            }
        }
    }
}
rex_linkFolder(OOCategory::getRootCategories(false), 0, 100);
?>

  treeTyp[0] = 'f'
  treeIsOn[0] = true
  treeWasOn[0] = true
}

function preOpen()
{
  var self_url=location.href
  var rexep = /[&?]id=(\d+(,\d+)*)/
  if (rexep.test(self_url))
  {
    rexep.exec(self_url)
    var a_id=RegExp.$1.split(',')
コード例 #10
0
					<div class="breadcrumbs"><?php 
print $breadcrumbs;
?>
</div>
				</div>
			</div>
			<div class="row" data-match-height>
				REX_ARTICLE[]
			</div>
		</div>
	</section>
	<footer>
		<div class="container">
			<div class="row" data-match-height>
				<?php 
foreach (OOCategory::getRootCategories(true) as $lev1) {
    print '<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">';
    print '<div class="footer-box" data-height-watch><a href="' . $lev1->getUrl() . '">' . $lev1->getName() . '</a></div>';
    print '</div>';
}
?>
			</div>
		</div>
	</footer>
	<script type="text/javascript" src="<?php 
echo seo42::getMediaFile("bootstrap.min.js");
?>
"></script>
	<script>
		$(window).on("load",
			function(e) {
コード例 #11
0
 function rex_category_select($ignore_offlines = false, $clang = false, $check_perms = true, $add_homepage = true)
 {
     $this->ignore_offlines = $ignore_offlines;
     $this->clang = $clang;
     $this->check_perms = $check_perms;
     if ($add_homepage) {
         $this->addOption('Homepage', 0);
     }
     if ($cats = OOCategory::getRootCategories($ignore_offlines, $clang)) {
         foreach ($cats as $cat) {
             $this->addCatOption($cat);
         }
     }
     parent::rex_select();
 }
コード例 #12
0
 function _getNavigation($category_id, $depth = 1)
 {
     if ($category_id < 1) {
         $nav_obj = OOCategory::getRootCategories();
     } else {
         $nav_obj = OOCategory::getChildrenById($category_id);
     }
     $lis = array();
     foreach ($nav_obj as $nav) {
         $li = array();
         $a = array();
         $li['class'] = array();
         $a['class'] = array();
         $a['href'] = array($nav->getUrl());
         if ($this->_checkFilter($nav, $depth) && $this->_checkCallbacks($nav, $depth, $li, $a)) {
             $li['class'][] = 'rex-article-' . $nav->getId();
             // classes abhaengig vom pfad
             if ($nav->getId() == $this->current_category_id) {
                 $li['class'][] = 'rex-current';
                 $a['class'][] = 'rex-current';
             } elseif (in_array($nav->getId(), $this->path)) {
                 $li['class'][] = 'rex-active';
                 $a['class'][] = 'rex-active';
             } else {
                 $li['class'][] = 'rex-normal';
             }
             if (isset($this->linkclasses[$depth - 1])) {
                 $a['class'][] = $this->linkclasses[$depth - 1];
             }
             if (isset($this->classes[$depth - 1])) {
                 $li['class'][] = $this->classes[$depth - 1];
             }
             $li_attr = array();
             foreach ($li as $attr => $v) {
                 $li_attr[] = $attr . '="' . implode(' ', $v) . '"';
             }
             $a_attr = array();
             foreach ($a as $attr => $v) {
                 $a_attr[] = $attr . '="' . implode(' ', $v) . '"';
             }
             $l = '<li ' . implode(' ', $li_attr) . '>';
             $l .= '<a ' . implode(' ', $a_attr) . '>' . htmlspecialchars($nav->getName()) . '</a>';
             $depth++;
             if (($this->open || $nav->getId() == $this->current_category_id || in_array($nav->getId(), $this->path)) && ($this->max_depth >= $depth || $this->max_depth < 0)) {
                 $l .= $this->_getNavigation($nav->getId(), $depth);
             }
             $depth--;
             $l .= '</li>';
             $lis[] = $l;
         }
     }
     if (count($lis) > 0) {
         return '<ul class="rex-navi' . $depth . ' rex-navi-depth-' . $depth . ' rex-navi-has-' . count($lis) . '-elements">' . implode('', $lis) . '</ul>';
     }
     return '';
 }
コード例 #13
0
 function _getNavigation($category_id, $ignore_offlines = TRUE)
 {
     static $depth = 0;
     if ($category_id < 1) {
         $nav_obj = OOCategory::getRootCategories($ignore_offlines);
     } else {
         $nav_obj = OOCategory::getChildrenById($category_id, $ignore_offlines);
     }
     $nav_real = array();
     foreach ($nav_obj as $nav) {
         // Filter und Rechte prüfen
         if ($this->_check($nav, $depth)) {
             $nav_real[] = $nav;
         }
     }
     $counter = 0;
     $count = count($nav_real);
     //		$count = 4;
     $return = "";
     if (count($nav_real) > 0) {
         $return .= '<ul class="navi-lev-' . ($depth + 1) . '">';
     }
     foreach ($nav_real as $nav) {
         $counter++;
         $liClass = '';
         $linkClass = '';
         if ($counter == 1) {
             $liClass .= ' first';
         }
         if ($counter == $count) {
             $liClass .= ' last';
         }
         // classes abhaengig vom pfad
         if ($nav->getId() == $this->current_category_id) {
             $liClass .= ' current';
             $linkClass .= ' current';
         } elseif (in_array($nav->getId(), $this->path)) {
             $liClass .= ' active';
             $linkClass .= ' active';
         } else {
             $liClass .= ' normal';
         }
         // classes abhaengig vom level
         if (isset($this->classes[$depth])) {
             $liClass .= ' ' . $this->classes[$depth];
         }
         if (isset($this->linkclasses[$depth])) {
             $linkClass .= ' ' . $this->linkclasses[$depth];
         }
         $name = str_replace(' ## ', '<br />', htmlspecialchars($nav->getName()), $str_count);
         if ($str_count >= 1) {
             $linkClass .= ' manbreak';
         }
         $linkClass = $linkClass == '' ? '' : ' class="' . ltrim($linkClass) . '"';
         if (isset($this->wrap_names[$depth]) && $this->wrap_names[$depth] != "") {
             $wrap = explode('|', $this->wrap_names[$depth]);
             $name = $wrap[0] . $name . $wrap[1];
         }
         $link = '<a' . $linkClass . ' href="' . $nav->getUrl() . '">' . $name . '</a>';
         if (isset($this->wrap_links[$depth]) && $this->wrap_links[$depth] != "") {
             $wrap = explode('|', $this->wrap_links[$depth]);
             $link = $wrap[0] . $link . $wrap[1];
         }
         $return .= '<li class="navi-id-' . $nav->getId() . $liClass . '">' . $link;
         $depth++;
         if (($this->open || $nav->getId() == $this->current_category_id || in_array($nav->getId(), $this->path)) && ($this->depth > $depth || $this->depth < 0)) {
             $return .= $this->_getNavigation($nav->getId(), $ignore_offlines);
         }
         $depth--;
         $return .= '</li>';
     }
     if (count($nav_real) > 0) {
         $return .= '</ul>';
     }
     return $return;
 }
コード例 #14
0
 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;
 }
コード例 #15
0
 function addCatOptions()
 {
     global $REX;
     if ($this->add_homepage) {
         $this->addOption('Homepage', 0);
     }
     if ($this->rootId !== null) {
         if (is_array($this->rootId)) {
             foreach ($this->rootId as $rootId) {
                 if ($rootCat = OOCategory::getCategoryById($rootId, $this->clang)) {
                     $this->addCatOption($rootCat, 0);
                 }
             }
         } else {
             if ($rootCat = OOCategory::getCategoryById($this->rootId, $this->clang)) {
                 $this->addCatOption($rootCat, 0);
             }
         }
     } else {
         if (!$this->check_perms || $REX['USER']->isAdmin() || $REX['USER']->hasPerm('csw[0]')) {
             if ($rootCats = OOCategory::getRootCategories($this->ignore_offlines, $this->clang)) {
                 foreach ($rootCats as $rootCat) {
                     $this->addCatOption($rootCat);
                 }
             }
         } elseif ($REX['USER']->hasMountpoints()) {
             $mountpoints = $REX['USER']->getMountpoints();
             foreach ($mountpoints as $id) {
                 $cat = OOCategory::getCategoryById($id, $this->clang);
                 if ($cat && !$REX['USER']->hasCategoryPerm($cat->getParentId())) {
                     $this->addCatOption($cat, 0);
                 }
             }
         }
     }
 }