Browse Source

fix: content directory names other than 'content' caused issues

master
Dom SP 3 years ago
parent
commit
458705563c
2 changed files with 11 additions and 6 deletions
  1. +2
    -1
      app/modules/filesinfolders.php
  2. +9
    -5
      index.php

+ 2
- 1
app/modules/filesinfolders.php View File

$f3->config($form_config_file); $f3->config($form_config_file);
$fields = $f3->get('fields'); $fields = $f3->get('fields');
foreach ($fields as $k => $v) { foreach ($fields as $k => $v) {
if ($v['type'] == 'custom') { if ($v['type'] == 'custom') {
$fields[$k]['template'] = sprintf( $fields[$k]['template'] = sprintf(
"%s%s", "%s%s",
substr($this->folder,8), //assumens content folder is content
substr($this->folder,strlen($f3->get('CONTENT_BASE'))), //assumens content folder is content
$v['template'] $v['template']
); );
} }

+ 9
- 5
index.php View File

$f3->set('DEBUG', 0); $f3->set('DEBUG', 0);
$f3->set('CACHE', FALSE); $f3->set('CACHE', FALSE);
$f3->set('AUTOLOAD', ROOT.'app/'); $f3->set('AUTOLOAD', ROOT.'app/');
$f3->set('UI', implode(';', array(
ROOT.'app/views/',
ROOT.'content/' // content folders can contain .html templates
)));



if (!is_dir($f3->get('TEMP'))) { if (!is_dir($f3->get('TEMP'))) {
mkdir($f3->get('TEMP')); mkdir($f3->get('TEMP'));
$content_dir=$f3->get('content.'.$f3->get('default_lang')); $content_dir=$f3->get('content.'.$f3->get('default_lang'));
} }
$f3->set('CONTENT', $content_dir); $f3->set('CONTENT', $content_dir);
$f3->set('CONTENT_BASE', array_shift(explode("/",$f3->get('CONTENT'))).'/');


$f3->set('UI', implode(';', array(
ROOT.'app/views/',
ROOT.$f3->get('CONTENT_BASE') // content folders can contain .html templates
)));


function menu_recursion($m,$root="") { function menu_recursion($m,$root="") {
$f3 = \Base::instance(); $f3 = \Base::instance();


// HTML preloading of images // HTML preloading of images
// this could also find some better place // this could also find some better place

$f3->mset(array( $f3->mset(array(
'cached_images' => array(\Controller\Page::check_folder_for_backgroundimage('content/'))
'cached_images' => array(\Controller\Page::check_folder_for_backgroundimage($f3->get('CONTENT_BASE'))
)
)); ));





Loading…
Cancel
Save