public function getAllCategories() { $params = $this->getState('params'); $orderby = null; // Order by artilce switch ($params->get('orderby_pri')) { case 'alpha': $orderby = 'c.title'; break; case 'ralpha': $orderby = 'c.title DESC'; break; case 'order': $orderby = 'c.lft'; break; } if ($catid = $params->get('catid')) { $catid = array_unique($catid); $catid = array_filter($catid); if (count($catid) && ($categories = TZ_Portfolio_PlusFrontHelperCategories::getCategoriesById($catid, array('second_by_article' => true, 'orderby' => $orderby)))) { return $categories; } else { return TZ_Portfolio_PlusFrontHelperCategories::getAllCategories(array('second_by_article' => true, 'orderby' => $orderby)); } } return false; }