diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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 | } |