@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Contao Open Source CMS |
|
| 4 | - * |
|
| 5 | - * Copyright (c) Jan Karai |
|
| 6 | - * |
|
| 7 | - * @license LGPL-3.0+ |
|
| 8 | - */ |
|
| 3 | + * Contao Open Source CMS |
|
| 4 | + * |
|
| 5 | + * Copyright (c) Jan Karai |
|
| 6 | + * |
|
| 7 | + * @license LGPL-3.0+ |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * Load tl_content language file |
@@ -156,27 +156,27 @@ discard block |
||
| 156 | 156 | ); |
| 157 | 157 | |
| 158 | 158 | /** |
| 159 | - * Provide miscellaneous methods that are used by the data configuration array. |
|
| 160 | - * |
|
| 161 | - * @author Jan Karai <https://www.sachsen-it.de> |
|
| 162 | - */ |
|
| 159 | + * Provide miscellaneous methods that are used by the data configuration array. |
|
| 160 | + * |
|
| 161 | + * @author Jan Karai <https://www.sachsen-it.de> |
|
| 162 | + */ |
|
| 163 | 163 | class tl_belegungsplan_calender extends Backend |
| 164 | 164 | {
|
| 165 | 165 | /** |
| 166 | - * Import the back end user object |
|
| 167 | - */ |
|
| 166 | + * Import the back end user object |
|
| 167 | + */ |
|
| 168 | 168 | public function __construct() {
|
| 169 | 169 | parent::__construct(); |
| 170 | 170 | $this->import('BackendUser', 'User');
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
| 174 | - * Add the type of input field |
|
| 175 | - * |
|
| 176 | - * @param array $arrRow |
|
| 177 | - * |
|
| 178 | - * @return string |
|
| 179 | - */ |
|
| 174 | + * Add the type of input field |
|
| 175 | + * |
|
| 176 | + * @param array $arrRow |
|
| 177 | + * |
|
| 178 | + * @return string |
|
| 179 | + */ |
|
| 180 | 180 | public function listCalender($arrRow) |
| 181 | 181 | {
|
| 182 | 182 | return '<div class="tl_content_left">' . $arrRow['gast'] . ' <span style="color:#999;padding-left:3px">[' . Date::parse(Config::get('dateFormat'), $arrRow['startDate']) . $GLOBALS['TL_LANG']['MSC']['cal_timeSeparator'] . Date::parse(Config::get('dateFormat'), $arrRow['endDate']) . ']</span></div>';
|
@@ -15,61 +15,49 @@ discard block |
||
| 15 | 15 | /** |
| 16 | 16 | * Table tl_belegungsplan_calender |
| 17 | 17 | */ |
| 18 | -$GLOBALS['TL_DCA']['tl_belegungsplan_calender'] = array |
|
| 19 | -( |
|
| 18 | +$GLOBALS['TL_DCA']['tl_belegungsplan_calender'] = array( |
|
| 20 | 19 | // Config |
| 21 | - 'config' => array |
|
| 22 | - ( |
|
| 20 | + 'config' => array( |
|
| 23 | 21 | 'dataContainer' => 'Table', |
| 24 | 22 | 'ptable' => 'tl_belegungsplan_objekte', |
| 25 | 23 | 'ctable' => array('tl_content'),
|
| 26 | 24 | 'switchToEdit' => true, |
| 27 | 25 | 'enableVersioning' => true, |
| 28 | - 'sql' => array |
|
| 29 | - ( |
|
| 30 | - 'keys' => array |
|
| 31 | - ( |
|
| 26 | + 'sql' => array( |
|
| 27 | + 'keys' => array( |
|
| 32 | 28 | 'id' => 'primary', |
| 33 | 29 | 'pid' => 'index' |
| 34 | 30 | ) |
| 35 | 31 | ) |
| 36 | 32 | ), |
| 37 | 33 | // List |
| 38 | - 'list' => array |
|
| 39 | - ( |
|
| 40 | - 'sorting' => array |
|
| 41 | - ( |
|
| 34 | + 'list' => array( |
|
| 35 | + 'sorting' => array( |
|
| 42 | 36 | 'mode' => 4, |
| 43 | 37 | 'fields' => array('startDate DESC'),
|
| 44 | 38 | 'headerFields' => array('name', 'tstamp'),
|
| 45 | 39 | 'panelLayout' => 'filter;sort,search,limit', |
| 46 | 40 | 'child_record_callback' => array('tl_belegungsplan_calender', 'listCalender')
|
| 47 | 41 | ), |
| 48 | - 'label' => array |
|
| 49 | - ( |
|
| 42 | + 'label' => array( |
|
| 50 | 43 | 'fields' => array('gast', 'startDate', 'endDate'),
|
| 51 | 44 | 'format' => '%s' |
| 52 | 45 | ), |
| 53 | - 'global_operations' => array |
|
| 54 | - ( |
|
| 55 | - 'all' => array |
|
| 56 | - ( |
|
| 46 | + 'global_operations' => array( |
|
| 47 | + 'all' => array( |
|
| 57 | 48 | 'label' => &$GLOBALS['TL_LANG']['MSC']['all'], |
| 58 | 49 | 'href' => 'act=select', |
| 59 | 50 | 'class' => 'header_edit_all', |
| 60 | 51 | 'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"' |
| 61 | 52 | ) |
| 62 | 53 | ), |
| 63 | - 'operations' => array |
|
| 64 | - ( |
|
| 65 | - 'edit' => array |
|
| 66 | - ( |
|
| 54 | + 'operations' => array( |
|
| 55 | + 'edit' => array( |
|
| 67 | 56 | 'label' => &$GLOBALS['TL_LANG']['tl_belegungsplan_calender']['edit'], |
| 68 | 57 | 'href' => 'act=edit', |
| 69 | 58 | 'icon' => 'edit.svg' |
| 70 | 59 | ), |
| 71 | - 'delete' => array |
|
| 72 | - ( |
|
| 60 | + 'delete' => array( |
|
| 73 | 61 | 'label' => &$GLOBALS['TL_LANG']['tl_belegungsplan_calender']['delete'], |
| 74 | 62 | 'href' => 'act=delete', |
| 75 | 63 | 'icon' => 'delete.svg', |
@@ -78,8 +66,7 @@ discard block |
||
| 78 | 66 | ) |
| 79 | 67 | ), |
| 80 | 68 | // Palettes |
| 81 | - 'palettes' => array |
|
| 82 | - ( |
|
| 69 | + 'palettes' => array( |
|
| 83 | 70 | '__selector__' => array(), |
| 84 | 71 | 'default' => '{title_legend},gast,author;{date_legend},startDate,endDate'
|
| 85 | 72 | ), |
@@ -87,24 +74,19 @@ discard block |
||
| 87 | 74 | 'subpalettes' => array( |
| 88 | 75 | ), |
| 89 | 76 | // Fields |
| 90 | - 'fields' => array |
|
| 91 | - ( |
|
| 92 | - 'id' => array |
|
| 93 | - ( |
|
| 77 | + 'fields' => array( |
|
| 78 | + 'id' => array( |
|
| 94 | 79 | 'sql' => "int(10) unsigned NOT NULL auto_increment" |
| 95 | 80 | ), |
| 96 | - 'pid' => array |
|
| 97 | - ( |
|
| 81 | + 'pid' => array( |
|
| 98 | 82 | 'foreignKey' => 'tl_belegungsplan_objekte.name', |
| 99 | 83 | 'sql' => "int(10) unsigned NOT NULL default '0'", |
| 100 | 84 | 'relation' => array('type'=>'belongsTo', 'load'=>'eager')
|
| 101 | 85 | ), |
| 102 | - 'tstamp' => array |
|
| 103 | - ( |
|
| 86 | + 'tstamp' => array( |
|
| 104 | 87 | 'sql' => "int(10) unsigned NOT NULL default '0'" |
| 105 | 88 | ), |
| 106 | - 'gast' => array |
|
| 107 | - ( |
|
| 89 | + 'gast' => array( |
|
| 108 | 90 | 'label' => &$GLOBALS['TL_LANG']['tl_belegungsplan_calender']['gast'], |
| 109 | 91 | 'exclude' => true, |
| 110 | 92 | 'search' => true, |
@@ -113,8 +95,7 @@ discard block |
||
| 113 | 95 | 'eval' => array('mandatory'=>true, 'maxlength'=>255, 'tl_class'=>'long'),
|
| 114 | 96 | 'sql' => "varchar(255) NOT NULL default ''" |
| 115 | 97 | ), |
| 116 | - 'author' => array |
|
| 117 | - ( |
|
| 98 | + 'author' => array( |
|
| 118 | 99 | 'label' => &$GLOBALS['TL_LANG']['tl_belegungsplan_calender']['author'], |
| 119 | 100 | 'default' => BackendUser::getInstance()->id, |
| 120 | 101 | 'exclude' => true, |
@@ -128,8 +109,7 @@ discard block |
||
| 128 | 109 | 'sql' => "int(10) unsigned NOT NULL default '0'", |
| 129 | 110 | 'relation' => array('type'=>'belongsTo', 'load'=>'eager')
|
| 130 | 111 | ), |
| 131 | - 'startDate' => array |
|
| 132 | - ( |
|
| 112 | + 'startDate' => array( |
|
| 133 | 113 | 'label' => &$GLOBALS['TL_LANG']['tl_belegungsplan_calender']['startDate'], |
| 134 | 114 | 'exclude' => true, |
| 135 | 115 | 'search' => true, |
@@ -140,8 +120,7 @@ discard block |
||
| 140 | 120 | 'eval' => array('rgxp'=>'date', 'mandatory'=>true, 'doNotCopy'=>true, 'datepicker'=>true, 'tl_class'=>'w50 wizard'),
|
| 141 | 121 | 'sql' => "int(10) unsigned NULL" |
| 142 | 122 | ), |
| 143 | - 'endDate' => array |
|
| 144 | - ( |
|
| 123 | + 'endDate' => array( |
|
| 145 | 124 | 'label' => &$GLOBALS['TL_LANG']['tl_belegungsplan_calender']['endDate'], |
| 146 | 125 | 'exclude' => true, |
| 147 | 126 | 'search' => true, |