1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* EGroupware - Preferences hooks |
4
|
|
|
* |
5
|
|
|
* @link http://www.egroupware.org |
6
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License |
7
|
|
|
* @package preferences |
8
|
|
|
* @version $Id$ |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
use EGroupware\Api; |
12
|
|
|
use EGroupware\Api\Framework; |
13
|
|
|
use EGroupware\Api\Egw; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Static hooks for preferences class |
17
|
|
|
*/ |
18
|
|
|
class preferences_hooks |
19
|
|
|
{ |
20
|
|
|
/** |
21
|
|
|
* Hook return common preferences settings |
22
|
|
|
* |
23
|
|
|
* @param string|array $hook_data |
24
|
|
|
* @return array |
25
|
|
|
*/ |
26
|
|
|
static public function settings($hook_data) |
27
|
|
|
{ |
28
|
|
|
$navbar_format = array( |
29
|
|
|
'icons' => lang('Icons only'), |
30
|
|
|
'icons_and_text' => lang('Icons and text'), |
31
|
|
|
'text' => lang('Text only') |
32
|
|
|
); |
33
|
|
|
|
34
|
|
|
$link_list_format = array( |
35
|
|
|
'icons' => lang('Icons only'), |
36
|
|
|
'icons_and_text' => lang('Icons and text'), |
37
|
|
|
'text' => lang('Text only') |
38
|
|
|
); |
39
|
|
|
|
40
|
|
|
if (!$hook_data['setup']) |
41
|
|
|
{ |
42
|
|
|
$langs = Api\Translation::get_installed_langs(); |
43
|
|
|
|
44
|
|
|
$tzs = Api\DateTime::getTimezones(); |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
$date_formats = array( |
48
|
|
|
'd.m.Y' => 'd.m.Y', |
49
|
|
|
'Y-m-d' => 'Y-m-d', |
50
|
|
|
'm/d/Y' => 'm/d/Y', |
51
|
|
|
'm-d-Y' => 'm-d-Y', |
52
|
|
|
'm.d.Y' => 'm.d.Y', |
53
|
|
|
'Y/d/m' => 'Y/d/m', |
54
|
|
|
'Y-d-m' => 'Y-d-m', |
55
|
|
|
'Y.d.m' => 'Y.d.m', |
56
|
|
|
'Y/m/d' => 'Y/m/d', |
57
|
|
|
'Y.m.d' => 'Y.m.d', |
58
|
|
|
'd/m/Y' => 'd/m/Y', |
59
|
|
|
'd-m-Y' => 'd-m-Y', |
60
|
|
|
'd-M-Y' => 'd-M-Y' |
61
|
|
|
); |
62
|
|
|
|
63
|
|
|
$time_formats = array( |
64
|
|
|
'12' => lang('12 hour'), |
65
|
|
|
'24' => lang('24 hour') |
66
|
|
|
); |
67
|
|
|
|
68
|
|
|
$account_sels = array( |
69
|
|
|
'selectbox' => lang('Selectbox'), |
70
|
|
|
'primary_group' => lang('Selectbox with primary group and search'), |
71
|
|
|
'groupmembers' => lang('Selectbox with groupmembers'), |
72
|
|
|
'none' => lang('No user-selection at all'), |
73
|
|
|
); |
74
|
|
|
|
75
|
|
|
$account_display = array( |
76
|
|
|
'firstname' => lang('Firstname'). ' '.lang('Lastname'), |
77
|
|
|
'lastname' => lang('Lastname').', '.lang('Firstname'), |
78
|
|
|
'username' => lang('username'), |
79
|
|
|
'firstall' => lang('Firstname').' '.lang('Lastname').' ['.lang('username').']', |
80
|
|
|
'lastall' => lang('Lastname').', '.lang('Firstname').' ['.lang('username').']', |
81
|
|
|
'allfirst' => '['.lang('username').'] '.lang('Firstname').' '.lang('Lastname'), |
82
|
|
|
'all' => '['.lang('username').'] '.lang('Lastname').','.lang('Firstname'), |
83
|
|
|
'firstgroup'=> lang('Firstname').' '.lang('Lastname').' ('.lang('primary group').')', |
84
|
|
|
'lastgroup' => lang('Lastname').', '.lang('Firstname').' ('.lang('primary group').')', |
85
|
|
|
); |
86
|
|
|
|
87
|
|
|
if ($hook_data['setup']) // called via setup |
88
|
|
|
{ |
89
|
|
|
$lang = setup::get_lang(); |
90
|
|
|
} |
91
|
|
|
if (empty($lang)) $lang = 'en'; |
92
|
|
|
list(,$country) = explode('-',$lang); |
93
|
|
|
if (empty($country) && class_exists('Locale')) $country = Locale::getRegion(Locale::getDefault()); |
94
|
|
|
if (empty($country)) $country = 'de'; |
95
|
|
|
|
96
|
|
|
// check for old rte_font_size pref including px and split it in size and unit |
97
|
|
|
if (!isset($GLOBALS['egw_setup']) && |
98
|
|
|
substr($GLOBALS['egw_info']['user']['preferences']['common']['rte_font_size'], -2) == 'px') |
99
|
|
|
{ |
100
|
|
|
$prefs = $GLOBALS['egw']->preferences; |
101
|
|
|
foreach(array('user','default','forced') as $type) |
102
|
|
|
{ |
103
|
|
|
if (substr($prefs->{$type}['common']['rte_font_size'], -2) == 'px') |
104
|
|
|
{ |
105
|
|
|
Api\Etemplate\Widget\HtmlArea::font_size_from_prefs($prefs->{$type}, $prefs->{$type}['common']['rte_font_size'], |
106
|
|
|
$prefs->{$type}['common']['rte_font_unit']); |
107
|
|
|
$prefs->save_repository(false, $type); |
108
|
|
|
} |
109
|
|
|
} |
110
|
|
|
Api\Etemplate\Widget\HtmlArea::font_size_from_prefs($GLOBALS['egw_info']['user']['preferences'], |
111
|
|
|
$GLOBALS['egw_info']['user']['preferences']['common']['rte_font_size'], |
112
|
|
|
$GLOBALS['egw_info']['user']['preferences']['common']['rte_font_unit']); |
113
|
|
|
} |
114
|
|
|
$rte_toolbar_list = array ( |
115
|
|
|
'undo', 'redo', 'bold', 'italic', 'strikethrough', 'forecolor', 'backcolor', |
116
|
|
|
'link', 'alignleft', 'aligncenter', 'alignright', 'alignjustify', |
117
|
|
|
'numlist', 'bullist', 'outdent', 'indent', 'ltr', 'rtl', |
118
|
|
|
'removeformat', 'code', 'image', 'searchreplace','formatselect', 'fontselect', 'fontsizeselect' |
119
|
|
|
); |
120
|
|
|
$rte_toolbar_selOptions = array(); |
121
|
|
|
foreach ($rte_toolbar_list as $toolbar) |
122
|
|
|
{ |
123
|
|
|
$rte_toolbar_selOptions[$toolbar] = array ( |
124
|
|
|
'id' => $toolbar, |
125
|
|
|
'label' => lang($toolbar), |
126
|
|
|
'title' => lang($toolbar), |
127
|
|
|
'icon' => Framework::getUrl($GLOBALS['egw_info']['server']['webserver_url']).'/api/templates/default/images/htmlarea/'.$toolbar.'.png', |
128
|
|
|
'app' => 'api' |
129
|
|
|
); |
130
|
|
|
} |
131
|
|
|
|
132
|
|
|
if (!$GLOBALS['egw_info']['user']['preferences']['common']['rte_toolbar']) |
133
|
|
|
{ |
134
|
|
|
$GLOBALS['egw']->preferences->add('common', 'rte_toolbar', 'fontselect,fontsizeselect,bold,italic,forecolor,backcolor,'. |
135
|
|
|
'alignleft,aligncenter,alignright,alignjustify,numlist,bullist'. |
136
|
|
|
',outdent,indent,link,image', 'user'); |
137
|
|
|
$GLOBALS['egw']->preferences->save_repository(true); |
138
|
|
|
} |
139
|
|
|
|
140
|
|
|
// do NOT query widgets from setup / installation, it fails with an exception |
141
|
|
|
$font_options = $font_unit_options = $font_size_options = []; |
142
|
|
|
if (!isset($GLOBALS['egw_setup'])) |
143
|
|
|
{ |
144
|
|
|
$font_options = Api\Etemplate\Widget\HtmlArea::$font_options; |
145
|
|
|
$font_unit_options = Api\Etemplate\Widget\HtmlArea::$font_unit_options; |
146
|
|
|
$font_size_options = Api\Etemplate\Widget\HtmlArea::$font_size_options; |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
// Settings array for this app |
150
|
|
|
$settings = array( |
151
|
|
|
array( |
152
|
|
|
'type' => 'section', |
153
|
|
|
'title' => 'Look & feel' |
154
|
|
|
), |
155
|
|
|
'maxmatchs' => array( |
156
|
|
|
'type' => 'input', |
157
|
|
|
'label' => 'Max matches per page', |
158
|
|
|
'name' => 'maxmatchs', |
159
|
|
|
'help' => 'Any listing in eGW will show you this number of entries or lines per page.<br>To many slow down the page display, to less will cost you the overview.', |
160
|
|
|
'size' => 3, |
161
|
|
|
'xmlrpc' => True, |
162
|
|
|
'admin' => False, |
163
|
|
|
'forced' => 20, // hidden as not used in eTemplate2 |
164
|
|
|
), |
165
|
|
|
'template_set' => array( |
166
|
|
|
'type' => 'select', |
167
|
|
|
'label' => 'Interface/Template Selection', |
168
|
|
|
'name' => 'template_set', |
169
|
|
|
'values' => Framework::list_templates(), |
170
|
|
|
'help' => 'A template defines the layout of eGroupWare and it contains icons for each application.', |
171
|
|
|
'xmlrpc' => True, |
172
|
|
|
'admin' => False, |
173
|
|
|
'forced' => file_exists(EGW_SERVER_ROOT.'/pixelegg') ? 'pixelegg' : 'idots', |
174
|
|
|
), |
175
|
|
|
'theme' => array( |
176
|
|
|
'type' => 'select', |
177
|
|
|
'label' => 'Theme (colors/fonts) Selection', |
178
|
|
|
'name' => 'theme', |
179
|
|
|
'values' => !$hook_data['setup'] ? $GLOBALS['egw']->framework->list_themes() : array(), |
180
|
|
|
'help' => 'A theme defines the colors and fonts used by the template.', |
181
|
|
|
'xmlrpc' => True, |
182
|
|
|
'admin' => False, |
183
|
|
|
'forced' => file_exists(EGW_SERVER_ROOT.'/pixelegg') ? 'pixelegg' : 'idots', |
184
|
|
|
), |
185
|
|
|
'audio_effect'=> array( |
186
|
|
|
'type' => 'select', |
187
|
|
|
'label' => 'Audio effect', |
188
|
|
|
'name' => 'audio_effect', |
189
|
|
|
'values' => array('0'=>lang('Disable'),'1'=>lang('Enable')), |
190
|
|
|
'help' => 'Audio effect enables|disables sound effects used in the theme', |
191
|
|
|
'xmlrpc' => True, |
192
|
|
|
'admin' => False, |
193
|
|
|
'default' => '0', |
194
|
|
|
), |
195
|
|
|
'navbar_format' => array( |
196
|
|
|
'type' => 'select', |
197
|
|
|
'label' => 'Show navigation bar as', |
198
|
|
|
'name' => 'navbar_format', |
199
|
|
|
'values' => $navbar_format, |
200
|
|
|
'help' => 'You can show the applications as icons only, icons with app-name or both.', |
201
|
|
|
'xmlrpc' => True, |
202
|
|
|
'admin' => False, |
203
|
|
|
'default'=> 'icons_and_text', |
204
|
|
|
), |
205
|
|
|
'link_list_format' => array( |
206
|
|
|
'type' => 'select', |
207
|
|
|
'label' => 'Show links between eGroupWare aps as', |
208
|
|
|
'name' => 'link_list_format', |
209
|
|
|
'values' => $link_list_format, |
210
|
|
|
'help' => 'You can show the linked entries with icons only, icons with app-name or both.', |
211
|
|
|
'xmlrpc' => True, |
212
|
|
|
'admin' => False, |
213
|
|
|
'forced' => 'icons', |
214
|
|
|
), |
215
|
|
|
'link_list_thumbnail' => array( |
216
|
|
|
'type' => 'select', |
217
|
|
|
'label' => 'Display thumbnails for linked images', |
218
|
|
|
'name' => 'link_list_thumbnail', |
219
|
|
|
'values' => array( |
220
|
|
|
'1' => lang('Yes'), |
221
|
|
|
'0' => lang('No'), |
222
|
|
|
), |
223
|
|
|
'help' => 'Images linked to an entry can be displayed as thumbnails. You can turn this off to speed up page display.', |
224
|
|
|
'xmlrpc' => True, |
225
|
|
|
'admin' => False, |
226
|
|
|
'forced' => '1', |
227
|
|
|
), |
228
|
|
|
'select_mode' => array( |
229
|
|
|
'type' => 'select', |
230
|
|
|
'label' => 'Select additional lines in lists by', |
231
|
|
|
'name' => 'select_mode', |
232
|
|
|
'values' => array( |
233
|
|
|
'EGW_SELECTMODE_DEFAULT' => lang('holding Ctrl/Cmd key and click on the line'), |
234
|
|
|
'EGW_SELECTMODE_TOGGLE' => lang('just clicking on the line, like a checkbox'), |
235
|
|
|
), |
236
|
|
|
'help' => 'If a line is already selected, further lines get either selected by holding Ctrl/Cmd key and clicking on them (to not unselect the current selected line), or by just clicking on them as for a checkbox. If no line is selected clicking on one allways selects it. Holding down Shift key selects everything between current select line and the one clicked.', |
237
|
|
|
'xmlrpc' => True, |
238
|
|
|
'admin' => False, |
239
|
|
|
'default' => 'EGW_SELECTMODE_DEFAULT', |
240
|
|
|
), |
241
|
|
|
'account_selection' => array( |
242
|
|
|
'type' => 'select', |
243
|
|
|
'label' => 'How do you like to select accounts', |
244
|
|
|
'name' => 'account_selection', |
245
|
|
|
'values' => $account_sels, |
246
|
|
|
'help' => lang('The selectbox shows all available users (can be very slow on big installs with many users). The popup can search users by name or group.').' '. |
247
|
|
|
lang('The two last options limit the visibility of other users. Therefore they should be forced and apply NOT to administrators.'), |
248
|
|
|
'run_lang' => false, |
249
|
|
|
'xmlrpc' => True, |
250
|
|
|
'admin' => False, |
251
|
|
|
'default'=> 'selectbox' |
252
|
|
|
), |
253
|
|
|
'account_display' => array( |
254
|
|
|
'type' => 'select', |
255
|
|
|
'label' => 'How do you like to display accounts', |
256
|
|
|
'name' => 'account_display', |
257
|
|
|
'values' => $account_display, |
258
|
|
|
'help' => 'Set this to your convenience. For security reasons, you might not want to show your Loginname in public.', |
259
|
|
|
'xmlrpc' => True, |
260
|
|
|
'admin' => False, |
261
|
|
|
'default'=> 'lastname', |
262
|
|
|
), |
263
|
|
|
'show_currentusers' => array( |
264
|
|
|
'type' => 'check', |
265
|
|
|
'label' => 'Show number of current users', |
266
|
|
|
'name' => 'show_currentusers', |
267
|
|
|
'help' => 'Should the number of active sessions be displayed for you all the time.', |
268
|
|
|
'xmlrpc' => False, |
269
|
|
|
'admin' => True, |
270
|
|
|
'forced' => true, |
271
|
|
|
), |
272
|
|
|
'scroll_area'=> array( |
273
|
|
|
'type' => 'select', |
274
|
|
|
'label' => 'Applications list scroll area', |
275
|
|
|
'name' => 'scroll_area', |
276
|
|
|
'values' => array('0'=>lang('Disable'),'1'=>lang('Enable')), |
277
|
|
|
'help' => 'Make applications list scrollable with up/down scroll buttons (usefull for users working with mouse with no scrollwheel)', |
278
|
|
|
'xmlrpc' => True, |
279
|
|
|
'admin' => False, |
280
|
|
|
'default' => '0', |
281
|
|
|
), |
282
|
|
|
array( |
283
|
|
|
'type' => 'section', |
284
|
|
|
'title' => 'Formatting & general settings' |
285
|
|
|
), |
286
|
|
|
'lang' => array( |
287
|
|
|
'type' => 'select', |
288
|
|
|
'label' => 'Language', |
289
|
|
|
'name' => 'lang', |
290
|
|
|
'values' => $langs, |
291
|
|
|
'help' => 'Select the language of texts and messages within eGroupWare.<br>Some languages may not contain all messages, in that case you will see an english message.', |
292
|
|
|
'xmlrpc' => True, |
293
|
|
|
'admin' => False, |
294
|
|
|
'default'=> $lang, |
295
|
|
|
), |
296
|
|
|
'country' => array( |
297
|
|
|
'type' => 'select-country', |
298
|
|
|
'label' => 'Country', |
299
|
|
|
'name' => 'country', |
300
|
|
|
'help' => 'In which country are you. This is used to set certain defaults for you.', |
301
|
|
|
'xmlrpc' => True, |
302
|
|
|
'admin' => False, |
303
|
|
|
'values' => array(''), |
304
|
|
|
'default'=> strtoupper($country), |
305
|
|
|
'attributes' => array ( |
306
|
|
|
'tags' => true |
307
|
|
|
) |
308
|
|
|
), |
309
|
|
|
'tz' => array( |
310
|
|
|
'type' => 'select', |
311
|
|
|
'label' => 'Time zone', |
312
|
|
|
'name' => 'tz', |
313
|
|
|
'values' => $tzs, |
314
|
|
|
'help' => 'Please select your timezone.', |
315
|
|
|
'xmlrpc' => True, |
316
|
|
|
'admin' => False, |
317
|
|
|
'default'=> date_default_timezone_get(), |
318
|
|
|
), |
319
|
|
|
'tz_selection' => array( |
320
|
|
|
'type' => 'multiselect', |
321
|
|
|
'label' => 'Permanent time zone selection', |
322
|
|
|
'name' => 'tz_selection', |
323
|
|
|
'values' => $tzs ? call_user_func_array('array_merge',$tzs) : null, // only flat arrays supported |
324
|
|
|
'help' => 'Please select timezones, you want to be able to quickly switch between. Switch is NOT shown, if less then two are selected.', |
325
|
|
|
'xmlrpc' => True, |
326
|
|
|
'admin' => False, |
327
|
|
|
'forced' => date_default_timezone_get(), |
328
|
|
|
), |
329
|
|
|
'dateformat' => array( |
330
|
|
|
'type' => 'select', |
331
|
|
|
'label' => 'Date format', |
332
|
|
|
'name' => 'dateformat', |
333
|
|
|
'values' => $date_formats, |
334
|
|
|
'help' => 'How should eGroupWare display dates for you.', |
335
|
|
|
'xmlrpc' => True, |
336
|
|
|
'admin' => False, |
337
|
|
|
'default'=> $lang == 'en' ? 'Y/m/d' : 'd.m.Y', |
338
|
|
|
), |
339
|
|
|
'timeformat' => array( |
340
|
|
|
'type' => 'select', |
341
|
|
|
'label' => 'Time format', |
342
|
|
|
'name' => 'timeformat', |
343
|
|
|
'values' => $time_formats, |
344
|
|
|
'help' => 'Do you prefer a 24 hour time format, or a 12 hour one with am/pm attached.', |
345
|
|
|
'xmlrpc' => True, |
346
|
|
|
'admin' => False, |
347
|
|
|
'default'=> 24, |
348
|
|
|
), |
349
|
|
|
'number_format' => array( |
350
|
|
|
'type' => 'select', |
351
|
|
|
'label' => 'Number format', |
352
|
|
|
'name' => 'number_format', |
353
|
|
|
'values' => array( |
354
|
|
|
'.' => '1234.56', |
355
|
|
|
',' => '1234,56', |
356
|
|
|
'.,' => '1,234.56', |
357
|
|
|
',.' => '1.234,56', |
358
|
|
|
'. ' => '1 234.56', |
359
|
|
|
', ' => '1 234,56', |
360
|
|
|
), |
361
|
|
|
'help' => 'Thousands separator is only used for displaying and not for editing numbers.', |
362
|
|
|
'xmlrpc' => True, |
363
|
|
|
'admin' => false, |
364
|
|
|
'default'=> '.', |
365
|
|
|
), |
366
|
|
|
'currency' => array( |
367
|
|
|
'type' => 'input', |
368
|
|
|
'label' => 'Currency', |
369
|
|
|
'name' => 'currency', |
370
|
|
|
'help' => 'Which currency symbol or name should be used in eGroupWare.', |
371
|
|
|
'xmlrpc' => True, |
372
|
|
|
'admin' => False, |
373
|
|
|
'default'=> $lang == 'en' ? '$' : 'EUR', |
374
|
|
|
), |
375
|
|
|
'csv_charset' => array( |
376
|
|
|
'type' => 'select', |
377
|
|
|
'label' => 'Charset for the CSV export/import', |
378
|
|
|
'name' => 'csv_charset', |
379
|
|
|
'values' => Api\Translation::get_installed_charsets(), |
380
|
|
|
'help' => 'Which charset should be used for the CSV export. The system default is the charset of this eGroupWare installation.', |
381
|
|
|
'xmlrpc' => True, |
382
|
|
|
'admin' => false, |
383
|
|
|
'default'=> 'iso-8859-1', |
384
|
|
|
), |
385
|
|
|
array( |
386
|
|
|
'type' => 'section', |
387
|
|
|
'title' => 'Text editor settings' |
388
|
|
|
), |
389
|
|
|
'rte_font' => array( |
390
|
|
|
'type' => 'select', |
391
|
|
|
'label' => 'Default font', |
392
|
|
|
'name' => 'rte_font', |
393
|
|
|
'values' => $font_options, |
394
|
|
|
'help' => 'Automatically start with this font', |
395
|
|
|
'xmlrpc' => True, |
396
|
|
|
'admin' => false, |
397
|
|
|
'default' => 'arial, helvetica, sans-serif' |
398
|
|
|
), |
399
|
|
|
'rte_font_unit' => array( |
400
|
|
|
'type' => 'select', |
401
|
|
|
'label' => 'Font size unit', |
402
|
|
|
'name' => 'rte_font_unit', |
403
|
|
|
'values' => array_map('lang', $font_unit_options), |
404
|
|
|
'help' => 'Unit of displayed font sizes: either "px" as used eg. for web-pages or "pt" as used in text processing.', |
405
|
|
|
'default'=> 'pt', |
406
|
|
|
'xmlrpc' => True, |
407
|
|
|
'admin' => false, |
408
|
|
|
'default' => 'pt' |
409
|
|
|
), |
410
|
|
|
'rte_font_size' => array( |
411
|
|
|
'type' => 'select', |
412
|
|
|
'label' => 'Default font size', |
413
|
|
|
'name' => 'rte_font_size', |
414
|
|
|
'values' => $font_size_options, |
415
|
|
|
'help' => 'Automatically start with this font size', |
416
|
|
|
'xmlrpc' => True, |
417
|
|
|
'admin' => false, |
418
|
|
|
'default' => '10' |
419
|
|
|
), |
420
|
|
|
'rte_formatblock' => array( |
421
|
|
|
'type' => 'select', |
422
|
|
|
'label' => 'Default format block', |
423
|
|
|
'name' => 'rte_formatblock', |
424
|
|
|
'values' => array( |
425
|
|
|
'p' => lang("Paragraph"), |
426
|
|
|
'h1' => lang("Heading %1", '1'), |
|
|
|
|
427
|
|
|
'h2' => lang("Heading %1", '2'), |
428
|
|
|
'h3' => lang("Heading %1", '3'), |
429
|
|
|
'h4' => lang("Heading %1", '4'), |
430
|
|
|
'h5' => lang("Heading %1", '5'), |
431
|
|
|
'h6' => lang("Heading %1", '6'), |
432
|
|
|
'pre' => lang("Preformatted"), |
433
|
|
|
'customparagraph' => lang("Custom Paragraph") |
434
|
|
|
), |
435
|
|
|
'help' => 'Automatically start with this format block.<br/><b>Custom Paragraph</b> adds less line space between new lines.', |
436
|
|
|
'xmlrpc' => True, |
437
|
|
|
'admin' => false, |
438
|
|
|
'default' => 'p' |
439
|
|
|
), |
440
|
|
|
'rte_menubar' => array( |
441
|
|
|
'type' => 'select', |
442
|
|
|
'label' => 'Enable menubar', |
443
|
|
|
'name' => 'rte_menubar', |
444
|
|
|
'values' => array( |
445
|
|
|
'1' => lang('Yes'), |
446
|
|
|
'0' => lang('No'), |
447
|
|
|
), |
448
|
|
|
'help' => 'Enable/Disable menubar from top of the editor.', |
449
|
|
|
'xmlrpc' => True, |
450
|
|
|
'admin' => '1', |
451
|
|
|
'default' => '1', |
452
|
|
|
), |
453
|
|
|
'rte_toolbar' => array( |
454
|
|
|
'type' => 'taglist', |
455
|
|
|
'label' => 'Enabled features in toolbar', |
456
|
|
|
'name' => 'rte_toolbar', |
457
|
|
|
'values'=> '', |
458
|
|
|
'help' => 'You may select features to be enabled in toolbar. Selecting any of the tools from here means seleted "Feature of the editor" preference would be ignored.', |
459
|
|
|
'admin' => true, |
460
|
|
|
'attributes' => array( |
461
|
|
|
'allowFreeEntries' => false, |
462
|
|
|
//'multiple' => 'toggle', |
463
|
|
|
'editModeEnabled' => false, |
464
|
|
|
'autocomplete_url' => ' ', |
465
|
|
|
'select_options' => $rte_toolbar_selOptions |
466
|
|
|
) |
467
|
|
|
) |
468
|
|
|
); |
469
|
|
|
// disable thumbnails, if no size configured by admin |
470
|
|
|
if (!$GLOBALS['egw_info']['server']['link_list_thumbnail']) unset($settings['link_list_thumbnail']); |
471
|
|
|
|
472
|
|
|
return $settings; |
473
|
|
|
} |
474
|
|
|
|
475
|
|
|
/** |
476
|
|
|
* Hook called when a user gets deleted, to delete his preferences |
477
|
|
|
* |
478
|
|
|
* @param string|array $data |
479
|
|
|
*/ |
480
|
|
|
public static function deleteaccount($data) |
481
|
|
|
{ |
482
|
|
|
$account_id = (int)$data['account_id']; |
483
|
|
|
|
484
|
|
|
if($account_id > 0) // user |
485
|
|
|
{ |
486
|
|
|
$GLOBALS['egw']->preferences->delete_user($account_id); |
487
|
|
|
} |
488
|
|
|
elseif ($account_id < 0) // group |
489
|
|
|
{ |
490
|
|
|
$GLOBALS['egw']->preferences->delete_group($account_id); |
491
|
|
|
} |
492
|
|
|
} |
493
|
|
|
|
494
|
|
|
/** |
495
|
|
|
* Preferences link to Admin >> Edit user |
496
|
|
|
*/ |
497
|
|
|
public static function edit_user() |
498
|
|
|
{ |
499
|
|
|
global $menuData; |
500
|
|
|
|
501
|
|
|
$menuData[] = array( |
502
|
|
|
'description' => 'Preferences', |
503
|
|
|
'url' => '/index.php', |
504
|
|
|
'extradata' => 'menuaction=preferences.preferences_settings.index', |
505
|
|
|
'popup' => '1200x600', |
506
|
|
|
); |
507
|
|
|
} |
508
|
|
|
|
509
|
|
|
/** |
510
|
|
|
* hooks to build sidebox-menu plus the admin and preferences sections |
511
|
|
|
* |
512
|
|
|
* @param string|array $args hook args |
513
|
|
|
*/ |
514
|
|
|
static function admin($args) |
515
|
|
|
{ |
516
|
|
|
unset($args); // unused, but required by function signature |
517
|
|
|
$appname = 'preferences'; |
518
|
|
|
$file = Array( |
519
|
|
|
'Site configuration' => Egw::link('/index.php','menuaction=admin.admin_config.index&appname=' . $appname.'&ajax=true'), |
520
|
|
|
); |
521
|
|
|
display_section($appname, $file); |
522
|
|
|
} |
523
|
|
|
} |
524
|
|
|
|
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.