Example #1
0
 protected static function _findItem($needles = null)
 {
     $app = JFactory::getApplication();
     $menus = $app->getMenu('site');
     // Prepare the reverse lookup array.
     if (self::$lookup === null) {
         self::$lookup = array();
         $component = JComponentHelper::getComponent('com_je_content');
         $items = $menus->getItems('component_id', $component->id);
         foreach ($items as $item) {
             if (isset($item->query) && isset($item->query['view'])) {
                 $view = $item->query['view'];
                 if (!isset(self::$lookup[$view])) {
                     self::$lookup[$view] = array();
                 }
                 if (isset($item->query['id'])) {
                     self::$lookup[$view][$item->query['id']] = $item->id;
                 }
             }
         }
     }
     if ($needles) {
         foreach ($needles as $view => $ids) {
             if (isset(self::$lookup[$view])) {
                 foreach ($ids as $id) {
                     if (isset(self::$lookup[$view][(int) $id])) {
                         return self::$lookup[$view][(int) $id];
                     }
                 }
             }
         }
     } else {
         $active = $menus->getActive();
         if ($active && $active->component == 'com_je_content') {
             return $active->id;
         }
     }
     return null;
 }
Example #2
0
							
							
							<div class="clear"></div>
						</div>
						
						<ul class="news-other-list">
							<?php 
        foreach ($listArticles as $key => $article) {
            if ($key == 0) {
                continue;
            }
            $article->slug = $article->alias ? $article->id . ':' . $article->alias : $article->id;
            ?>
							<li>
							<a href="<?php 
            echo JRoute::_(JE_ContentHelperRoute::getArticleRoute($article->slug, $article->catid));
            ?>
">
								<?php 
            echo $article->title;
            ?>
							</a>
							</li>
							<?php 
        }
        ?>
						</ul>
						
						<div class="clear"></div>
					</div>