@@ -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 |
@@ -147,26 +147,26 @@ discard block |
||
| 147 | 147 | ); |
| 148 | 148 | |
| 149 | 149 | /** |
| 150 | - * Provide miscellaneous methods that are used by the data configuration array. |
|
| 151 | - * |
|
| 152 | - * @author Jan Karai <https://www.sachsen-it.de> |
|
| 153 | - */ |
|
| 150 | + * Provide miscellaneous methods that are used by the data configuration array. |
|
| 151 | + * |
|
| 152 | + * @author Jan Karai <https://www.sachsen-it.de> |
|
| 153 | + */ |
|
| 154 | 154 | class tl_belegungsplan_feiertage extends Backend |
| 155 | 155 | { |
| 156 | 156 | /** |
| 157 | - * Import the back end user object |
|
| 158 | - */ |
|
| 157 | + * Import the back end user object |
|
| 158 | + */ |
|
| 159 | 159 | public function __construct() { |
| 160 | 160 | parent::__construct(); |
| 161 | 161 | $this->import('BackendUser', 'User'); |
| 162 | 162 | } |
| 163 | 163 | /** |
| 164 | - * Add the type of input field |
|
| 165 | - * |
|
| 166 | - * @param array $arrRow |
|
| 167 | - * |
|
| 168 | - * @return string |
|
| 169 | - */ |
|
| 164 | + * Add the type of input field |
|
| 165 | + * |
|
| 166 | + * @param array $arrRow |
|
| 167 | + * |
|
| 168 | + * @return string |
|
| 169 | + */ |
|
| 170 | 170 | public function listCalender($arrRow) |
| 171 | 171 | { |
| 172 | 172 | return '<div class="tl_content_left">' . $arrRow['title'] . ' <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,58 +15,46 @@ discard block |
||
| 15 | 15 | /** |
| 16 | 16 | * Table tl_belegungsplan_feiertage |
| 17 | 17 | */ |
| 18 | -$GLOBALS['TL_DCA']['tl_belegungsplan_feiertage'] = array |
|
| 19 | -( |
|
| 18 | +$GLOBALS['TL_DCA']['tl_belegungsplan_feiertage'] = array( |
|
| 20 | 19 | // Config |
| 21 | - 'config' => array |
|
| 22 | - ( |
|
| 20 | + 'config' => array( |
|
| 23 | 21 | 'dataContainer' => 'Table', |
| 24 | 22 | 'switchToEdit' => true, |
| 25 | 23 | 'enableVersioning' => true, |
| 26 | - 'sql' => array |
|
| 27 | - ( |
|
| 28 | - 'keys' => array |
|
| 29 | - ( |
|
| 24 | + 'sql' => array( |
|
| 25 | + 'keys' => array( |
|
| 30 | 26 | 'id' => 'primary' |
| 31 | 27 | ) |
| 32 | 28 | ) |
| 33 | 29 | ), |
| 34 | 30 | // List |
| 35 | - 'list' => array |
|
| 36 | - ( |
|
| 37 | - 'sorting' => array |
|
| 38 | - ( |
|
| 31 | + 'list' => array( |
|
| 32 | + 'sorting' => array( |
|
| 39 | 33 | 'mode' => 4, |
| 40 | 34 | 'fields' => array('startDate DESC'), |
| 41 | 35 | 'headerFields' => array('name'), |
| 42 | 36 | 'panelLayout' => 'filter;sort,search,limit', |
| 43 | 37 | 'child_record_callback' => array('tl_belegungsplan_feiertage', 'listCalender') |
| 44 | 38 | ), |
| 45 | - 'label' => array |
|
| 46 | - ( |
|
| 39 | + 'label' => array( |
|
| 47 | 40 | 'fields' => array('title', 'startDate', 'endDate'), |
| 48 | 41 | 'format' => '%s' |
| 49 | 42 | ), |
| 50 | - 'global_operations' => array |
|
| 51 | - ( |
|
| 52 | - 'all' => array |
|
| 53 | - ( |
|
| 43 | + 'global_operations' => array( |
|
| 44 | + 'all' => array( |
|
| 54 | 45 | 'label' => &$GLOBALS['TL_LANG']['MSC']['all'], |
| 55 | 46 | 'href' => 'act=select', |
| 56 | 47 | 'class' => 'header_edit_all', |
| 57 | 48 | 'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"' |
| 58 | 49 | ) |
| 59 | 50 | ), |
| 60 | - 'operations' => array |
|
| 61 | - ( |
|
| 62 | - 'edit' => array |
|
| 63 | - ( |
|
| 51 | + 'operations' => array( |
|
| 52 | + 'edit' => array( |
|
| 64 | 53 | 'label' => &$GLOBALS['TL_LANG']['tl_belegungsplan_feiertage']['edit'], |
| 65 | 54 | 'href' => 'act=edit', |
| 66 | 55 | 'icon' => 'edit.svg' |
| 67 | 56 | ), |
| 68 | - 'delete' => array |
|
| 69 | - ( |
|
| 57 | + 'delete' => array( |
|
| 70 | 58 | 'label' => &$GLOBALS['TL_LANG']['tl_belegungsplan_feiertage']['delete'], |
| 71 | 59 | 'href' => 'act=delete', |
| 72 | 60 | 'icon' => 'delete.svg', |
@@ -75,8 +63,7 @@ discard block |
||
| 75 | 63 | ) |
| 76 | 64 | ), |
| 77 | 65 | // Palettes |
| 78 | - 'palettes' => array |
|
| 79 | - ( |
|
| 66 | + 'palettes' => array( |
|
| 80 | 67 | '__selector__' => array(), |
| 81 | 68 | 'default' => '{title_legend},title,author;{date_legend},startDate,endDate' |
| 82 | 69 | ), |
@@ -84,18 +71,14 @@ discard block |
||
| 84 | 71 | 'subpalettes' => array( |
| 85 | 72 | ), |
| 86 | 73 | // Fields |
| 87 | - 'fields' => array |
|
| 88 | - ( |
|
| 89 | - 'id' => array |
|
| 90 | - ( |
|
| 74 | + 'fields' => array( |
|
| 75 | + 'id' => array( |
|
| 91 | 76 | 'sql' => "int(10) unsigned NOT NULL auto_increment" |
| 92 | 77 | ), |
| 93 | - 'tstamp' => array |
|
| 94 | - ( |
|
| 78 | + 'tstamp' => array( |
|
| 95 | 79 | 'sql' => "int(10) unsigned NOT NULL default '0'" |
| 96 | 80 | ), |
| 97 | - 'title' => array |
|
| 98 | - ( |
|
| 81 | + 'title' => array( |
|
| 99 | 82 | 'label' => &$GLOBALS['TL_LANG']['tl_belegungsplan_calender']['title'], |
| 100 | 83 | 'exclude' => true, |
| 101 | 84 | 'search' => true, |
@@ -104,8 +87,7 @@ discard block |
||
| 104 | 87 | 'eval' => array('mandatory'=>true, 'maxlength'=>255, 'tl_class'=>'long'), |
| 105 | 88 | 'sql' => "varchar(255) NOT NULL default ''" |
| 106 | 89 | ), |
| 107 | - 'author' => array |
|
| 108 | - ( |
|
| 90 | + 'author' => array( |
|
| 109 | 91 | 'label' => &$GLOBALS['TL_LANG']['tl_belegungsplan_calender']['author'], |
| 110 | 92 | 'default' => BackendUser::getInstance()->id, |
| 111 | 93 | 'exclude' => true, |
@@ -119,8 +101,7 @@ discard block |
||
| 119 | 101 | 'sql' => "int(10) unsigned NOT NULL default '0'", |
| 120 | 102 | 'relation' => array('type'=>'belongsTo', 'load'=>'eager') |
| 121 | 103 | ), |
| 122 | - 'startDate' => array |
|
| 123 | - ( |
|
| 104 | + 'startDate' => array( |
|
| 124 | 105 | 'label' => &$GLOBALS['TL_LANG']['tl_belegungsplan_calender']['startDate'], |
| 125 | 106 | 'exclude' => true, |
| 126 | 107 | 'search' => true, |
@@ -131,8 +112,7 @@ discard block |
||
| 131 | 112 | 'eval' => array('rgxp'=>'date', 'mandatory'=>true, 'doNotCopy'=>true, 'datepicker'=>true, 'tl_class'=>'w50 wizard'), |
| 132 | 113 | 'sql' => "int(10) unsigned NULL" |
| 133 | 114 | ), |
| 134 | - 'endDate' => array |
|
| 135 | - ( |
|
| 115 | + 'endDate' => array( |
|
| 136 | 116 | 'label' => &$GLOBALS['TL_LANG']['tl_belegungsplan_calender']['endDate'], |
| 137 | 117 | 'exclude' => true, |
| 138 | 118 | 'search' => true, |