]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/front/controller/admin/ConfigureController.php
Process main page (linklist) through Slim controller
[github/shaarli/Shaarli.git] / application / front / controller / admin / ConfigureController.php
index b1d32270fd676c4551c9416ecf28b76acd74e2b2..865fc2b08c212f22b1d516e110dbf55a722a7657 100644 (file)
@@ -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;
@@ -12,14 +13,14 @@ use Slim\Http\Response;
 use Throwable;
 
 /**
- * Class PasswordController
+ * Class ConfigureController
  *
  * Slim controller used to handle Shaarli configuration page (display + save new config).
  */
 class ConfigureController extends ShaarliAdminController
 {
     /**
-     * GET /configure - Displays the configuration page
+     * GET /admin/configure - Displays the configuration page
      */
     public function index(Request $request, Response $response): Response
     {
@@ -52,11 +53,11 @@ 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));
     }
 
     /**
-     * POST /configure - Update Shaarli's configuration
+     * POST /admin/configure - Update Shaarli's configuration
      */
     public function save(Request $request, Response $response): Response
     {
@@ -99,7 +100,7 @@ class ConfigureController extends ShaarliAdminController
         ) {
             $this->saveWarningMessage(t(
                 'You have enabled or changed thumbnails mode. '
-                .'<a href="./?do=thumbs_update">Please synchronize them</a>.'
+                .'<a href="'. $this->container->basePath .'/admin/thumbnails">Please synchronize them</a>.'
             ));
         }
         $this->container->conf->set('thumbnails.mode', $thumbnailsMode);
@@ -115,6 +116,6 @@ class ConfigureController extends ShaarliAdminController
 
         $this->saveSuccessMessage(t('Configuration was saved.'));
 
-        return $response->withRedirect('./configure');
+        return $this->redirect($response, '/admin/configure');
     }
 }