X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Ffront%2Fcontroller%2Fadmin%2FConfigureController.php;h=0ed7ad81086d93b6a0c0d39e3a539dd398a8fb62;hb=8f269b49d7063af5a43021c8775b02d17205a7b5;hp=44971c43f2ba1453dd9f61c78055d592084e0fcd;hpb=9c75f877935fa6adec951a4d8d32b328aaab314f;p=github%2Fshaarli%2FShaarli.git
diff --git a/application/front/controller/admin/ConfigureController.php b/application/front/controller/admin/ConfigureController.php
index 44971c43..0ed7ad81 100644
--- a/application/front/controller/admin/ConfigureController.php
+++ b/application/front/controller/admin/ConfigureController.php
@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Shaarli\Front\Controller\Admin;
use Shaarli\Languages;
+use Shaarli\Render\TemplatePage;
use Shaarli\Render\ThemeUtils;
use Shaarli\Thumbnailer;
use Slim\Http\Request;
@@ -29,7 +30,7 @@ class ConfigureController extends ShaarliAdminController
'theme_available',
ThemeUtils::getThemes($this->container->conf->get('resource.raintpl_tpl'))
);
- $this->assignView('formatter_available', ['default', 'markdown']);
+ $this->assignView('formatter_available', ['default', 'markdown', 'markdownExtra']);
list($continents, $cities) = generateTimeZoneData(
timezone_identifiers_list(),
$this->container->conf->get('general.timezone')
@@ -52,7 +53,7 @@ class ConfigureController extends ShaarliAdminController
$this->assignView('thumbnails_mode', $this->container->conf->get('thumbnails.mode', Thumbnailer::MODE_NONE));
$this->assignView('pagetitle', t('Configure') .' - '. $this->container->conf->get('general.title', 'Shaarli'));
- return $response->write($this->render('configure'));
+ return $response->write($this->render(TemplatePage::CONFIGURE));
}
/**
@@ -97,10 +98,10 @@ class ConfigureController extends ShaarliAdminController
if ($thumbnailsMode !== Thumbnailer::MODE_NONE
&& $thumbnailsMode !== $this->container->conf->get('thumbnails.mode', Thumbnailer::MODE_NONE)
) {
- $this->saveWarningMessage(t(
- 'You have enabled or changed thumbnails mode. '
- .'Please synchronize them.'
- ));
+ $this->saveWarningMessage(
+ t('You have enabled or changed thumbnails mode.') .
+ '' . t('Please synchronize them.') .''
+ );
}
$this->container->conf->set('thumbnails.mode', $thumbnailsMode);
@@ -109,8 +110,13 @@ class ConfigureController extends ShaarliAdminController
$this->container->history->updateSettings();
$this->container->pageCacheManager->invalidateCaches();
} catch (Throwable $e) {
- // TODO: translation + stacktrace
- $this->saveErrorMessage('ERROR while writing config file after configuration update.');
+ $this->assignView('message', t('Error while writing config file after configuration update.'));
+
+ if ($this->container->conf->get('dev.debug', false)) {
+ $this->assignView('stacktrace', $e->getMessage() . PHP_EOL . $e->getTraceAsString());
+ }
+
+ return $response->write($this->render('error'));
}
$this->saveSuccessMessage(t('Configuration was saved.'));