Browse Source

use the config of content directory

master
filesite 3 years ago
parent
commit
acfce1718e
  1. 2
      conf/app.php
  2. 4
      themes/manual/controller/SiteController.php
  3. 4
      themes/manual/controller/ViewController.php

2
conf/app.php

@ -5,7 +5,7 @@
return array( return array(
'default_timezone' => 'Asia/HonKong', //timezone '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 'theme' => 'manual', //name of theme which is enabled
//when it's empty, use layout and views in directory views/ //when it's empty, use layout and views in directory views/
'default_layout' => 'main', //default layout 'default_layout' => 'main', //default layout

4
themes/manual/controller/SiteController.php

@ -14,8 +14,8 @@ Class SiteController extends Controller {
$html = ''; $html = '';
$scanner = new DirScanner(); $scanner = new DirScanner();
$scanner->setWebRoot('/content/'); $scanner->setWebRoot(FSC::$app['config']['content_directory']);
$dirTree = $scanner->scan(__DIR__ . '/../../../www/content/', 4); $dirTree = $scanner->scan(__DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'], 4);
$readmeFile = $scanner->getDefaultReadme(); $readmeFile = $scanner->getDefaultReadme();
if (!empty($readmeFile)) { if (!empty($readmeFile)) {

4
themes/manual/controller/ViewController.php

@ -20,8 +20,8 @@ Class ViewController extends Controller {
$html = ''; $html = '';
$scanner = new DirScanner(); $scanner = new DirScanner();
$scanner->setWebRoot('/content/'); $scanner->setWebRoot(FSC::$app['config']['content_directory']);
$dirTree = $scanner->scan(__DIR__ . '/../../../www/content/', 4); $dirTree = $scanner->scan(__DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'], 4);
$scanResults = $scanner->getScanResults(); $scanResults = $scanner->getScanResults();
if (!empty($scanResults[$fileId])) { if (!empty($scanResults[$fileId])) {

Loading…
Cancel
Save