diff options
author | friendica <info@friendica.com> | 2013-03-18 15:21:45 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-03-18 15:21:45 -0700 |
commit | 11534ae91e535012f84a53a4026f5288d3a3e79f (patch) | |
tree | eeffa08305234fdd4577600bb2f713ac0780e540 | |
parent | 104b41164f609765df15aa5595d07dd0b775ed95 (diff) | |
parent | 9c4b3b03db6d25b6266d7a072511993eb8195fec (diff) | |
download | volse-hubzilla-11534ae91e535012f84a53a4026f5288d3a3e79f.tar.gz volse-hubzilla-11534ae91e535012f84a53a4026f5288d3a3e79f.tar.bz2 volse-hubzilla-11534ae91e535012f84a53a4026f5288d3a3e79f.zip |
Merge pull request #36 from beardy-unixer/master
Admin panel mobility/accessibility theme options
-rw-r--r-- | mod/admin.php | 24 | ||||
-rw-r--r-- | view/tpl/admin_site.tpl | 2 | ||||
-rw-r--r-- | view/tpl/smarty3/admin_site.tpl | 2 |
3 files changed, 28 insertions, 0 deletions
diff --git a/mod/admin.php b/mod/admin.php index be8575e4e..bda4b0794 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -210,6 +210,8 @@ function admin_page_site_post(&$a){ $banner = ((x($_POST,'banner')) ? trim($_POST['banner']) : false); $language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : ''); $theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : ''); + $theme_mobile = ((x($_POST,'theme-mobile')) ? notags(trim($_POST['theme-mobile'])) : ''); + $theme_accessibility = ((x($_POST,'theme-accessibility')) ? notags(trim($_POST['theme-accessibility'])) : ''); $maximagesize = ((x($_POST,'maximagesize')) ? intval(trim($_POST['maximagesize'])) : 0); @@ -289,6 +291,16 @@ function admin_page_site_post(&$a){ set_config('system','language', $language); set_config('system','theme', $theme); + if ( $theme_mobile === '---' ) { + del_config('system','mobile-theme'); + } else { + set_config('system','mobile-theme', $theme_mobile); + } + if ( $theme_accessibility === '---' ) { + del_config('system','accessibility-theme'); + } else { + set_config('system','accessibility-theme', $theme_accessibility); + } set_config('system','maximagesize', $maximagesize); set_config('system','register_policy', $register_policy); @@ -340,11 +352,21 @@ function admin_page_site(&$a) { /* Installed themes */ $theme_choices = array(); + $theme_choices_mobile = array(); + $theme_choices_mobile["---"] = t("No special theme for mobile devices"); + $theme_choices_accessibility = array(); + $theme_choices_accessibility["---"] =t("No special theme for accessibility"); $files = glob('view/theme/*'); if($files) { foreach($files as $file) { $f = basename($file); $theme_name = ((file_exists($file . '/.experimental')) ? sprintf("%s - Experimental", $f) : $f); + if (file_exists($file . '/.mobile')) { + $theme_choices_mobile[$f] = $theme_name; + } + if (file_exists($file . '/.accessibility')) { + $theme_choices_accessibility[$f] = $theme_name; + } $theme_choices[$f] = $theme_name; } } @@ -384,6 +406,8 @@ function admin_page_site(&$a) { '$banner' => array('banner', t("Banner/Logo"), $banner, ""), '$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices), '$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices), + '$theme_mobile' => array('theme-mobile', t("Mobile system theme"), get_config('system','mobile-theme'), t("Theme for mobile devices"), $theme_choices_mobile), + '$theme_accessibility' => array('theme-accessibility', t("Accessibility system theme"), get_config('system','accessibility-theme'), t("Accessibility theme"), $theme_choices_accessibility), '$ssl_policy' => array('ssl_policy', t("SSL link policy"), (string) intval(get_config('system','ssl_policy')), t("Determines whether generated links should be forced to use SSL"), $ssl_choices), '$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), '$register_policy' => array('register_policy', t("Register policy"), $a->config['system']['register_policy'], "", $register_choices), diff --git a/view/tpl/admin_site.tpl b/view/tpl/admin_site.tpl index e09996aee..47e952164 100644 --- a/view/tpl/admin_site.tpl +++ b/view/tpl/admin_site.tpl @@ -44,6 +44,8 @@ {{ inc field_textarea.tpl with $field=$banner }}{{ endinc }} {{ inc field_select.tpl with $field=$language }}{{ endinc }} {{ inc field_select.tpl with $field=$theme }}{{ endinc }} + {{ inc field_select.tpl with $field=$theme_mobile }}{{ endinc }} + {{ inc field_select.tpl with $field=$theme_accessibility }}{{ endinc }} {{ inc field_select.tpl with $field=$ssl_policy }}{{ endinc }} <div class="submit"><input type="submit" name="page_site" value="$submit" /></div> diff --git a/view/tpl/smarty3/admin_site.tpl b/view/tpl/smarty3/admin_site.tpl index 75a386f7d..eaf067c27 100644 --- a/view/tpl/smarty3/admin_site.tpl +++ b/view/tpl/smarty3/admin_site.tpl @@ -49,6 +49,8 @@ {{include file="field_textarea.tpl" field=$banner}} {{include file="field_select.tpl" field=$language}} {{include file="field_select.tpl" field=$theme}} + {{include file="field_select.tpl" field=$theme_mobile}} + {{include file="field_select.tpl" field=$theme_accessibility}} {{include file="field_select.tpl" field=$ssl_policy}} <div class="submit"><input type="submit" name="page_site" value="{{$submit}}" /></div> |