|
1
|
|
|
<?php
|
|
2
|
|
|
/**
|
|
3
|
|
|
* Contao Open Source CMS
|
|
4
|
|
|
*
|
|
5
|
|
|
* Copyright (c) Jan Karai
|
|
6
|
|
|
*
|
|
7
|
|
|
* @license LGPL-3.0+
|
|
8
|
|
|
*/
|
|
9
|
|
|
/**
|
|
10
|
|
|
* Table tl_belegungsplan_category
|
|
11
|
|
|
*/
|
|
12
|
|
|
$GLOBALS['TL_DCA']['tl_belegungsplan_category'] = array
|
|
13
|
|
|
(
|
|
14
|
|
|
// Config
|
|
15
|
|
|
'config' => array
|
|
16
|
|
|
(
|
|
17
|
|
|
'dataContainer' => 'Table',
|
|
18
|
|
|
'ctable' => array('tl_belegungsplan_objekte'),
|
|
19
|
|
|
'switchToEdit' => true,
|
|
20
|
|
|
'enableVersioning' => true,
|
|
21
|
|
|
'sql' => array
|
|
22
|
|
|
(
|
|
23
|
|
|
'keys' => array
|
|
24
|
|
|
(
|
|
25
|
|
|
'id' => 'primary'
|
|
26
|
|
|
)
|
|
27
|
|
|
)
|
|
28
|
|
|
),
|
|
29
|
|
|
// List
|
|
30
|
|
|
'list' => array
|
|
31
|
|
|
(
|
|
32
|
|
|
'sorting' => array
|
|
33
|
|
|
(
|
|
34
|
|
|
'mode' => 1,
|
|
35
|
|
|
'fields' => array('title'),
|
|
36
|
|
|
'flag' => 1,
|
|
37
|
|
|
'panelLayout' => 'search,limit'
|
|
38
|
|
|
),
|
|
39
|
|
|
'label' => array
|
|
40
|
|
|
(
|
|
41
|
|
|
'fields' => array('title'),
|
|
42
|
|
|
'format' => '%s'
|
|
43
|
|
|
),
|
|
44
|
|
|
'global_operations' => array
|
|
45
|
|
|
(
|
|
46
|
|
|
'all' => array
|
|
47
|
|
|
(
|
|
48
|
|
|
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
|
|
49
|
|
|
'href' => 'act=select',
|
|
50
|
|
|
'class' => 'header_edit_all',
|
|
51
|
|
|
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
|
|
52
|
|
|
)
|
|
53
|
|
|
),
|
|
54
|
|
|
'operations' => array
|
|
55
|
|
|
(
|
|
56
|
|
|
'edit' => array
|
|
57
|
|
|
(
|
|
58
|
|
|
'label' => &$GLOBALS['TL_LANG']['tl_belegungsplan_category']['edit'],
|
|
59
|
|
|
'href' => 'table=tl_belegungsplan_objekte',
|
|
60
|
|
|
'icon' => 'cssimport.svg'
|
|
61
|
|
|
),
|
|
62
|
|
|
'editheader' => array
|
|
63
|
|
|
(
|
|
64
|
|
|
'label' => &$GLOBALS['TL_LANG']['tl_belegungsplan_category']['editheader'],
|
|
65
|
|
|
'href' => 'act=edit',
|
|
66
|
|
|
'icon' => 'edit.svg',
|
|
67
|
|
|
'button_callback' => array('tl_belegungsplan_category', 'editHeader')
|
|
68
|
|
|
),
|
|
69
|
|
|
'copy' => array
|
|
70
|
|
|
(
|
|
71
|
|
|
'label' => &$GLOBALS['TL_LANG']['tl_belegungsplan_category']['copy'],
|
|
72
|
|
|
'href' => 'act=copy',
|
|
73
|
|
|
'icon' => 'copy.svg',
|
|
74
|
|
|
'button_callback' => array('tl_belegungsplan_category', 'copyCategory')
|
|
75
|
|
|
),
|
|
76
|
|
|
'delete' => array
|
|
77
|
|
|
(
|
|
78
|
|
|
'label' => &$GLOBALS['TL_LANG']['tl_belegungsplan_category']['delete'],
|
|
79
|
|
|
'href' => 'act=delete',
|
|
80
|
|
|
'icon' => 'delete.svg',
|
|
81
|
|
|
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['tl_belegungsplan_category']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"',
|
|
82
|
|
|
'button_callback' => array('tl_belegungsplan_category', 'deleteCategory')
|
|
83
|
|
|
),
|
|
84
|
|
|
'show' => array
|
|
85
|
|
|
(
|
|
86
|
|
|
'label' => &$GLOBALS['TL_LANG']['tl_belegungsplan_category']['show'],
|
|
87
|
|
|
'href' => 'act=show',
|
|
88
|
|
|
'icon' => 'show.svg'
|
|
89
|
|
|
)
|
|
90
|
|
|
)
|
|
91
|
|
|
),
|
|
92
|
|
|
// Palettes
|
|
93
|
|
|
'palettes' => array
|
|
94
|
|
|
(
|
|
95
|
|
|
'__selector__' => array(),
|
|
96
|
|
|
'default' => '{title_legend},title'
|
|
97
|
|
|
),
|
|
98
|
|
|
// Subpalettes
|
|
99
|
|
|
'subpalettes' => array(
|
|
100
|
|
|
),
|
|
101
|
|
|
// Fields
|
|
102
|
|
|
'fields' => array
|
|
103
|
|
|
(
|
|
104
|
|
|
'id' => array
|
|
105
|
|
|
(
|
|
106
|
|
|
'sql' => "int(10) unsigned NOT NULL auto_increment"
|
|
107
|
|
|
),
|
|
108
|
|
|
'tstamp' => array
|
|
109
|
|
|
(
|
|
110
|
|
|
'sql' => "int(10) unsigned NOT NULL default '0'"
|
|
111
|
|
|
),
|
|
112
|
|
|
'title' => array
|
|
113
|
|
|
(
|
|
114
|
|
|
'label' => &$GLOBALS['TL_LANG']['tl_belegungsplan_category']['title'],
|
|
115
|
|
|
'exclude' => true,
|
|
116
|
|
|
'search' => true,
|
|
117
|
|
|
'inputType' => 'text',
|
|
118
|
|
|
'eval' => array('mandatory'=>true, 'maxlength'=>255, 'tl_class'=>'w50'),
|
|
119
|
|
|
'sql' => "varchar(255) NOT NULL default ''"
|
|
120
|
|
|
)
|
|
121
|
|
|
)
|
|
122
|
|
|
);
|
|
123
|
|
|
/**
|
|
124
|
|
|
* Provide miscellaneous methods that are used by the data configuration array.
|
|
125
|
|
|
*
|
|
126
|
|
|
* @author Jan Karai <https://www.sachsen-it.de>
|
|
127
|
|
|
*/
|
|
128
|
|
|
class tl_belegungsplan_category extends Backend {
|
|
129
|
|
|
/**
|
|
130
|
|
|
* Import the back end user object
|
|
131
|
|
|
*/
|
|
132
|
|
|
public function __construct() {
|
|
133
|
|
|
parent::__construct();
|
|
134
|
|
|
$this->import('BackendUser', 'User');
|
|
135
|
|
|
}
|
|
136
|
|
|
/**
|
|
137
|
|
|
* Return the edit header button
|
|
138
|
|
|
*
|
|
139
|
|
|
* @param array $row
|
|
140
|
|
|
* @param string $href
|
|
141
|
|
|
* @param string $label
|
|
142
|
|
|
* @param string $title
|
|
143
|
|
|
* @param string $icon
|
|
144
|
|
|
* @param string $attributes
|
|
145
|
|
|
*
|
|
146
|
|
|
* @return string
|
|
147
|
|
|
*/
|
|
148
|
|
|
public function editHeader($row, $href, $label, $title, $icon, $attributes)
|
|
149
|
|
|
{
|
|
150
|
|
|
return '<a href="'.$this->addToUrl($href.'&id='.$row['id']).'" title="'.StringUtil::specialchars($title).'"'.$attributes.'>'.Image::getHtml($icon, $label).'</a> ';
|
|
151
|
|
|
}
|
|
152
|
|
|
/**
|
|
153
|
|
|
* Return the copy category button
|
|
154
|
|
|
*
|
|
155
|
|
|
* @param array $row
|
|
156
|
|
|
* @param string $href
|
|
157
|
|
|
* @param string $label
|
|
158
|
|
|
* @param string $title
|
|
159
|
|
|
* @param string $icon
|
|
160
|
|
|
* @param string $attributes
|
|
161
|
|
|
*
|
|
162
|
|
|
* @return string
|
|
163
|
|
|
*/
|
|
164
|
|
|
public function copyCategory($row, $href, $label, $title, $icon, $attributes)
|
|
165
|
|
|
{
|
|
166
|
|
|
return '<a href="'.$this->addToUrl($href.'&id='.$row['id']).'" title="'.StringUtil::specialchars($title).'"'.$attributes.'>'.Image::getHtml($icon, $label).'</a> ';
|
|
167
|
|
|
}
|
|
168
|
|
|
/**
|
|
169
|
|
|
* Return the delete category button
|
|
170
|
|
|
*
|
|
171
|
|
|
* @param array $row
|
|
172
|
|
|
* @param string $href
|
|
173
|
|
|
* @param string $label
|
|
174
|
|
|
* @param string $title
|
|
175
|
|
|
* @param string $icon
|
|
176
|
|
|
* @param string $attributes
|
|
177
|
|
|
*
|
|
178
|
|
|
* @return string
|
|
179
|
|
|
*/
|
|
180
|
|
|
public function deleteCategory($row, $href, $label, $title, $icon, $attributes)
|
|
181
|
|
|
{
|
|
182
|
|
|
return '<a href="'.$this->addToUrl($href.'&id='.$row['id']).'" title="'.StringUtil::specialchars($title).'"'.$attributes.'>'.Image::getHtml($icon, $label).'</a> ';
|
|
183
|
|
|
}
|
|
184
|
|
|
}
|
|
185
|
|
|
|