PHP-Code:
/**
* Books Extension for Contao / Anpassung DSB-Bibliothek
*
*/
// Ändern der Feld-Konfiguration
$GLOBALS['TL_DCA']['tl_book']['palettes']['default'] = str_replace
(
',language',
',language,owner,subject_field,number,position,remarks;{image_legend:hide},image',
$GLOBALS['TL_DCA']['tl_book']['palettes']['default']
);
// Hinzufügen der Feld-Konfiguration
$GLOBALS['TL_DCA']['tl_book']['fields']['owner'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_book']['owner'],
'exclude' => true,
'filter' => true,
'inputType' => 'text',
'eval' => array
(
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50'
),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_book']['fields']['subject_field'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_book']['subject_field'],
'exclude' => true,
'filter' => true,
'inputType' => 'text',
'eval' => array
(
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50'
),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_book']['fields']['number'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_book']['number'],
'exclude' => true,
'inputType' => 'text',
'eval' => array
(
'mandatory' => false,
'maxlength' => 5,
'tl_class' => 'w50'
),
'sql' => "varchar(5) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_book']['fields']['position'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_book']['position'],
'exclude' => true,
'filter' => true,
'inputType' => 'text',
'eval' => array
(
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50'
),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_book']['fields']['remarks'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_book']['remarks'],
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array
(
'mandatory' => false,
'maxlength' => 512,
'tl_class' => 'long'
),
'sql' => "varchar(512) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_book']['fields']['image'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_book']['image'],
'exclude' => true,
'inputType' => 'fileTree',
'eval' => array
(
'files' => true,
'fieldType' => 'radio',
'filesOnly' => true,
'extensions' => 'jpg,jpeg,png,gif'
),
'sql' => "binary(16) NULL"
);
unset($GLOBALS['BE_MOD']['content']['books']);
/**
* Backend-Bereich DSB anlegen, wenn noch nicht vorhanden
*/
if(!$GLOBALS['BE_MOD']['dsb'])
{
$dsb = array(
'dsb' => array()
);
array_insert($GLOBALS['BE_MOD'], 0, $dsb);
}
// Books verschieben
$GLOBALS['BE_MOD']['dsb']['books'] = array
(
'tables' => array('tl_book', 'tl_chapter', 'tl_content'),
'icon' => 'system/modules/books/assets/book.png'
);
Ich brauchte Felder für Sachgebiet, Bemerkungen, Eigentümer, Anzahl (Duplikate) und Standort. Dann noch ein Bild-Feld für das Cover. Ganz unten habe ich books aus dem Menü content rausgeworfen und in meinen eigenen Bereich verschoben.
Lesezeichen