4 * @file view/theme/frio/php/frio_boot.php
6 * This file contains functions for page construction
14 * Load page template in dependence of the template mode
16 * @todo Check if this is really needed.
18 function load_page(App $a)
20 if (isset($_GET['mode']) && ($_GET['mode'] == 'minimal')) {
21 require 'view/theme/frio/minimal.php';
22 } elseif ((isset($_GET['mode']) && ($_GET['mode'] == 'none'))) {
23 require 'view/theme/frio/none.php';
25 $template = 'view/theme/' . $a->getCurrentTheme() . '/'
26 . ((DI::page()['template'] ?? '') ?: 'default' ) . '.php';
27 if (file_exists($template)) {
28 require_once $template;
30 require_once str_replace('theme/' . $a->getCurrentTheme() . '/', '', $template);
36 * 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 * 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 * 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 * 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 * 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";