aboutsummaryrefslogtreecommitdiffstats
path: root/mod/admin.php
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2012-04-13 11:20:05 +0200
committerFabio Comuni <fabrix.xm@gmail.com>2012-04-13 11:20:05 +0200
commit138a0e06b88b0c9163ea0bffff8e3521e6c7ee22 (patch)
tree112248e7cab7dfc9616db24e672d0e593c102e8b /mod/admin.php
parent8be7b5c65b8e43b7128bcd565cd50a710fc66b55 (diff)
downloadvolse-hubzilla-138a0e06b88b0c9163ea0bffff8e3521e6c7ee22.tar.gz
volse-hubzilla-138a0e06b88b0c9163ea0bffff8e3521e6c7ee22.tar.bz2
volse-hubzilla-138a0e06b88b0c9163ea0bffff8e3521e6c7ee22.zip
admin: change global theme settings
Diffstat (limited to 'mod/admin.php')
-rw-r--r--mod/admin.php46
1 files changed, 37 insertions, 9 deletions
diff --git a/mod/admin.php b/mod/admin.php
index 961002786..7386dc5a3 100644
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -40,6 +40,20 @@ function admin_post(&$a){
goaway($a->get_baseurl(true) . '/admin/plugins/' . $a->argv[2] );
return; // NOTREACHED
break;
+ case 'themes':
+ $theme = $a->argv[2];
+ if (is_file("view/theme/$theme/config.php")){
+ require_once("view/theme/$theme/config.php");
+ if (function_exists("theme_admin_post")){
+ theme_admin_post($a);
+ }
+ }
+ info(t('Theme settings updated.'));
+ if(is_ajax()) return;
+
+ goaway($a->get_baseurl(true) . '/admin/themes/' . $theme );
+ return;
+ break;
case 'logs':
admin_page_logs_post($a);
break;
@@ -129,7 +143,13 @@ function admin_content(&$a) {
} else {
$o = admin_page_summary($a);
}
- return $o;
+
+ if(is_ajax()) {
+ echo $o;
+ killme();
+ } else {
+ return $o;
+ }
}
@@ -362,7 +382,7 @@ function admin_page_site(&$a) {
'$sitename' => array('sitename', t("Site name"), htmlentities($a->config['sitename'], ENT_QUOTES), ""),
'$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"), $theme_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),
'$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.")),
@@ -768,14 +788,22 @@ function admin_page_themes(&$a){
}
$readme=Null;
- if (is_file("view/$theme/README.md")){
- $readme = file_get_contents("view/$theme/README.md");
+ if (is_file("view/theme/$theme/README.md")){
+ $readme = file_get_contents("view/theme/$theme/README.md");
$readme = Markdown($readme);
- } else if (is_file("view/$theme/README")){
- $readme = "<pre>". file_get_contents("view/$theme/README") ."</pre>";
+ } else if (is_file("view/theme/$theme/README")){
+ $readme = "<pre>". file_get_contents("view/theme/$theme/README") ."</pre>";
}
$admin_form="";
+ if (is_file("view/theme/$theme/config.php")){
+ require_once("view/theme/$theme/config.php");
+ if(function_exists("theme_admin")){
+ $admin_form = theme_admin($a);
+ }
+
+ }
+
$screenshot = array( get_theme_screenshot($theme), t('Screenshot'));
if(! stristr($screenshot[0],$theme))
@@ -793,10 +821,10 @@ function admin_page_themes(&$a){
'$status' => $status,
'$action' => $action,
'$info' => get_theme_info($theme),
- '$function' => 'themes',
+ '$function' => 'themes',
'$admin_form' => $admin_form,
'$str_author' => t('Author: '),
- '$str_maintainer' => t('Maintainer: '),
+ '$str_maintainer' => t('Maintainer: '),
'$screenshot' => $screenshot,
'$readme' => $readme
));
@@ -805,7 +833,7 @@ function admin_page_themes(&$a){
/**
- * List plugins
+ * List themes
*/
$xthemes = array();