]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/frio/php/frio_boot.php
Merge pull request #8135 from annando/brief
[friendica.git] / view / theme / frio / php / frio_boot.php
index 1f816c5b2fdad7344bbf5826c7e45e07b7abfca5..fd14e147784576d4e9df5bea4c7bb8da7ba36757 100644 (file)
@@ -3,37 +3,37 @@
 /**
  * @file view/theme/frio/php/frio_boot.php
  *
- * @brief This file contains functions for page construction
+ * This file contains functions for page construction
  *
  */
 
 use Friendica\App;
+use Friendica\DI;
 
 /**
- * @brief Load page template in dependence of the template mode
+ * Load page template in dependence of the template mode
  *
  * @todo Check if this is really needed.
  */
-function load_page(App $a) {
-       if(isset($_GET["mode"]) && ($_GET["mode"] == "minimal")) {
-               require "view/theme/frio/minimal.php";
-       } elseif((isset($_GET["mode"]) && ($_GET["mode"] == "none"))) {
-               require "view/theme/frio/none.php";
+function load_page(App $a)
+{
+       if (isset($_GET['mode']) && ($_GET['mode'] == 'minimal')) {
+               require 'view/theme/frio/minimal.php';
+       } elseif ((isset($_GET['mode']) && ($_GET['mode'] == 'none'))) {
+               require 'view/theme/frio/none.php';
        } else {
-               $template = 'view/theme/' . current_theme() . '/'
-                       . ((x($a->page,'template')) ? $a->page['template'] : 'default' ) . '.php';
-               if(file_exists($template))
-                       require_once($template);
-               else
-                       require_once(str_replace('theme/' . current_theme() . '/', '', $template));
+               $template = 'view/theme/' . $a->getCurrentTheme() . '/'
+                       . ((DI::page()['template'] ?? '') ?: 'default' ) . '.php';
+               if (file_exists($template)) {
+                       require_once $template;
+               } else {
+                       require_once str_replace('theme/' . $a->getCurrentTheme() . '/', '', $template);
+               }
        }
-
-
 }
 
-
 /**
- * @brief Check if page is a modal page
+ * Check if page is a modal page
  *
  * This function checks if $_REQUEST['pagename'] is
  * a defined in a $modalpages
@@ -54,7 +54,7 @@ function is_modal() {
 }
 
 /**
- * @brief Array with modalpages
+ * Array with modalpages
  *
  * The array contains the page names of the pages
  * which should displayed as modals
@@ -74,7 +74,7 @@ function get_modalpage_list() {
 }
 
 /**
- * @brief Array with standard pages
+ * Array with standard pages
  *
  * The array contains the page names of the pages
  * which should displayed as standard-page
@@ -91,7 +91,7 @@ function get_standard_page_list() {
 }
 
 /**
- * @brief Check if page is standard page
+ * Check if page is standard page
  *
  * This function checks if $_REQUEST['pagename'] is
  * a defined $standardpages
@@ -112,7 +112,7 @@ function is_standard_page($pagetitle) {
        return $is_standard_page;
 }
 /**
- * @brief Get the typ of the page
+ * Get the typ of the page
  *
  * @param type $pagetitle
  * @return string