示例#1
0
 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;
 }
示例#2
0
 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;
 }
示例#3
0
 public function getActivePages()
 {
     $query = "SELECT * FROM pages WHERE active = true";
     $result = parent::query($query);
     return $result;
 }
示例#4
0
 public function getImages()
 {
     $query = "SELECT * FROM `media`";
     $result = parent::query($query);
     return $result;
 }