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])) {