aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-03-22 19:16:35 +0100
committerArthurHoaro <arthur@hoa.ro>2017-04-03 19:24:55 +0200
commitae3aa96898834ce3992790e1622541ce48fd78d3 (patch)
treeeaedb30e45748b11a3b5bcf0224ee797c2f341bb /index.php
parentc84379478621303b186f50d647e90079727b6062 (diff)
downloadShaarli-ae3aa96898834ce3992790e1622541ce48fd78d3.tar.gz
Shaarli-ae3aa96898834ce3992790e1622541ce48fd78d3.tar.zst
Shaarli-ae3aa96898834ce3992790e1622541ce48fd78d3.zip
Change timezone data structure send to the templates
The goal of this is to be able to adapt the timezone form in template without hacking the HTML already rendered. * there are two arrays available: * `continents` which contains only a list of available continents * `cities` which contains a list of available timezone cities, associated with their continent Note: there are two distinct array because RainTPL doesn't support nested loop very well.
Diffstat (limited to 'index.php')
-rw-r--r--index.php21
1 files changed, 9 insertions, 12 deletions
diff --git a/index.php b/index.php
index cf85197a..5497a23e 100644
--- a/index.php
+++ b/index.php
@@ -1166,9 +1166,12 @@ function renderPage($conf, $pluginManager, $LINKSDB)
1166 $PAGE->assign('theme', $conf->get('resource.theme')); 1166 $PAGE->assign('theme', $conf->get('resource.theme'));
1167 $PAGE->assign('theme_available', ThemeUtils::getThemes($conf->get('resource.raintpl_tpl'))); 1167 $PAGE->assign('theme_available', ThemeUtils::getThemes($conf->get('resource.raintpl_tpl')));
1168 $PAGE->assign('redirector', $conf->get('redirector.url')); 1168 $PAGE->assign('redirector', $conf->get('redirector.url'));
1169 list($timezone_form, $timezone_js) = generateTimeZoneForm($conf->get('general.timezone')); 1169 list($continents, $cities) = generateTimeZoneData(
1170 $PAGE->assign('timezone_form', $timezone_form); 1170 timezone_identifiers_list(),
1171 $PAGE->assign('timezone_js',$timezone_js); 1171 $conf->get('general.timezone')
1172 );
1173 $PAGE->assign('continents', $continents);
1174 $PAGE->assign('cities', $cities);
1172 $PAGE->assign('private_links_default', $conf->get('privacy.default_private_links', false)); 1175 $PAGE->assign('private_links_default', $conf->get('privacy.default_private_links', false));
1173 $PAGE->assign('session_protection_disabled', $conf->get('security.session_protection_disabled', false)); 1176 $PAGE->assign('session_protection_disabled', $conf->get('security.session_protection_disabled', false));
1174 $PAGE->assign('enable_rss_permalinks', $conf->get('feed.rss_permalinks', false)); 1177 $PAGE->assign('enable_rss_permalinks', $conf->get('feed.rss_permalinks', false));
@@ -1970,16 +1973,10 @@ function install($conf)
1970 exit; 1973 exit;
1971 } 1974 }
1972 1975
1973 // Display config form:
1974 list($timezone_form, $timezone_js) = generateTimeZoneForm();
1975 $timezone_html = '';
1976 if ($timezone_form != '') {
1977 $timezone_html = '<tr><td><b>Timezone:</b></td><td>'.$timezone_form.'</td></tr>';
1978 }
1979
1980 $PAGE = new PageBuilder($conf); 1976 $PAGE = new PageBuilder($conf);
1981 $PAGE->assign('timezone_html',$timezone_html); 1977 list($continents, $cities) = generateTimeZoneData(timezone_identifiers_list(), date_default_timezone_get());
1982 $PAGE->assign('timezone_js',$timezone_js); 1978 $PAGE->assign('continents', $continents);
1979 $PAGE->assign('cities', $cities);
1983 $PAGE->renderPage('install'); 1980 $PAGE->renderPage('install');
1984 exit; 1981 exit;
1985} 1982}