예제 #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;
 }