aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-08-28 19:29:22 -0700
committerfriendica <info@friendica.com>2013-08-28 19:29:22 -0700
commit1dbfb311b711e0e345909945a9ec7ede249d798e (patch)
tree120a45204f43545e1a045bc2341a50adc9d36830 /boot.php
parentc877d8f9fae246812930c2f2c45db40a52b09366 (diff)
downloadvolse-hubzilla-1dbfb311b711e0e345909945a9ec7ede249d798e.tar.gz
volse-hubzilla-1dbfb311b711e0e345909945a9ec7ede249d798e.tar.bz2
volse-hubzilla-1dbfb311b711e0e345909945a9ec7ede249d798e.zip
some basic mappings between comanche pages and normal pages so normal pages will still work
Diffstat (limited to 'boot.php')
-rwxr-xr-xboot.php37
1 files changed, 32 insertions, 5 deletions
diff --git a/boot.php b/boot.php
index e8d6d2020..ed378a45b 100755
--- a/boot.php
+++ b/boot.php
@@ -538,7 +538,7 @@ class App {
public $channel = null; // channel record
public $observer = null; // xchan record
public $profile_uid = 0; // If applicable, the uid of the person whose stuff this is.
-
+ public $layout = array(); // Comanche parsed template
private $perms = null; // observer permissions
@@ -627,6 +627,8 @@ class App {
private $cached_profile_image;
private $cached_profile_picdate;
+
+
function __construct() {
@@ -1996,6 +1998,9 @@ function current_theme(){
$page_theme = $r[0]['channel_theme'];
}
+ if(array_key_exists('theme', $a->layout) && $a->layout['theme'])
+ $page_theme = $a->layout['theme'];
+
// Allow folks to over-rule channel themes and always use their own on their own site.
// The default is for channel themes to take precedence over your own on pages belonging
// to that channel.
@@ -2006,8 +2011,6 @@ function current_theme(){
}
-// $mobile_detect = new Mobile_Detect();
-// $is_mobile = $mobile_detect->isMobile() || $mobile_detect->isTablet();
$is_mobile = $a->is_mobile || $a->is_tablet;
if($is_mobile) {
@@ -2033,6 +2036,7 @@ function current_theme(){
if($page_theme)
$theme_name = $page_theme;
}
+
if($theme_name &&
(file_exists('view/theme/' . $theme_name . '/css/style.css') ||
@@ -2361,9 +2365,18 @@ function curPageURL() {
return $pageURL;
}
-function construct_page(&$a) {
+function get_custom_nav(&$a,$navname) {
+ if(! $navname)
+ return $a->page['nav'];
+ // load custom nav menu by name here
+
+}
+function construct_page(&$a) {
+
+ $comanche = ((count($a->layout)) ? true : false);
+
/**
* Build the page - now that we have all the components
*/
@@ -2372,8 +2385,15 @@ function construct_page(&$a) {
if($a->module == 'setup')
$installing = true;
- else
+ else {
nav($a);
+ }
+
+ if($comanche) {
+ if($a->layout['nav']) {
+ $a->page['nav'] = get_custom_nav($a->layout['nav']);
+ }
+ }
require_once(theme_include('theme_init.php'));
@@ -2402,6 +2422,13 @@ function construct_page(&$a) {
$a->page[$x['location']] .= $x['html'];
}
}
+ if($comanche) {
+ foreach($a->layout as $k => $v) {
+ if(strpos($k,'region_') === 0) {
+ $a->data[substr($k,0,7)] = $v;
+ }
+ }
+ }
if($a->is_mobile || $a->is_tablet) {
if(isset($_SESSION['show_mobile']) && !$_SESSION['show_mobile']) {