Hi,
ich würde gerne ein Attribute mit dem FileTree erstellen.
Der FileTree wird angezeigt aber ich kan nichts auswählen.
Feld in der Datenbank wird auch schon ausgewählt.
Aber ich weiss grade nicht wie da nen "eval" reinbekomme =(
PHP-Code:
<?php if(!defined('TL_ROOT')) die('You can not access this file directly!');
class IsotopeDWGalleryAttribute extends Controller {
protected function __construct() {
parent::__construct();
$this->import('Database');
}
protected $arrPriceFields;
public function generateAttribute($attribute, $varValue, $strBuffer, $objProduct) {
return sprintf($GLOBALS['TL_LANG']['MSC']['priceRangeLabel'], $strBuffer);
}
public function setupDca($strDcaName) {
switch($strDcaName) {
case 'tl_iso_attributes':
$arrDca = &$GLOBALS['TL_DCA']['tl_iso_attributes'];
$arrDca['palettes']['dwgallery'] = '{attribute_legend}, name,field_name,type,legend,is_customer_defined;{description_legend:hide},description;{config_legend},mandatory;{search_filters_legend},is_order_by_enabled,is_be_searchable';
$arrDca['fields']['type']['options'][] = 'dwgallery';
// dont break
case 'tl_iso_products':
$GLOBALS['ISO_ATTR']['dwgallery'] = array(
'frontend' => 'text',
'backend' => 'fileTree',
'eval' => array('fieldType'=>'checkbox', 'files'=>true, 'mandatory'=>true),
'sql' => 'blob null'
);
break;
}
}
private static $objInstance;
public static function getInstance() {
if(!self::$objInstance)
self::$objInstance = new IsotopeDWGalleryAttribute();
return self::$objInstance;
}
}
Hat jemand eine Idee?
Edit basis ist die Erweiterung von BackboneIT
Lesezeichen