Ich möchte gerade den Filebrowser (http://www.neele.name/filebrowser/) als Contao-Extension zur Verfügung stellen. Es gibt jedoch noch ein merkwürdiges Problem.
Ich habe eine Filebrowser.php Datei unter system/modules/filebrowser:
PHP-Code:
class Filebrowser extends Frontend
{
/**
* Username
* @var string
*/
public $strUploadPath = '';
/**
* Username
* @var string
*/
public $strViewLayout = '';
/**
* Initialize the object
*/
public function __construct()
{
$this->import('FrontendUser', 'Member');
$this->strUploadPath = ($GLOBALS['TL_CONFIG']['fb_path'] ? $GLOBALS['TL_CONFIG']['fb_path'] . '/' : '/') . (($GLOBALS['TL_CONFIG']['fb_memberDir'] && FE_USER_LOGGED_IN) ? $this->Member->username : '');
$this->strViewLayout = $GLOBALS['TL_CONFIG']['fb_viewLayout'] ? $GLOBALS['TL_CONFIG']['fb_viewLayout'] : 'details';
parent::__construct();
}
}
und eine config.php unter plugins/tinyMCE/plugins/filebrowser/:
PHP-Code:
session_start();
/*
* Initialize contao system
*/
define('TL_MODE', 'FE');
require('../../../../system/initialize.php');
$objFilebrowser = new Filebrowser();
/*
* UPLOAD PATH
*
* absolute path from root to upload folder (DON'T FORGET SLASHES)
*
* Example
* ---------------------------------------
* http://www.domain.com/images/upload/
* $uploadpath = '/images/upload/';
*
*/
$uploadpath = $objFilebrowser->strUploadPath;
/*
* VIEW LAYOUT
*
* Set the default view layout when the file browser is first loaded
*
* Your options are: 'large_images', 'small_images', 'list', 'content', 'tiles' and 'details'
*
*/
$viewlayout = $objFilebrowser->strViewLayout;
/*
* DEFAULT LANGUAGE
*
* Set default language to load when &language=? is not included in url
*
* See lang directory for included languages. For now your options are 'en' and 'nl'
* But you are free to translate the language files in the /lang/ directory. Copy the
* en.php file and translate the lines after the =>
*
*/
$defaultlanguage = $GLOBALS['TL_LANGUAGE'];
...
Es funktioniert eigentlich auch alles, nur gibt $objFilebrowser->strUploadPath den Username ($this->Member->username) nicht aus bzw. der Username sollte ja in diesem String drinn sein, ist er aber nicht. Erstelle ich ein Objekt in einem Modul und gebe $objFilebrowser->strUploadPath aus, funktioniert $this->Member->username.
Hat jemand eine Idee warum $this->Member in der config.php unter plugins/tinyMCE/plugins/filebrowser nicht funktioniert? Das sollte doch eigentlich. In der config.php gibt es keine Klasse, es wird nur die initialize.php includiert.
Ich danke für die Hilfe!
Lesezeichen