Exemple #1
0
 /**
  * Method to set the current category
  *
  * @access    public
  * @param    int ID of current item 
  * @param    int ID of parent category
  * @return    string HTML output
  */
 public function getCurrentCategory($categories, $item_id = 0)
 {
     // If there is no current item yet and we only have one category, select it
     if ($item_id == 0) {
         if (count($categories) == 1) {
             $current = $categories;
         } else {
             $application = JFactory::getApplication();
             $option = JRequest::getCmd('option');
             $id = $application->getUserStateFromRequest($option . 'filter_category_id', 'filter_category_id', 0, 'int');
             $current = SimplelistsHelper::getCategory($id);
         }
         // Fetch the categories currently selected with the item
     } else {
         $current = SimplelistsHelper::getCategories($item_id);
     }
     return $current;
 }
 protected function addPathway($category)
 {
     // Sanity check
     if (!is_object($category)) {
         return null;
     }
     $application = JFactory::getApplication();
     $pathway = $application->getPathway();
     if ($category->parent_id > 0) {
         $pathway->addItem($category->title);
         $parent = SimplelistsHelper::getCategory($category->parent_id);
         $this->addPathway($parent);
     }
 }