Esempio n. 1
0
 protected static function _findItemId($needles)
 {
     // Prepare the reverse lookup array.
     if (self::$lookup === null) {
         self::$lookup = array();
         $component =& JComponentHelper::getComponent('com_newsfeeds');
         $menus =& JApplication::getMenu('site', array());
         $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;
                 }
             }
         }
     }
     $match = null;
     foreach ($needles as $view => $id) {
         if (isset(self::$lookup[$view])) {
             if (isset(self::$lookup[$view][$id])) {
                 return self::$lookup[$view][$id];
             }
         }
     }
     return null;
 }
Esempio n. 2
0
                echo "</ul>";
            }
            $curLevel = $item->level;
        } elseif ($difLevel > 0) {
            for ($i = 0, $n = $difLevel; $i < $n; $i++) {
                ?>
			<ul>
		<?php 
            }
            $curLevel = $item->level;
        }
        ?>

	<li>
		<span class="jitem-title"><a href="<?php 
        echo NewsfeedsRoute::category('index.php?option=com_newsfeeds&view=category&id=' . $this->escape($item->slug));
        ?>
">
			<?php 
        echo $this->escape($item->title);
        ?>
</a>
		</span>
		<?php 
        if ($item->description) {
            ?>
			<div class="jdescription">
				<?php 
            echo $item->description;
            ?>
			</div>
Esempio n. 3
0
    ?>
	no siblings
<?php 
} else {
    ?>
	<h5>Siblings</h5>
	<ul>
		<?php 
    foreach ($this->siblings as &$item) {
        ?>
		<li>
			<?php 
        if ($item->id != $this->item->id) {
            ?>
			<a href="<?php 
            echo JRoute::_(NewsfeedsRoute::category($item->slug));
            ?>
">
				<?php 
            echo $this->escape($item->title);
            ?>
</a>
			<?php 
        } else {
            ?>
				<?php 
            echo $this->escape($item->title);
            ?>
			<?php 
        }
        ?>