3 * @copyright Copyright (C) 2010-2022, the Friendica project
5 * @license GNU AGPL version 3 or any later version
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 * This file contains functions for page construction
28 * Load page template in dependence of the template mode
30 * @todo Check if this is really needed.
32 function load_page(App $a)
34 if (isset($_GET['mode']) && ($_GET['mode'] == 'minimal')) {
35 require 'view/theme/frio/minimal.php';
36 } elseif ((isset($_GET['mode']) && ($_GET['mode'] == 'none'))) {
37 require 'view/theme/frio/none.php';
39 $template = 'view/theme/' . $a->getCurrentTheme() . '/'
40 . ((DI::page()['template'] ?? '') ?: 'default' ) . '.php';
41 if (file_exists($template)) {
42 require_once $template;
44 require_once str_replace('theme/' . $a->getCurrentTheme() . '/', '', $template);
50 * Check if page is a modal page
52 * This function checks if $_REQUEST['pagename'] is
53 * a defined in a $modalpages
59 $modalpages = get_modalpage_list();
61 foreach ($modalpages as $r => $value) {
62 if(strpos($_REQUEST['pagename'],$value) !== false) {
71 * Array with modalpages
73 * The array contains the page names of the pages
74 * which should displayed as modals
76 * @return array Pagenames as path
78 function get_modalpage_list() {
79 //Arry of pages wich getting bootstrap modal dialogs
80 $modalpages = ['poke/',
91 * Array with standard pages
93 * The array contains the page names of the pages
94 * which should displayed as standard-page
96 * @return array Pagenames as path
98 function get_standard_page_list() {
99 //Arry of pages wich getting the standard page template
100 $standardpages = [//'profile',
104 return $standardpages;
108 * Check if page is standard page
110 * This function checks if $_REQUEST['pagename'] is
111 * a defined $standardpages
113 * @param string $pagetitle Title of the actual page
116 function is_standard_page($pagetitle) {
117 $is_standard_page = false;
118 $standardpages = get_standard_page_list();
120 foreach ($standardpages as $r => $value) {
121 if(strpos($pagetitle,$value) !== false) {
122 $is_standard_page = true;
126 return $is_standard_page;
129 * Get the typ of the page
131 * @param type $pagetitle
134 function get_page_type($pagetitle) {
138 $page_type = "modal";
140 if(is_standard_page($pagetitle))
141 $page_type = "standard_page";