4 * @file view/theme/frio/php/frio_boot.php
6 * @brief This file contains functions for page construction
13 * @brief Load page template in dependence of the template mode
15 * @todo Check if this is really needed.
17 function load_page(App $a) {
18 if(isset($_GET["mode"]) && ($_GET["mode"] == "minimal")) {
19 require "view/theme/frio/minimal.php";
20 } elseif((isset($_GET["mode"]) && ($_GET["mode"] == "none"))) {
21 require "view/theme/frio/none.php";
23 $template = 'view/theme/' . current_theme() . '/'
24 . ((x($a->page,'template')) ? $a->page['template'] : 'default' ) . '.php';
25 if(file_exists($template))
26 require_once($template);
28 require_once(str_replace('theme/' . current_theme() . '/', '', $template));
36 * @brief Check if page is a modal page
38 * This function checks if $_REQUEST['pagename'] is
39 * a defined in a $modalpages
45 $modalpages = get_modalpage_list();
47 foreach ($modalpages as $r => $value) {
48 if(strpos($_REQUEST['pagename'],$value) !== false) {
57 * @brief Array with modalpages
59 * The array contains the page names of the pages
60 * which should displayed as modals
62 * @return array Pagenames as path
64 function get_modalpage_list() {
65 //Arry of pages wich getting bootstrap modal dialogs
66 $modalpages = ['poke/',
77 * @brief Array with standard pages
79 * The array contains the page names of the pages
80 * which should displayed as standard-page
82 * @return array Pagenames as path
84 function get_standard_page_list() {
85 //Arry of pages wich getting the standard page template
86 $standardpages = [//'profile',
90 return $standardpages;
94 * @brief Check if page is standard page
96 * This function checks if $_REQUEST['pagename'] is
97 * a defined $standardpages
99 * @param string $pagetitle Title of the actual page
102 function is_standard_page($pagetitle) {
103 $is_standard_page = false;
104 $standardpages = get_standard_page_list();
106 foreach ($standardpages as $r => $value) {
107 if(strpos($pagetitle,$value) !== false) {
108 $is_standard_page = true;
112 return $is_standard_page;
115 * @brief Get the typ of the page
117 * @param type $pagetitle
120 function get_page_type($pagetitle) {
124 $page_type = "modal";
126 if(is_standard_page($pagetitle))
127 $page_type = "standard_page";