aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-05-25 13:26:05 +0200
committerArthurHoaro <arthur@hoa.ro>2017-10-22 13:16:53 +0200
commitf39580c6fd171b849cec5832b4912182696341f2 (patch)
treec184380d829e2f9b22b2375f4bdc8d085cd6a9be /index.php
parentd6379763290230242caac5fe1e7c589a29fa6bf0 (diff)
downloadShaarli-f39580c6fd171b849cec5832b4912182696341f2.tar.gz
Shaarli-f39580c6fd171b849cec5832b4912182696341f2.tar.zst
Shaarli-f39580c6fd171b849cec5832b4912182696341f2.zip
Add language selection in the configure page of the default theme
Diffstat (limited to 'index.php')
-rw-r--r--index.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/index.php b/index.php
index 98171d78..1dc81843 100644
--- a/index.php
+++ b/index.php
@@ -1170,6 +1170,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
1170 $conf->set('privacy.hide_public_links', !empty($_POST['hidePublicLinks'])); 1170 $conf->set('privacy.hide_public_links', !empty($_POST['hidePublicLinks']));
1171 $conf->set('api.enabled', !empty($_POST['enableApi'])); 1171 $conf->set('api.enabled', !empty($_POST['enableApi']));
1172 $conf->set('api.secret', escape($_POST['apiSecret'])); 1172 $conf->set('api.secret', escape($_POST['apiSecret']));
1173 $conf->set('translation.language', escape($_POST['language']));
1174
1173 try { 1175 try {
1174 $conf->write(isLoggedIn()); 1176 $conf->write(isLoggedIn());
1175 $history->updateSettings(); 1177 $history->updateSettings();
@@ -1207,6 +1209,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
1207 $PAGE->assign('hide_public_links', $conf->get('privacy.hide_public_links', false)); 1209 $PAGE->assign('hide_public_links', $conf->get('privacy.hide_public_links', false));
1208 $PAGE->assign('api_enabled', $conf->get('api.enabled', true)); 1210 $PAGE->assign('api_enabled', $conf->get('api.enabled', true));
1209 $PAGE->assign('api_secret', $conf->get('api.secret')); 1211 $PAGE->assign('api_secret', $conf->get('api.secret'));
1212 $PAGE->assign('languages', Languages::getAvailableLanguages());
1213 $PAGE->assign('language', $conf->get('translation.language'));
1210 $PAGE->renderPage('configure'); 1214 $PAGE->renderPage('configure');
1211 exit; 1215 exit;
1212 } 1216 }
@@ -1232,9 +1236,10 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
1232 } 1236 }
1233 $delete = empty($_POST['totag']); 1237 $delete = empty($_POST['totag']);
1234 $redirect = $delete ? 'do=changetag' : 'searchtags='. urlencode(escape($_POST['totag'])); 1238 $redirect = $delete ? 'do=changetag' : 'searchtags='. urlencode(escape($_POST['totag']));
1239 $count = count($alteredLinks);
1235 $alert = $delete 1240 $alert = $delete
1236 ? sprintf(t('The tag was removed from %d links.'), count($alteredLinks)) 1241 ? sprintf(t('The tag was removed from %d link.', 'The tag was removed from %d links.', $count), $count)
1237 : sprintf(t('The tag was renamed in %d links.'), count($alteredLinks)); 1242 : sprintf(t('The tag was renamed in %d link.', 'The tag was renamed in %d links.', $count), $count);
1238 echo '<script>alert("'. $alert .'");document.location=\'?'. $redirect .'\';</script>'; 1243 echo '<script>alert("'. $alert .'");document.location=\'?'. $redirect .'\';</script>';
1239 exit; 1244 exit;
1240 } 1245 }
@@ -1450,7 +1455,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
1450 1455
1451 if ($url == '') { 1456 if ($url == '') {
1452 $url = '?' . smallHash($linkdate . $LINKSDB->getNextId()); 1457 $url = '?' . smallHash($linkdate . $LINKSDB->getNextId());
1453 $title = $conf->get('general.default_note_title', 'Note: '); 1458 $title = $conf->get('general.default_note_title', t('Note: '));
1454 } 1459 }
1455 $url = escape($url); 1460 $url = escape($url);
1456 $title = escape($title); 1461 $title = escape($title);
@@ -2018,6 +2023,7 @@ function install($conf)
2018 } else { 2023 } else {
2019 $conf->set('general.title', 'Shared links on '.escape(index_url($_SERVER))); 2024 $conf->set('general.title', 'Shared links on '.escape(index_url($_SERVER)));
2020 } 2025 }
2026 $conf->set('translation.language', escape($_POST['language']));
2021 $conf->set('updates.check_updates', !empty($_POST['updateCheck'])); 2027 $conf->set('updates.check_updates', !empty($_POST['updateCheck']));
2022 $conf->set('api.enabled', !empty($_POST['enableApi'])); 2028 $conf->set('api.enabled', !empty($_POST['enableApi']));
2023 $conf->set( 2029 $conf->set(
@@ -2049,6 +2055,7 @@ function install($conf)
2049 list($continents, $cities) = generateTimeZoneData(timezone_identifiers_list(), date_default_timezone_get()); 2055 list($continents, $cities) = generateTimeZoneData(timezone_identifiers_list(), date_default_timezone_get());
2050 $PAGE->assign('continents', $continents); 2056 $PAGE->assign('continents', $continents);
2051 $PAGE->assign('cities', $cities); 2057 $PAGE->assign('cities', $cities);
2058 $PAGE->assign('languages', Languages::getAvailableLanguages());
2052 $PAGE->renderPage('install'); 2059 $PAGE->renderPage('install');
2053 exit; 2060 exit;
2054} 2061}