Parcourir la source

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

master
Dom SP il y a 3 ans
Parent
révision
458705563c
2 fichiers modifiés avec 11 ajouts et 6 suppressions
  1. +2
    -1
      app/modules/filesinfolders.php
  2. +9
    -5
      index.php

+ 2
- 1
app/modules/filesinfolders.php Voir le fichier

@@ -464,11 +464,12 @@ class FilesInFolders {
$f3->config($form_config_file);
$fields = $f3->get('fields');
foreach ($fields as $k => $v) {
if ($v['type'] == 'custom') {
$fields[$k]['template'] = sprintf(
"%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']
);
}

+ 9
- 5
index.php Voir le fichier

@@ -21,10 +21,7 @@ $f3 = \Base::instance();
$f3->set('DEBUG', 0);
$f3->set('CACHE', FALSE);
$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'))) {
mkdir($f3->get('TEMP'));
@@ -74,7 +71,12 @@ if(array_key_exists($f3->get('LANG'), $f3->get('content'))) {
$content_dir=$f3->get('content.'.$f3->get('default_lang'));
}
$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="") {
$f3 = \Base::instance();
@@ -216,8 +218,10 @@ if ($f3->get("GET.admin")) {

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

$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'))
)
));



Chargement…
Annuler
Enregistrer