From acfce1718e5a154865bfa4d7f7ed8b25be6a535f Mon Sep 17 00:00:00 2001 From: filesite Date: Sun, 10 Apr 2022 07:30:46 +0800 Subject: [PATCH] use the config of content directory --- conf/app.php | 2 +- themes/manual/controller/SiteController.php | 4 ++-- themes/manual/controller/ViewController.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/conf/app.php b/conf/app.php index fe1d1da..99788ef 100644 --- a/conf/app.php +++ b/conf/app.php @@ -5,7 +5,7 @@ return array( 'default_timezone' => 'Asia/HonKong', //timezone - 'content_directory' => 'content', //directory of contents + 'content_directory' => 'content/', //directory of contents in /www/ 'theme' => 'manual', //name of theme which is enabled //when it's empty, use layout and views in directory views/ 'default_layout' => 'main', //default layout diff --git a/themes/manual/controller/SiteController.php b/themes/manual/controller/SiteController.php index 7d61e48..fa524e2 100644 --- a/themes/manual/controller/SiteController.php +++ b/themes/manual/controller/SiteController.php @@ -14,8 +14,8 @@ Class SiteController extends Controller { $html = ''; $scanner = new DirScanner(); - $scanner->setWebRoot('/content/'); - $dirTree = $scanner->scan(__DIR__ . '/../../../www/content/', 4); + $scanner->setWebRoot(FSC::$app['config']['content_directory']); + $dirTree = $scanner->scan(__DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'], 4); $readmeFile = $scanner->getDefaultReadme(); if (!empty($readmeFile)) { diff --git a/themes/manual/controller/ViewController.php b/themes/manual/controller/ViewController.php index c20da50..9b20ea5 100644 --- a/themes/manual/controller/ViewController.php +++ b/themes/manual/controller/ViewController.php @@ -20,8 +20,8 @@ Class ViewController extends Controller { $html = ''; $scanner = new DirScanner(); - $scanner->setWebRoot('/content/'); - $dirTree = $scanner->scan(__DIR__ . '/../../../www/content/', 4); + $scanner->setWebRoot(FSC::$app['config']['content_directory']); + $dirTree = $scanner->scan(__DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'], 4); $scanResults = $scanner->getScanResults(); if (!empty($scanResults[$fileId])) {