class_CONFIG.inc.php
25.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
<?php
/**
* @file CONFIG.inc.php
* @category freeSN
* @mailto code [at] netz.coop
* @version 0.4.200901
* @link http://netz.coop
*
* @copyright Copyright by netz.coop e.G. 2015
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class CONFIG {
private static $SocialNetworkTree = false;
public static function getRightManagementValues($param_key) {
if($param_key=='ReadPrivate' || $param_key=='WritePrivate') {
if(array_key_exists('RightManagement', TreeCONFIG::$Config) && array_key_exists('default_'.$param_key, TreeCONFIG::$Config['RightManagement'])) {
return TreeCONFIG::$Config['RightManagement']['default_'.$param_key];
}
}
}
public static function getRightManagement() {
return TreeCONFIG::$Config['RightManagement'];
}
/**
* function retruns the showKind setting, which is set in the TreeConfig *
* - if param_beName is set, the settings for the BC under this BE will be checked first and returned if exists
* - if no showKind is set, CONSTKindOf::LINK_SHOWSINGLE will be returned
*
* @param String param_bcName the name of the BasisClipboard class
* @param String param_beName the name of the PartOf (optional)
*
* @return String
*/
public static function getBasisClipboardShowKind($param_bcName, $param_beName = null) {
$return_showKind = false;
if($param_beName != null){
$bc_array = CONFIG::getMultimediaTextPreferencs($param_beName,'BasisClipboards');
if(array_key_exists($param_bcName, $bc_array) && array_key_exists('showKind',$bc_array[$param_bcName])){
$return_showKind = $bc_array[$param_bcName]['showKind'];
}
}
if(!$return_showKind && CONFIG::getBasisClipboardPreferencs($param_bcName,'showKind')){
$return_showKind = CONFIG::getBasisClipboardPreferencs($param_bcName,'showKind');
}
if(!$return_showKind){
$return_showKind = CONSTKindOf::LINK_SHOWSINGLE;
}
return $return_showKind;
}
public static function getIdentityManagement() {
if(array_key_exists('IdentityManagement', TreeCONFIG::$Config)) {
return TreeCONFIG::$Config['IdentityManagement'];
}
}
public static function checkIfPartOfRightManagement($param_PartOfClassName, $param_BasisClipboardName) {
$var_return = true;
if(array_search($param_PartOfClassName, TreeCONFIG::$Config['RightManagement']['nodefaultPartOfRights']['whenPartOfIs'])!==false) {
$var_return = false;
}
if($var_return && array_search($param_BasisClipboardName, TreeCONFIG::$Config['RightManagement']['nodefaultPartOfRights']['whenBasisClipboardIs'])!==false) {
$var_return = false;
}
return $var_return;
}
public static function getNoLinkListMTexts() {
$class_parents = class_parents('Profile');
$class_parents['Profile'] = 'Profile';
$class_parents['Account'] = 'Account';
$var_TreePart = CONFIG::getConfig('TreePart');
foreach($var_TreePart as $var_MTextClass) {
$class_parents[$var_MTextClass] = $var_MTextClass;
$class_parents = array_merge($class_parents, class_parents($var_MTextClass));
}
unset($class_parents['MultimediaText']);
return $class_parents;
}
public static function getForLoadLevel($param_ForClass, $param_BasisElementName, $param_LoadLevel) {
if($param_ForClass === 'BasisElement') {
$var_Array = &TreeCONFIG::$MultimediaTextPreferencs;
} else if( $param_ForClass ==='BasisClipboard') {
$var_Array = &TreeCONFIG::$BasisClipboardPreferencs;
} else {
return false;
}
if(array_key_exists($param_BasisElementName,$var_Array)
&& array_key_exists('LoadLevel', $var_Array[$param_BasisElementName])
&& array_key_exists($param_LoadLevel, $var_Array[$param_BasisElementName]['LoadLevel'])
) {
return $var_Array[$param_BasisElementName]['LoadLevel'][$param_LoadLevel];
} else {
$class_parents = array_values(class_parents($param_BasisElementName));
foreach($class_parents as $parent_class) {
if(array_key_exists($parent_class,$var_Array)
&& array_key_exists('LoadLevel', $var_Array[$parent_class])
&& array_key_exists($param_LoadLevel, $var_Array[$parent_class]['LoadLevel'])
) {
return $var_Array[$parent_class]['LoadLevel'][$param_LoadLevel];
}
}
}
}
// public static function getForBELoadLevel($param_BasisElementName, $param_LoadLevel) {
// if(array_key_exists($param_BasisElementName,TreeCONFIG::$MultimediaTextPreferencs)
// && array_key_exists('LoadLevel', TreeCONFIG::$MultimediaTextPreferencs[$param_BasisElementName])
// && array_key_exists($param_LoadLevel, TreeCONFIG::$MultimediaTextPreferencs[$param_BasisElementName]['LoadLevel'])
// ) {
// return TreeCONFIG::$MultimediaTextPreferencs[$param_BasisElementName]['LoadLevel'][$param_LoadLevel];
// } else {
// $class_parents = array_values(class_parents($param_BasisElementName));
// foreach($class_parents as $parent_class) {
// if(array_key_exists($parent_class,TreeCONFIG::$MultimediaTextPreferencs)
// && array_key_exists('LoadLevel', TreeCONFIG::$MultimediaTextPreferencs[$parent_class])
// && array_key_exists($param_LoadLevel, TreeCONFIG::$MultimediaTextPreferencs[$parent_class]['LoadLevel'])
// ) {
// return TreeCONFIG::$MultimediaTextPreferencs[$parent_class]['LoadLevel'][$param_LoadLevel];
// }
// }
// }
// }
/**
* if $param_BasisClipboardName
* - function returns the Alias_BC from TreeConfig, if it is defined under under the MultimediaTextname
* - if an alias doesn't exist, it returns the param
* if $param_BasisClipboardName = false (default)
* - the AliasBC Array for MutimediaTextname from TreeConfig is returned
*
* @param $param_MultimediaTextname
* @param $param_BasisClipboardName
*
* @return String or Array
*/
public static function getAlias_BC($param_MultimediaTextname=false, $param_BasisClipboardName=false){
if(array_key_exists($param_MultimediaTextname, TreeCONFIG::$MultimediaTextPreferencs) && is_array(TreeCONFIG::$MultimediaTextPreferencs[$param_MultimediaTextname])
&& array_key_exists('Config', TreeCONFIG::$MultimediaTextPreferencs[$param_MultimediaTextname]) && is_array(TreeCONFIG::$MultimediaTextPreferencs[$param_MultimediaTextname]['Config'])
&& array_key_exists('Alias_BC', TreeCONFIG::$MultimediaTextPreferencs[$param_MultimediaTextname]['Config']) && is_array(TreeCONFIG::$MultimediaTextPreferencs[$param_MultimediaTextname]['Config']['Alias_BC'])
){
if(!$param_BasisClipboardName){
return TreeCONFIG::$MultimediaTextPreferencs[$param_MultimediaTextname]['Config']['Alias_BC'];
}
else if (array_key_exists($param_BasisClipboardName, TreeCONFIG::$MultimediaTextPreferencs[$param_MultimediaTextname]['Config']['Alias_BC'])){
return TreeCONFIG::$MultimediaTextPreferencs[$param_MultimediaTextname]['Config']['Alias_BC'][$param_BasisClipboardName];
}
else{
return $param_BasisClipboardName;
}
}
else{
return $param_BasisClipboardName;
}
}
/**
* return MultimediaText Preferencs from class param_MultimediaTextname,
* optional direct Array Element param_ask
*/
public static function getMultimediaTextPreferencs( $param_MultimediaTextname=false, $param_ask=false) {
if($param_MultimediaTextname != trim($param_MultimediaTextname)) {
D::h1('was soll das');
}
// if($param_MultimediaTextname = trim($param_MultimediaTextname) && is_subclass_of($param_MultimediaTextname, 'BasisElement')) {
if($param_MultimediaTextname = trim($param_MultimediaTextname) ) {
// if(class_exists($param_MultimediaTextname) && is_subclass_of($param_MultimediaTextname, 'BasisElement')) {
if(array_key_exists($param_MultimediaTextname, TreeCONFIG::$MultimediaTextPreferencs) && is_array(TreeCONFIG::$MultimediaTextPreferencs[$param_MultimediaTextname])) {
if($param_ask) {
$param_ask = trim($param_ask);
if(array_key_exists($param_ask, TreeCONFIG::$MultimediaTextPreferencs[$param_MultimediaTextname])) {
return TreeCONFIG::$MultimediaTextPreferencs[$param_MultimediaTextname][$param_ask];
}
} else {
return TreeCONFIG::$MultimediaTextPreferencs[$param_MultimediaTextname];
}
}
// else {
// $class_parents = array_values(class_parents($param_MultimediaTextname));
// foreach ($class_parents as $var_classname) {
// if(is_array(TreeCONFIG::$MultimediaTextPreferencs[$var_classname])) {
// if($param_ask) {
// $param_ask = trim($param_ask);
// if(array_key_exists($param_ask, TreeCONFIG::$MultimediaTextPreferencs[$var_classname])) {
// return TreeCONFIG::$MultimediaTextPreferencs[$var_classname][$param_ask];
// }
// } else {
// return TreeCONFIG::$MultimediaTextPreferencs[$var_classname];
// }
// }
// }
// }
return false;
} else {
// D::h1('sollte eigentlich raus können!!!!!s');
return TreeCONFIG::$MultimediaTextPreferencs;
}
}
public static function generateSocialNetworkTree(Account &$param_HostAccount, iStorable &$param_iStorable) {
self::$SocialNetworkTree = array (
'HostAccount' => $param_HostAccount,
'Parts' => array(),
);
if($param_HostAccount->getActiveProfile()) {
self::$SocialNetworkTree['ActiveProfile'] = $param_HostAccount->getActiveProfile();
} else {
self::$SocialNetworkTree['ActiveProfile'] = null;
}
$var_TreePart = CONFIG::getConfig('TreePart');
foreach($var_TreePart as $var_MTextID => $var_MTextClass) {
self::$SocialNetworkTree['Parts'][] =& BasisElement::loadElement($param_HostAccount, $param_iStorable, $var_MTextClass, $var_MTextID);
}
}
public static function isInSocialNetworkTree($param_ID) {
$var_TreePart = CONFIG::getConfig('TreePart');
//D::show($var_TreePart, array_key_exists($param_ID, $var_TreePart).' ## '.$param_ID) ;
return array_key_exists($param_ID, $var_TreePart);
}
/**
* Funktion gibt die allgemeine Software BECategoryChoiceBEID zurück, ansonsten false
*/
public static function getSoftwareCategoryMTextID($param_PartOf) {
if(is_object($param_PartOf)) {
$var_PartOfID = $param_PartOf->getObjVar('ID');
} else {
return TreeCONFIG::$Config['SoftwareCategoryMTextID'];
}
if(is_array(self::$SocialNetworkTree)) {
// if((self::$SocialNetworkTree['ActiveProfile']->getObjVar('ID')==$var_PartOfID) || array_key_exists($var_PartOfID, TreeCONFIG::$Config['TreePart'])) {
if(array_key_exists($var_PartOfID, TreeCONFIG::$Config['TreePart'])) {
return TreeCONFIG::$Config['SoftwareCategoryMTextID'];
} else {
return $var_PartOfID;
}
}
}
public static function getSocialNetworkTree() {
if(is_array(self::$SocialNetworkTree)) {
return self::$SocialNetworkTree;
} else {
return false;
}
}
public static function getBasisClipboardPreferencs($param_BasisClipboardname=false, $param_ask=false) {
$param_BasisClipboardname = trim($param_BasisClipboardname);
// $var_BasisClipboardnameArray = CONFIG::transformStringToArray($param_BasisClipboardname, 'category');
// $param_BasisClipboardname = $var_BasisClipboardnameArray[0];
if($param_BasisClipboardname && array_key_exists($param_BasisClipboardname,TreeCONFIG::$BasisClipboardPreferencs ) && is_array(TreeCONFIG::$BasisClipboardPreferencs[$param_BasisClipboardname])) {
if($param_ask) {
$param_ask = trim($param_ask);
if(array_key_exists($param_ask, TreeCONFIG::$BasisClipboardPreferencs[$param_BasisClipboardname])) {
return TreeCONFIG::$BasisClipboardPreferencs[$param_BasisClipboardname][$param_ask];
} else {
return false;
}
} else {
return TreeCONFIG::$BasisClipboardPreferencs[$param_BasisClipboardname];
}
} else if($param_BasisClipboardname===false) {
return TreeCONFIG::$BasisClipboardPreferencs;
} else {
$var_BasisClipboardnameArray = CONFIG::transformStringToArray($param_BasisClipboardname, 'category');
$param_BasisClipboardname = $var_BasisClipboardnameArray[0];
if($param_BasisClipboardname && array_key_exists($param_BasisClipboardname,TreeCONFIG::$BasisClipboardPreferencs ) && is_array(TreeCONFIG::$BasisClipboardPreferencs[$param_BasisClipboardname])) {
if($param_ask) {
$param_ask = trim($param_ask);
if(array_key_exists($param_ask, TreeCONFIG::$BasisClipboardPreferencs[$param_BasisClipboardname])) {
return TreeCONFIG::$BasisClipboardPreferencs[$param_BasisClipboardname][$param_ask];
} else {
return false;
}
} else {
return TreeCONFIG::$BasisClipboardPreferencs[$param_BasisClipboardname];
}
}
}
return false;
}
public static function getAddonPreferencs($param_AddonClassname, $param_ask=false) {
if(array_key_exists($param_AddonClassname, TreeCONFIG::$AddonPreferencs)) {
if($param_ask && array_key_exists($param_ask, TreeCONFIG::$AddonPreferencs[$param_AddonClassname])) {
return TreeCONFIG::$AddonPreferencs[$param_AddonClassname][$param_ask];
} else {
return TreeCONFIG::$AddonPreferencs[$param_AddonClassname];
}
}
}
public static $getBC_XML_Counter=0;
public static function getBC_XML( $param_class, $param_ask=null) {
// D::li("public static function getBC_XML($param_class, $param_ask=null) {");
self::$getBC_XML_Counter++;
$param_class = trim($param_class);
if(array_key_exists($param_class, TreeCONFIG::$MultimediaTextPreferencs)
&& array_key_exists('XML', TreeCONFIG::$MultimediaTextPreferencs[$param_class])) {
if($param_ask) {
return TreeCONFIG::$MultimediaTextPreferencs[$param_class]['XML'][$param_ask];
} else {
return TreeCONFIG::$MultimediaTextPreferencs[$param_class]['XML'];
}
} else {
// D::backtrace();
$class_parents = array_values(class_parents( $param_class));
foreach ($class_parents as $var_classname) {
if(array_key_exists($var_classname, TreeCONFIG::$MultimediaTextPreferencs)
&& array_key_exists('XML', TreeCONFIG::$MultimediaTextPreferencs[$var_classname])) {
if($param_ask) {
return TreeCONFIG::$MultimediaTextPreferencs[$var_classname]['XML'][$param_ask];
} else {
return TreeCONFIG::$MultimediaTextPreferencs[$var_classname]['XML'];
}
}
}
}
}
public static function getBC_WithoutDB($param_BCClassname) {
if(array_key_exists($param_BCClassname, TreeCONFIG::$BasisClipboardPreferencs) && array_key_exists('without_db', TreeCONFIG::$BasisClipboardPreferencs[$param_BCClassname])) {
return TreeCONFIG::$BasisClipboardPreferencs[$param_BCClassname]['without_db'];
} else {
return false;
}
}
/**
* check if param_link is from a configured BasisClipboard in CONFIG
*
* @param string param_link
* @retrun bool
*/
public static function isLinkConfigBC($param_link) {
if(array_key_exists($param_link, TreeCONFIG::$BasisClipboardPreferencs)) {
return true;
}
$var_nextBasisClipboardNameArray = CONFIG::transformStringToArray($param_link, 'category');
if(array_key_exists($var_nextBasisClipboardNameArray[0], TreeCONFIG::$BasisClipboardPreferencs)) {
return true;
} else {
return false;
}
}
/**
* @todo: diese funktion sollte rauskönnen!!!
*/
public static function getLinkForBC($param_BCClassname) {
return $param_BCClassname;
}
public static function getConfigServices($param_BCClassname=null) {
if($param_BCClassname) {
if(array_key_exists($param_BCClassname, TreeCONFIG::$BasisClipboardPreferencs) && array_key_exists('Services',TreeCONFIG::$BasisClipboardPreferencs[$param_BCClassname])) {
return TreeCONFIG::$BasisClipboardPreferencs[$param_BCClassname]['Services'];
}
$var_BasisClipboardnameArray = CONFIG::transformStringToArray($param_BCClassname, 'category');
if(array_key_exists($var_BasisClipboardnameArray[0], TreeCONFIG::$BasisClipboardPreferencs) && array_key_exists('Services', TreeCONFIG::$BasisClipboardPreferencs[$var_BasisClipboardnameArray[0]])) {
return TreeCONFIG::$BasisClipboardPreferencs[$var_BasisClipboardnameArray[0]]['Services'];
} else {
return false;
}
} else {
return TreeCONFIG::$Config['Services'];
}
}
public static function getConfigHost() {
// return TreeCONFIG::$Config['host'];
global $_LOSP_SERVERNAME;
return $_LOSP_SERVERNAME;
}
public static function getBC_MultimediaText($param_BCClassname) {
//D::li("getBC_MultimediaText($param_BCClassname)");
if($param_BCClassname && array_key_exists($param_BCClassname,TreeCONFIG::$BasisClipboardPreferencs ) && array_key_exists('MultimediaText', TreeCONFIG::$BasisClipboardPreferencs[$param_BCClassname])) {
// D::ulli($param_BCClassname.' if ... return '.TreeCONFIG::$BasisClipboardPreferencs[$param_BCClassname]['MultimediaText']);
return TreeCONFIG::$BasisClipboardPreferencs[$param_BCClassname]['MultimediaText'];
} else {
$var_BasisClipboardnameArray = CONFIG::transformStringToArray($param_BCClassname, 'category');
if($var_BasisClipboardnameArray[0] && array_key_exists($var_BasisClipboardnameArray[0],TreeCONFIG::$BasisClipboardPreferencs ) && array_key_exists('MultimediaText', TreeCONFIG::$BasisClipboardPreferencs[$var_BasisClipboardnameArray[0]])) {
// D::ulli($param_BCClassname.' else if ... return '.TreeCONFIG::$BasisClipboardPreferencs[$var_BasisClipboardnameArray[0]]['MultimediaText']);
return TreeCONFIG::$BasisClipboardPreferencs[$var_BasisClipboardnameArray[0]]['MultimediaText'];
} else {
// D::li($param_BCClassname.' else else ... return false');
return false;
}
}
}
/**
* return an array with the names of the BasisClipboard from param_classname
* @param string param_classname
*/
public static function getMT_BasisClipboards($param_classname, $param_ask='BasisClipboards') {
$var_array = array();
$class_parents = array_values(class_parents( $param_classname));
$i_count = count($class_parents);
for($i=0; $i<$i_count; $i++) {
if($class_parents[$i] != 'BasisElement'
&& array_key_exists($class_parents[$i], TreeCONFIG::$MultimediaTextPreferencs)
&& array_key_exists($param_ask, TreeCONFIG::$MultimediaTextPreferencs[$class_parents[$i]])
&& $var_extendsArray = TreeCONFIG::$MultimediaTextPreferencs[$class_parents[$i]][$param_ask]) {
// if($class_parents[$i] != 'BasisElement' && $var_extendsArray = TreeCONFIG::$MultimediaTextPreferencs[$class_parents[$i]][$param_ask]) {
$var_array = array_merge( $var_array, $var_extendsArray);
}
}
if(array_key_exists($param_classname, TreeCONFIG::$MultimediaTextPreferencs) && array_key_exists($param_ask, TreeCONFIG::$MultimediaTextPreferencs[$param_classname])) {
$var_array = array_merge( $var_array, TreeCONFIG::$MultimediaTextPreferencs[$param_classname][$param_ask]);
return $var_array;
} else if(!empty($var_array)) {
return $var_array;
} else {
return FALSE;
}
}
public static $count_getSQL_Data = 0;
/**
* return the SQL Data for the object
* @param obj param_obj
* @param string param_ask (default false)
*/
public static function getSQL_Data($param_obj, $param_ask=false) {
self::$count_getSQL_Data++;
if(class_exists($param_obj)) {
if(array_key_exists($param_obj, TreeCONFIG::$MultimediaTextPreferencs) && array_key_exists('MySql', TreeCONFIG::$MultimediaTextPreferencs[$param_obj])) {
if($param_ask) {
if(array_key_exists($param_ask, TreeCONFIG::$MultimediaTextPreferencs[$param_obj]['MySql'])) {
return TreeCONFIG::$MultimediaTextPreferencs[$param_obj]['MySql'][$param_ask];
} else {
return false;
}
} else {
return TreeCONFIG::$MultimediaTextPreferencs[$param_obj]['MySql'];
}
} else {
$class_parents = array_values(class_parents($param_obj));
foreach( $class_parents as $var_classname ) {
if(array_key_exists($var_classname, TreeCONFIG::$MultimediaTextPreferencs) && array_key_exists('MySql', TreeCONFIG::$MultimediaTextPreferencs[$var_classname])) {
if($param_ask) {
if(array_key_exists($param_ask, TreeCONFIG::$MultimediaTextPreferencs[$var_classname]['MySql'])) {
return TreeCONFIG::$MultimediaTextPreferencs[$var_classname]['MySql'][$param_ask];
} else {
return false;
}
} else {
return TreeCONFIG::$MultimediaTextPreferencs[$var_classname]['MySql'];
}
}
}
return FALSE;
}
} else {
return false;
}
}
public static function getXMLTag($param_CONST_NAME, $param_key = false) {
if($param_key)
return TreeCONFIG::$XMLTags[$param_CONST_NAME][$param_key];
else
return TreeCONFIG::$XMLTags[$param_CONST_NAME];
}
/**
* returns the Limit
*/
public static function getDisplayLimits($param_CONST_NAME) {
if(array_key_exists($param_CONST_NAME, TreeCONFIG::$DisplayLimits)) {
return TreeCONFIG::$DisplayLimits[$param_CONST_NAME];
} else {
return false;
}
}
public static function getSettings($param_CONST_NAME) {
return TreeCONFIG::$Settings[$param_CONST_NAME];
}
public static function getConfigRightManagement($param_beName) {
$returnArray = TreeCONFIG::$Config['RightManagement'];
if(array_key_exists('RightManagementBC', $returnArray )){
if(array_key_exists($param_beName, TreeCONFIG::$MultimediaTextPreferencs)) {
if(array_key_exists('BasisClipboards',TreeCONFIG::$MultimediaTextPreferencs[$param_beName])){
foreach(TreeCONFIG::$MultimediaTextPreferencs[$param_beName]['BasisClipboards'] as $bcName => $value){
if(is_array($value)){
if(array_key_exists('Possible_BCWriteRight',$value)){
$returnArray['RightManagementBC'][$bcName]['WriteKeys'] = $value['Possible_BCWriteRight'];
}
if(array_key_exists('Possible_BCReadRight',$value)){
$returnArray['RightManagementBC'][$bcName]['ReadKeys'] = $value['Possible_BCReadRight'];
}
}
}
}
}
}
return $returnArray;
}
public static function getConfig($param_ask=false) {
if($param_ask ) {
if(array_key_exists($param_ask, TreeCONFIG::$Config)) {
return TreeCONFIG::$Config[$param_ask];
} else {
return null;
}
} else {
return TreeCONFIG::$Config;
}
}
public static function getDelimiter($param_ask) {
return TreeCONFIG::$Delimiter[$param_ask];
}
public static $count_transformStringToArray=0;
public static function transformStringToArray($param_String, $param_Delimiter='category') {
self::$count_transformStringToArray++;
// return explode(TreeCONFIG::$Delimiter[$param_Delimiter], $param_String);
return array_map("trim", explode(TreeCONFIG::$Delimiter[$param_Delimiter], $param_String));
}
public static function transformArrayToString($param_Array, $param_Delimiter='category') {
return implode ( TreeCONFIG::$Delimiter[$param_Delimiter], $param_Array );
}
public static function getHistory() {
return TreeCONFIG::$History;
}
public static function getLoadLevelOrderByDefault($param_BEname, $param_BCname, $param_LoadLevel) {
if($param_LoadLevel == '') {
$param_LoadLevel = 'ForShowSingle';
}
if( array_key_exists($param_BEname, TreeCONFIG::$MultimediaTextPreferencs)
&& array_key_exists('BasisClipboards', TreeCONFIG::$MultimediaTextPreferencs[$param_BEname])
&& array_key_exists($param_BCname, TreeCONFIG::$MultimediaTextPreferencs[$param_BEname]['BasisClipboards'])
&& is_array(TreeCONFIG::$MultimediaTextPreferencs[$param_BEname]['BasisClipboards'][$param_BCname]) && array_key_exists('OrderByDefault', TreeCONFIG::$MultimediaTextPreferencs[$param_BEname]['BasisClipboards'][$param_BCname])
&& array_key_exists($param_LoadLevel, TreeCONFIG::$MultimediaTextPreferencs[$param_BEname]['BasisClipboards'][$param_BCname]['OrderByDefault'])
) {
return (TreeCONFIG::$MultimediaTextPreferencs[$param_BEname]['BasisClipboards'][$param_BCname]['OrderByDefault'][$param_LoadLevel]);
} else {
return false;
}
}
public static function is_BCshowCondition($param_BCname) {
return array_key_exists($param_BCname, TreeConfig::$BC_showConditions);
}
public static function get_Condition($param_BasisClipboardname, $param_ask = false){
if(array_key_exists($param_BasisClipboardname,TreeCONFIG::$BasisClipboardPreferencs) && array_key_exists('ConditionArray',TreeCONFIG::$BasisClipboardPreferencs[$param_BasisClipboardname])){
if(!$param_ask){
return TreeCONFIG::$BasisClipboardPreferencs[$param_BasisClipboardname]['ConditionArray'];
}
else if(array_key_exists($param_ask,TreeCONFIG::$BasisClipboardPreferencs[$param_BasisClipboardname]['ConditionArray'])){
return TreeCONFIG::$BasisClipboardPreferencs[$param_BasisClipboardname]['ConditionArray'][$param_ask];
}
}
return false;
}
/**
* überprüft ob es den ListCondition aufruf in der TreeConfig gibt (gecheckt wird funktionsname und Column)
*/
public static function is_ListConditionColumn($param_conditions, $param_BasisClipboardname){
foreach($param_conditions as $key => $valueCD){
$array_help = array(0 => 1);
$tmp_options = explode('-',$key);
foreach(TreeCONFIG::$BasisClipboardPreferencs[$param_BasisClipboardname]['Menu']['ListCondition'] as $valueBC){
foreach($valueBC[$tmp_options[0]] as $key => $value){
if(array_key_exists($tmp_options[1],$value)){
$array_help=array_merge($array_help,$value[$tmp_options[1]]['Column']);
}
}
}
$array_help=array_unique($array_help);
foreach($valueCD[0]['Column'] as $valueCol){
if(!in_array($valueCol,$array_help)){
return false;
}
}
}
return true;
}
}
?>