aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php32
1 files changed, 31 insertions, 1 deletions
diff --git a/boot.php b/boot.php
index 4fc35be9b..ae6d534d6 100644
--- a/boot.php
+++ b/boot.php
@@ -2,7 +2,7 @@
set_time_limit(0);
-define ( 'BUILD_ID', 1035 );
+define ( 'BUILD_ID', 1036 );
define ( 'FRIENDIKA_VERSION', '2.10.0905' );
define ( 'DFRN_PROTOCOL_VERSION', '2.1' );
@@ -2275,3 +2275,33 @@ function proc_run($cmd){
proc_close(proc_open($cmdline." &",array(),$foo));
}}
+/*
+ * Return full URL to theme which is currently in effect.
+ * Provide a sane default if nothing is chosen or the specified theme does not exist.
+ */
+
+if(! function_exists('current_theme_url')) {
+function current_theme_url() {
+
+ $app_base_themes = array('duepuntozero', 'loozah');
+
+ $a = get_app();
+
+ $system_theme = ((isset($a->config['system']['theme'])) ? $a->config['system']['theme'] : '');
+ $theme_name = ((x($_SESSION,'theme')) ? $_SESSION['theme'] : $system_theme);
+
+ if($theme_name && file_exists('view/theme/' . $theme_name . '/style.css'))
+ return($a->get_baseurl() . '/view/theme/' . $theme_name . '/style.css');
+
+ foreach($app_base_themes as $t) {
+ if(file_exists('view/theme/' . $t . '/style.css'))
+ return($a->get_baseurl() . '/view/theme/' . $t . '/style.css');
+ }
+
+ $fallback = glob('view/theme/*/style.css');
+ if(count($fallback))
+ return($a->get_baseurl() . $fallback[0]);
+
+
+}}
+