/** * 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; }