Exemplo n.º 1
0
 /**
  * Build the orderby for the query
  *
  * @return  string	$orderby portion of query
  *
  * @since   1.5
  */
 protected function _buildContentOrderBy()
 {
     $app = JFactory::getApplication('site');
     $db = $this->getDbo();
     $params = $this->state->params;
     $itemid = $app->input->get('id', 0, 'int') . ':' . $app->input->get('Itemid', 0, 'int');
     $orderCol = $app->getUserStateFromRequest('com_digicom.category.list.' . $itemid . '.filter_order', 'filter_order', '', 'string');
     $orderDirn = $app->getUserStateFromRequest('com_digicom.category.list.' . $itemid . '.filter_order_Dir', 'filter_order_Dir', '', 'cmd');
     $orderby = ' ';
     if (!in_array($orderCol, $this->filter_fields)) {
         $orderCol = null;
     }
     if (!in_array(strtoupper($orderDirn), array('ASC', 'DESC', ''))) {
         $orderDirn = 'ASC';
     }
     if ($orderCol && $orderDirn) {
         $orderby .= $db->escape($orderCol) . ' ' . $db->escape($orderDirn) . ', ';
     }
     $productOrderby = $params->get('orderby_sec', 'rdate');
     $productOrderDate = $params->get('order_date');
     $categoryOrderby = $params->def('orderby_pri', '');
     $secondary = DigiComSiteHelperQuery::orderbySecondary($productOrderby, $productOrderDate) . ', ';
     $primary = DigiComSiteHelperQuery::orderbyPrimary($categoryOrderby);
     $orderby .= $primary . ' ' . $secondary . ' a.created ';
     return $orderby;
 }
Exemplo n.º 2
0
 /**
  * Prepares the document
  *
  * @return  void
  */
 protected function prepareDocument()
 {
     parent::prepareDocument();
     $menu = $this->menu;
     $id = (int) @$menu->query['id'];
     if ($menu && ($menu->query['option'] != 'com_digicom' || $menu->query['view'] == 'product' || $id != $this->category->id)) {
         $path = array(array('title' => $this->category->title, 'link' => ''));
         $category = $this->category->getParent();
         while (($menu->query['option'] != 'com_digicom' || $menu->query['view'] == 'product' || $id != $category->id) && $category->id > 1) {
             $path[] = array('title' => $category->title, 'link' => DigiComSiteHelperQuery::getCategoryRoute($category->id));
             $category = $category->getParent();
         }
         $path = array_reverse($path);
         foreach ($path as $item) {
             $this->pathway->addItem($item['title'], $item['link']);
         }
     }
     parent::addFeed();
 }