aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-02-06 15:50:50 -0800
committerFriendika <info@friendika.com>2011-02-06 15:50:50 -0800
commit147d7f3bbf6c785f2c1eb7cdcfaa0a47e0ee43d3 (patch)
tree6509082047c27a2de2ab647d4def7051ab6dc813 /boot.php
parent8e988341d01de0b061a9d14846c660e7e76d80db (diff)
downloadvolse-hubzilla-147d7f3bbf6c785f2c1eb7cdcfaa0a47e0ee43d3.tar.gz
volse-hubzilla-147d7f3bbf6c785f2c1eb7cdcfaa0a47e0ee43d3.tar.bz2
volse-hubzilla-147d7f3bbf6c785f2c1eb7cdcfaa0a47e0ee43d3.zip
theme name cleanup - rename default to loozah, provide sane fallbacks and change system primary theme.
Provide indication on contact edit page of last update success/failure - can be extended later to show actual timestamp of last successful update.
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]);
+
+
+}}
+