fixed navigation bugs

This commit is contained in:
Logsol 2013-07-19 11:55:06 +02:00
parent 816dc9743b
commit 6b689ae915

View file

@ -8,7 +8,7 @@ class Navigation extends Katharsis_Model_Abstract
public function getAllItems() public function getAllItems()
{ {
$tidyResult = array(); $tidyResult = array();
$result = $this->_con->fetchAll("SELECT * FROM navigation WHERE parent_id IS NULL ORDER BY sorting"); $result = $this->_con->fetchAll("SELECT * FROM navigation WHERE parent_id IS NULL AND active = 1 ORDER BY sorting");
foreach($result as $item) foreach($result as $item)
{ {
$subSet = array(); $subSet = array();
@ -23,7 +23,7 @@ class Navigation extends Katharsis_Model_Abstract
public function getMainItems() public function getMainItems()
{ {
return $this->_con->fetchAll("SELECT id, name FROM navigation WHERE parent_id IS NULL ORDER BY sorting"); return $this->_con->fetchAll("SELECT id, name FROM navigation WHERE parent_id IS NULL AND active = 1 ORDER BY sorting");
} }
public function getItem($id) public function getItem($id)
@ -230,12 +230,14 @@ class Navigation extends Katharsis_Model_Abstract
controller = :controller, controller = :controller,
action = :action, action = :action,
link = :link, link = :link,
parent_id = parent_id, parent_id = :parent_id,
active = :active active = :active
WHERE WHERE
id = :id id = :id
"; ";
$sql = $this->_con->createStatement($sql, $values); $sql = $this->_con->createStatement($sql, $values);
$this->_con->run($sql); $this->_con->run($sql);
} }
else else