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)
19 if (isset($_GET['mode']) && ($_GET['mode'] == 'minimal')) {
20 require 'view/theme/frio/minimal.php';
21 } elseif ((isset($_GET['mode']) && ($_GET['mode'] == 'none'))) {
22 require 'view/theme/frio/none.php';
24 $template = 'view/theme/' . $a->getCurrentTheme() . '/'
25 . (($a->page['template'] ?? '') ?: 'default' ) . '.php';
26 if (file_exists($template)) {
27 require_once $template;
29 require_once str_replace('theme/' . $a->getCurrentTheme() . '/', '', $template);
35 * @brief Check if page is a modal page
37 * This function checks if $_REQUEST['pagename'] is
38 * a defined in a $modalpages
44 $modalpages = get_modalpage_list();
46 foreach ($modalpages as $r => $value) {
47 if(strpos($_REQUEST['pagename'],$value) !== false) {
56 * @brief Array with modalpages
58 * The array contains the page names of the pages
59 * which should displayed as modals
61 * @return array Pagenames as path
63 function get_modalpage_list() {
64 //Arry of pages wich getting bootstrap modal dialogs
65 $modalpages = ['poke/',
76 * @brief Array with standard pages
78 * The array contains the page names of the pages
79 * which should displayed as standard-page
81 * @return array Pagenames as path
83 function get_standard_page_list() {
84 //Arry of pages wich getting the standard page template
85 $standardpages = [//'profile',
89 return $standardpages;
93 * @brief Check if page is standard page
95 * This function checks if $_REQUEST['pagename'] is
96 * a defined $standardpages
98 * @param string $pagetitle Title of the actual page
101 function is_standard_page($pagetitle) {
102 $is_standard_page = false;
103 $standardpages = get_standard_page_list();
105 foreach ($standardpages as $r => $value) {
106 if(strpos($pagetitle,$value) !== false) {
107 $is_standard_page = true;
111 return $is_standard_page;
114 * @brief Get the typ of the page
116 * @param type $pagetitle
119 function get_page_type($pagetitle) {
123 $page_type = "modal";
125 if(is_standard_page($pagetitle))
126 $page_type = "standard_page";