public function getActiveControllers() { $query = "SELECT DISTINCT type FROM pages WHERE active = true"; $result = parent::query($query); foreach ($result as $type) { $types[] = $type['type']; } //Remove labels from array for easy in_array. return $types; }
public function getMenuOptions() { $query = "SELECT * FROM `pages` WHERE active = true ORDER BY `order`, `id`"; $result = parent::query($query); foreach ($result as $pageLink) { if ($_SESSION['user']['userRole'] == 'Admin' || !$pageLink['admin']) { //If session is Admin OR the page is not admin only, make link $menuOptions[$pageLink['title']] = '/' . $pageLink['type'] . '/'; } } //Array key is display title, value is link return $menuOptions; }
public function getActivePages() { $query = "SELECT * FROM pages WHERE active = true"; $result = parent::query($query); return $result; }
public function getImages() { $query = "SELECT * FROM `media`"; $result = parent::query($query); return $result; }