fixed bug. inactive navigation items were not showing in admin center

This commit is contained in:
Logsol 2013-11-06 13:06:36 +01:00
parent 1462348fdf
commit b9e04c6ca3
2 changed files with 5 additions and 3 deletions

View file

@ -10,7 +10,7 @@ class AdminNavigationController extends Katharsis_Controller_Abstract
public function indexAction()
{
$this->_view->list = $this->_navi->getAllItems();
$this->_view->list = $this->_navi->getAllItems(false);
}
public function editAction()

View file

@ -5,10 +5,12 @@ class Navigation extends Katharsis_Model_Abstract
{
}
public function getAllItems()
public function getAllItems($onlyActive = true)
{
$tidyResult = array();
$result = $this->_con->fetchAll("SELECT * FROM navigation WHERE parent_id IS NULL AND active = 1 ORDER BY sorting");
$activityStatement = $onlyActive ? "AND active = 1" : "";
$result = $this->_con->fetchAll("SELECT * FROM navigation WHERE parent_id IS NULL " . $activityStatement . " ORDER BY sorting");
foreach($result as $item)
{
$subSet = array();