summaryrefslogtreecommitdiffstats
path: root/etc/inc/util.inc
diff options
context:
space:
mode:
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r--etc/inc/util.inc23
1 files changed, 23 insertions, 0 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index fcfc21e..0f8d78a 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -1541,4 +1541,27 @@ function get_staticroutes($returnsubnetsonly = false) {
return $allstaticroutes;
}
}
+
+function get_current_theme() {
+ global $config, $g;
+ /*
+ * if user has selected a custom template, use it.
+ * otherwise default to pfsense tempalte
+ */
+ if (($g["disablethemeselection"] === true) && !empty($g["default_theme"]) && (is_dir($g["www_path"].'/themes/'.$g["default_theme"])))
+ $theme = $g["default_theme"];
+ elseif($config['theme'] <> "" && (is_dir($g["www_path"].'/themes/'.$config['theme'])))
+ $theme = $config['theme'];
+ else
+ $theme = "pfsense";
+ /*
+ * If this device is an apple ipod/iphone
+ * switch the theme to one that works with it.
+ */
+ $lowres_ua = array("iPhone", "iPod", "iPad", "Android", "BlackBerry", "Opera Mini", "Opera Mobi", "PlayBook");
+ foreach($lowres_ua as $useragent)
+ if(strstr($_SERVER['HTTP_USER_AGENT'], $useragent))
+ $theme = (empty($g['theme_lowres']) && (is_dir($g["www_path"].'/themes/'.$g['theme_lowres']))) ? "pfsense" : $g['theme_lowres'];
+ return $theme;
+}
?>
OpenPOWER on IntegriCloud