aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorKnah Tsaeb <Knah-Tsaeb@knah-tsaeb.org>2016-12-07 11:58:25 +0100
committerArthurHoaro <arthur@hoa.ro>2017-01-05 12:04:02 +0100
commitadc4aee80f7cd3242f65f0b316af2b560a64712c (patch)
treeaf62f8bfb21232bc36dd6d12eb5bc2fc35c21146 /index.php
parentfc11ab2f290a3712b766d78fdbcd354625a35d0a (diff)
downloadShaarli-adc4aee80f7cd3242f65f0b316af2b560a64712c.tar.gz
Shaarli-adc4aee80f7cd3242f65f0b316af2b560a64712c.tar.zst
Shaarli-adc4aee80f7cd3242f65f0b316af2b560a64712c.zip
Change templates set through administration UI
Diffstat (limited to 'index.php')
-rw-r--r--index.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/index.php b/index.php
index 2ed14d4f..62d719e1 100644
--- a/index.php
+++ b/index.php
@@ -122,7 +122,8 @@ if (isset($_COOKIE['shaarli']) && !is_session_id_valid($_COOKIE['shaarli'])) {
122$conf = new ConfigManager(); 122$conf = new ConfigManager();
123$conf->setEmpty('general.timezone', date_default_timezone_get()); 123$conf->setEmpty('general.timezone', date_default_timezone_get());
124$conf->setEmpty('general.title', 'Shared links on '. escape(index_url($_SERVER))); 124$conf->setEmpty('general.title', 'Shared links on '. escape(index_url($_SERVER)));
125RainTPL::$tpl_dir = $conf->get('resource.raintpl_tpl'); // template directory 125$conf->setEmpty('resource.theme', 'default');
126RainTPL::$tpl_dir = $conf->get('resource.raintpl_tpl').'/'.$conf->get('resource.theme').'/'; // template directory
126RainTPL::$cache_dir = $conf->get('resource.raintpl_tmp'); // cache directory 127RainTPL::$cache_dir = $conf->get('resource.raintpl_tmp'); // cache directory
127 128
128$pluginManager = new PluginManager($conf); 129$pluginManager = new PluginManager($conf);
@@ -1124,6 +1125,7 @@ function renderPage($conf, $pluginManager, $LINKSDB)
1124 $conf->set('general.timezone', $tz); 1125 $conf->set('general.timezone', $tz);
1125 $conf->set('general.title', escape($_POST['title'])); 1126 $conf->set('general.title', escape($_POST['title']));
1126 $conf->set('general.header_link', escape($_POST['titleLink'])); 1127 $conf->set('general.header_link', escape($_POST['titleLink']));
1128 $conf->set('resource.theme', escape($_POST['theme']));
1127 $conf->set('redirector.url', escape($_POST['redirector'])); 1129 $conf->set('redirector.url', escape($_POST['redirector']));
1128 $conf->set('security.session_protection_disabled', !empty($_POST['disablesessionprotection'])); 1130 $conf->set('security.session_protection_disabled', !empty($_POST['disablesessionprotection']));
1129 $conf->set('privacy.default_private_links', !empty($_POST['privateLinkByDefault'])); 1131 $conf->set('privacy.default_private_links', !empty($_POST['privateLinkByDefault']));
@@ -1134,6 +1136,7 @@ function renderPage($conf, $pluginManager, $LINKSDB)
1134 $conf->set('api.secret', escape($_POST['apiSecret'])); 1136 $conf->set('api.secret', escape($_POST['apiSecret']));
1135 try { 1137 try {
1136 $conf->write(isLoggedIn()); 1138 $conf->write(isLoggedIn());
1139 invalidateCaches($conf->get('resource.page_cache'));
1137 } 1140 }
1138 catch(Exception $e) { 1141 catch(Exception $e) {
1139 error_log( 1142 error_log(
@@ -1151,6 +1154,8 @@ function renderPage($conf, $pluginManager, $LINKSDB)
1151 else // Show the configuration form. 1154 else // Show the configuration form.
1152 { 1155 {
1153 $PAGE->assign('title', $conf->get('general.title')); 1156 $PAGE->assign('title', $conf->get('general.title'));
1157 $PAGE->assign('theme', $conf->get('resource.theme'));
1158 $PAGE->assign('theme_available', getAllTheme($conf->get('resource.raintpl_tpl')));
1154 $PAGE->assign('redirector', $conf->get('redirector.url')); 1159 $PAGE->assign('redirector', $conf->get('redirector.url'));
1155 list($timezone_form, $timezone_js) = generateTimeZoneForm($conf->get('general.timezone')); 1160 list($timezone_form, $timezone_js) = generateTimeZoneForm($conf->get('general.timezone'));
1156 $PAGE->assign('timezone_form', $timezone_form); 1161 $PAGE->assign('timezone_form', $timezone_form);