@@ -114,13 +114,13 @@ |
||
| 114 | 114 | /** |
| 115 | 115 | * Administration delete page function |
| 116 | 116 | * |
| 117 | - * called to delete fpage and return to administration Pages section |
|
| 118 | - * |
|
| 119 | - * @param object $request |
|
| 120 | - * @param object $response |
|
| 121 | - * @param array $args |
|
| 122 | - * |
|
| 123 | - * @return object $response |
|
| 117 | + * called to delete fpage and return to administration Pages section |
|
| 118 | + * |
|
| 119 | + * @param object $request |
|
| 120 | + * @param object $response |
|
| 121 | + * @param array $args |
|
| 122 | + * |
|
| 123 | + * @return object $response |
|
| 124 | 124 | */ |
| 125 | 125 | public function adminDelPage(Request $request, Response $response, array $args): Response |
| 126 | 126 | { |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $container->set('themesdir', __DIR__ . '/../public/themes/'); |
| 41 | 41 | |
| 42 | 42 | // Set settings array in container for use in all routes |
| 43 | -$container->set('settings', function () { |
|
| 43 | +$container->set('settings', function() { |
|
| 44 | 44 | $config = file_get_contents(__DIR__ . '/../config/config.json'); |
| 45 | 45 | $settings = json_decode($config, true); |
| 46 | 46 | return $settings; |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | mkdir($container->get('cachedir'), 0755, true); |
| 76 | 76 | } else { |
| 77 | 77 | // Flush Cache folder if disabled |
| 78 | - if ((file_exists($container->get('cachedir'))) && ($settings["devMode"] == true )) { |
|
| 78 | + if ((file_exists($container->get('cachedir'))) && ($settings["devMode"] == true)) { |
|
| 79 | 79 | $path = $container->get('cachedir'); |
| 80 | 80 | |
| 81 | 81 | $files = new RecursiveIteratorIterator( |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | AppFactory::setContainer($container); |
| 100 | 100 | |
| 101 | 101 | // Set Twig engine for templating |
| 102 | -$container->set('view', function () { |
|
| 102 | +$container->set('view', function() { |
|
| 103 | 103 | $settings = json_decode(file_get_contents(__DIR__ . '/../config/config.json'), true); |
| 104 | 104 | $tpls = [ |
| 105 | 105 | __DIR__ . "/../resources/views/", |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | }); |
| 128 | 128 | |
| 129 | 129 | //Set Session engine |
| 130 | -$container->set('session', function () { |
|
| 130 | +$container->set('session', function() { |
|
| 131 | 131 | return new \SlimSession\Helper(); |
| 132 | 132 | }); |
| 133 | 133 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | // Admin routes |
| 180 | 180 | $app->get('/login', HomeController::class . ":login")->setName('login'); |
| 181 | 181 | $app->post('/login', HomeController::class . ":loginPost")->setName('login-post'); |
| 182 | -$app->group('/admin', function (RouteCollectorProxy $group) { |
|
| 182 | +$app->group('/admin', function(RouteCollectorProxy $group) { |
|
| 183 | 183 | $group->get('', AdminController::class . ":adminIndex")->setName('admin'); |
| 184 | 184 | $group->get('/social', AdminController::class . ":adminSocial")->setName('admin-social'); |
| 185 | 185 | $group->get('/wallet', WalletController::class . ":viewWallet")->setName('admin-wallet'); |
@@ -196,12 +196,12 @@ discard block |
||
| 196 | 196 | }); |
| 197 | 197 | |
| 198 | 198 | // generate routes from static pages |
| 199 | -$app->group('/pages/', function (RouteCollectorProxy $group) { |
|
| 199 | +$app->group('/pages/', function(RouteCollectorProxy $group) { |
|
| 200 | 200 | $pagesDir = $this->get('pagesdir'); |
| 201 | 201 | $pages = preg_grep('~\.(html)$~', scandir($pagesDir)); |
| 202 | 202 | foreach ($pages as $page) { |
| 203 | 203 | $route = substr($page, 0, strrpos($page, ".")); |
| 204 | - $group->get('' . $route, function ($request, $response) { |
|
| 204 | + $group->get('' . $route, function($request, $response) { |
|
| 205 | 205 | $settings = $this->get('settings'); |
| 206 | 206 | $uri = $request->getUri(); |
| 207 | 207 | $route = substr(strrchr($uri, "/"), 1); |