2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 07/08/2011 *
4 * =================== Last change: 07/08/2011 *
6 * -------------------------------------------------------------------- *
7 * File : callback-functions.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Call-back functions for XML templates *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Call-Back-Funktionen fuer XML-Templates *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * -------------------------------------------------------------------- *
18 * Copyright (c) 2003 - 2009 by Roland Haeder *
19 * Copyright (c) 2009 - 2012 by Mailer Developer Team *
20 * For more information visit: http://mxchange.org *
22 * This program is free software; you can redistribute it and/or modify *
23 * it under the terms of the GNU General Public License as published by *
24 * the Free Software Foundation; either version 2 of the License, or *
25 * (at your option) any later version. *
27 * This program is distributed in the hope that it will be useful, *
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
30 * GNU General Public License for more details. *
32 * You should have received a copy of the GNU General Public License *
33 * along with this program; if not, write to the Free Software *
34 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
36 ************************************************************************/
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
43 // Handles the XML node 'admin-entry-meta-data'
44 function doXmlAdminEntryMetaData ($resource, $attributes) {
45 // There should be no attributes
46 if (count($attributes) > 0) {
47 // Please don't add any attributes to foo-list nodes
48 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes, got ' . count($attributes));
52 // Handles the XML node 'member-entry-meta-data'
53 function doXmlMemberEntryMetaData ($resource, $attributes) {
54 // There should be no attributes
55 if (count($attributes) > 0) {
56 // Please don't add any attributes to foo-list nodes
57 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes, got ' . count($attributes));
61 // Handles the XML node 'callback-function'
62 function doXmlCallbackFunction ($resource, $attributes) {
63 // There are two attributes, by default
64 if (count($attributes) != 2) {
65 // Not the right count
66 reportBug(__FUNCTION__, __LINE__, 'Expected 2 attributes, got ' . count($attributes));
67 } elseif (!isset($attributes['TYPE'])) {
69 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
70 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
72 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
73 } elseif (!isset($attributes['VALUE'])) {
75 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
76 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
77 // Not valid/verifyable
78 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
81 // Add the function name and no attributes by default
82 $GLOBALS['__XML_CALLBACKS']['callbacks'][] = __FUNCTION__;
83 $GLOBALS['__XML_CALLBACKS']['functions'][__FUNCTION__][] = $attributes['VALUE'];
84 $GLOBALS['__XML_ARGUMENTS'][__FUNCTION__] = array();
85 $GLOBALS['__COLUMN_INDEX'][__FUNCTION__] = 'column';
88 // Handles the XML node 'database-table'
89 function doXmlDatabaseTable ($resource, $attributes) {
90 // There are three attributes, by default
91 if (count($attributes) != 3) {
92 // Not the right count
93 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
94 } elseif (!isset($attributes['NAME'])) {
96 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
97 } elseif (!isset($attributes['TYPE'])) {
99 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
100 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
102 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
103 } elseif (!isset($attributes['VALUE'])) {
105 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
106 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
107 // Not valid/verifyable
108 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
109 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
110 // doXmlCallbackFunction is missing
111 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
114 // Add the entry to the list
115 addXmlValueToCallbackAttributes('database_table', $attributes);
118 // Handles the XML node 'database-column-list'
119 function doXmlDatabaseColumnList ($resource, $attributes) {
120 // There should be no attributes
121 if (count($attributes) > 0) {
122 // Please don't add any attributes to foo-list nodes
123 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
127 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_list'] = array();
130 // Handles the XML node 'database-column-list-entry'
131 function doXmlDatabaseColumnListEntry ($resource, $attributes) {
132 // There are three attributes, by default
133 if (count($attributes) != 6) {
134 // Not the right count
135 reportBug(__FUNCTION__, __LINE__, 'Expected 6 attributes, got ' . count($attributes));
136 } elseif (!isset($attributes['NAME'])) {
138 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
139 } elseif (!isset($attributes['TYPE'])) {
141 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
142 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
144 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
145 } elseif (!isset($attributes['TABLE'])) {
147 reportBug(__FUNCTION__, __LINE__, 'Required attribute TABLE not found.');
148 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['TABLE'])) {
149 // Not valid/verifyable
150 reportBug(__FUNCTION__, __LINE__, 'Attribute TABLE does not validate. TYPE=' . $attributes['TYPE'] . ',TABLE=' . $attributes['TABLE']);
151 } elseif (!isset($attributes['ALIAS'])) {
153 reportBug(__FUNCTION__, __LINE__, 'Required attribute ALIAS not found.');
154 } elseif (!isset($attributes['FUNCTION'])) {
155 // 'FUNCTION' not found
156 reportBug(__FUNCTION__, __LINE__, 'Required attribute FUNCTION not found.');
157 } elseif ((trim($attributes['ALIAS']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['ALIAS']))) {
158 // 'ALIAS' not valid/verifyable
159 reportBug(__FUNCTION__, __LINE__, 'Attribute ALIAS does not validate. ALIAS=' . $attributes['ALIAS']);
160 } elseif ((trim($attributes['FUNCTION']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['FUNCTION']))) {
161 // 'FUNCTION' not valid/verifyable
162 reportBug(__FUNCTION__, __LINE__, 'Attribute FUNCTION does not validate. FUNCTION=' . $attributes['FUNCTION']);
163 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_list'])) {
164 // doXmlCallbackFunction is missing
165 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/database-column-list not included around this node. Please fix your XML.');
168 // Add the entry to the list
169 addXmlValueToCallbackAttributes('column_list', $attributes);
172 // Handles the XML node 'callback-function-list'
173 function doXmlCallbackFunctionList ($resource, $attributes) {
174 // There should be no attributes
175 if (count($attributes) > 0) {
176 // Please don't add any attributes to foo-list nodes
177 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
181 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['callback_list'] = array();
184 // Handles the XML node 'callback-function-list-entry'
185 function doXmlCallbackFunctionListEntry ($resource, $attributes) {
186 // There are three attributes, by default
187 if (count($attributes) != 3) {
188 // Not the right count
189 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
190 } elseif (!isset($attributes['NAME'])) {
192 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
193 } elseif (!isset($attributes['TYPE'])) {
195 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
196 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
198 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
199 } elseif (!isset($attributes['VALUE'])) {
201 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
202 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
203 // Not valid/verifyable
204 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
205 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['callback_list'])) {
206 // doXmlCallbackFunction is missing
207 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/callback-function-list not included around this node. Please fix your XML.');
210 // Add the entry to the list
211 addXmlValueToCallbackAttributes('callback_list', $attributes);
214 // Handles the XML node 'extra-parameter-list'
215 function doXmlExtraParameterList ($resource, $attributes) {
216 // There should be no attributes
217 if (count($attributes) > 0) {
218 // Please don't add any attributes to foo-list nodes
219 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
223 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list'] = array();
226 // Handles the XML node 'extra-parameter-list-entry'
227 function doXmlExtraParameterListEntry ($resource, $attributes) {
228 // There are three attributes, by default
229 if (count($attributes) != 3) {
230 // Not the right count
231 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
232 } elseif (!isset($attributes['NAME'])) {
234 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
235 } elseif (!isset($attributes['TYPE'])) {
237 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
238 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
240 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
241 } elseif (!isset($attributes['VALUE'])) {
243 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
244 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
245 // Not valid/verifyable
246 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
247 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list'])) {
248 // doXmlCallbackFunction is missing
249 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list not included around this node. Please fix your XML.');
252 // Add the entry to the list
253 addXmlValueToCallbackAttributes('extra_list', $attributes);
256 // Handles the XML node 'time-columns-list'
257 function doXmlTimeColumnsList ($resource, $attributes) {
258 // There should be no attributes
259 if (count($attributes) > 0) {
260 // Please don't add any attributes to foo-list nodes
261 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
265 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['time_columns'] = array();
268 // Handles the XML node 'time-columns-list-entry'
269 function doXmlTimeColumnsListEntry ($resource, $attributes) {
270 // There are three attributes, by default
271 if (count($attributes) != 3) {
272 // Not the right count
273 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
274 } elseif (!isset($attributes['NAME'])) {
276 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
277 } elseif (!isset($attributes['TYPE'])) {
279 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
280 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
282 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
283 } elseif (!isset($attributes['VALUE'])) {
285 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
286 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
287 // Not valid/verifyable
288 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
289 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['time_columns'])) {
290 // doXmlCallbackFunction is missing
291 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list not included around this node. Please fix your XML.');
294 // Add the entry to the list
295 addXmlValueToCallbackAttributes('time_columns', $attributes);
298 // Handles the XML node 'extra-parameter-member-list'
299 function doXmlExtraParameterMemberList ($resource, $attributes) {
300 // There should be no attributes
301 if (count($attributes) > 0) {
302 // Please don't add any attributes to foo-list nodes
303 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
304 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['member_list'])) {
305 // This list should be created already
306 reportBug(__FUNCTION__, __LINE__, 'member_list should be already created.');
310 // Handles the XML node 'extra-parameter-reload-list'
311 function doXmlExtraParameterReloadList ($resource, $attributes) {
312 // There should be no attributes
313 if (count($attributes) > 0) {
314 // Please don't add any attributes to foo-list nodes
315 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
316 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['reload_list'])) {
317 // This list should be created already
318 reportBug(__FUNCTION__, __LINE__, 'reload_list should be already created.');
322 // Handles the XML node 'extra-parameter-waiting-list'
323 function doXmlExtraParameterWaitingList ($resource, $attributes) {
324 // There should be no attributes
325 if (count($attributes) > 0) {
326 // Please don't add any attributes to foo-list nodes
327 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
328 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['waiting_list'])) {
329 // This list should be created already
330 reportBug(__FUNCTION__, __LINE__, 'waiting_list should be already created.');
334 // Handles the XML node 'extra-parameter-member-list-entry'
335 function doXmlExtraParameterMemberListEntry ($resource, $attributes) {
336 // There are three attributes, by default
337 if (count($attributes) != 3) {
338 // Not the right count
339 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
340 } elseif (!isset($attributes['NAME'])) {
342 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
343 } elseif (!isset($attributes['TYPE'])) {
345 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
346 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
348 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
349 } elseif (!isset($attributes['VALUE'])) {
351 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
352 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
353 // Not valid/verifyable
354 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
355 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['member_list'])) {
356 // doXmlCallbackFunction is missing
357 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list/member-list not included around this node. Please fix your XML.');
360 // Add the entry to the list
361 addXmlValueToCallbackAttributes('extra_list', $attributes, 'member_list');
364 // Handles the XML node 'extra-parameter-reload-list-entry'
365 function doXmlExtraParameterReloadListEntry ($resource, $attributes) {
366 // There are three attributes, by default
367 if (count($attributes) != 3) {
368 // Not the right count
369 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
370 } elseif (!isset($attributes['NAME'])) {
372 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
373 } elseif (!isset($attributes['TYPE'])) {
375 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
376 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
378 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
379 } elseif (!isset($attributes['VALUE'])) {
381 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
382 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
383 // Not valid/verifyable
384 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
385 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['reload_list'])) {
386 // doXmlCallbackFunction is missing
387 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list/reload-list not included around this node. Please fix your XML.');
390 // Add the entry to the list
391 addXmlValueToCallbackAttributes('extra_list', $attributes, 'reload_list');
394 // Handles the XML node 'extra-parameter-waiting-list-entry'
395 function doXmlExtraParameterWaitingListEntry ($resource, $attributes) {
396 // There are three attributes, by default
397 if (count($attributes) != 3) {
398 // Not the right count
399 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
400 } elseif (!isset($attributes['NAME'])) {
402 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
403 } elseif (!isset($attributes['TYPE'])) {
405 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
406 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
408 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
409 } elseif (!isset($attributes['VALUE'])) {
411 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
412 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
413 // Not valid/verifyable
414 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
415 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['waiting_list'])) {
416 // doXmlCallbackFunction is missing
417 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list/waiting-list not included around this node. Please fix your XML.');
420 // Add the entry to the list
421 addXmlValueToCallbackAttributes('extra_list', $attributes, 'waiting_list');
424 // Handles the XML node 'extra-parameter-added-list'
425 function doXmlExtraParameterAddedList ($resource, $attributes) {
426 // There should be no attributes
427 if (count($attributes) > 0) {
428 // Please don't add any attributes to foo-list nodes
429 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
430 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['added_list'])) {
431 // This list should be created already
432 reportBug(__FUNCTION__, __LINE__, 'added_list should be already created.');
436 // Handles the XML node 'extra-parameter-added-list-entry'
437 function doXmlExtraParameterAddedListEntry ($resource, $attributes) {
438 // There are three attributes, by default
439 if (count($attributes) != 3) {
440 // Not the right count
441 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
442 } elseif (!isset($attributes['NAME'])) {
444 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
445 } elseif (!isset($attributes['TYPE'])) {
447 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
448 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
450 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
451 } elseif (!isset($attributes['VALUE'])) {
453 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
454 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
455 // Not valid/verifyable
456 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
457 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['added_list'])) {
458 // doXmlCallbackFunction is missing
459 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list/added-list not included around this node. Please fix your XML.');
462 // Add the entry to the list
463 addXmlValueToCallbackAttributes('extra_list', $attributes, 'added_list');
466 // Handles the XML node 'extra-parameter-created-list'
467 function doXmlExtraParameterCreatedList ($resource, $attributes) {
468 // There should be no attributes
469 if (count($attributes) > 0) {
470 // Please don't add any attributes to foo-list nodes
471 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
472 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['created_list'])) {
473 // This list should be created already
474 reportBug(__FUNCTION__, __LINE__, 'created_list should be already created.');
478 // Handles the XML node 'extra-parameter-created-list-entry'
479 function doXmlExtraParameterCreatedListEntry ($resource, $attributes) {
480 // There are three attributes, by default
481 if (count($attributes) != 3) {
482 // Not the right count
483 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
484 } elseif (!isset($attributes['NAME'])) {
486 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
487 } elseif (!isset($attributes['TYPE'])) {
489 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
490 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
492 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
493 } elseif (!isset($attributes['VALUE'])) {
495 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
496 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
497 // Not valid/verifyable
498 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
499 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['created_list'])) {
500 // doXmlCallbackFunction is missing
501 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list/created-list not included around this node. Please fix your XML.');
504 // Add the entry to the list
505 addXmlValueToCallbackAttributes('extra_list', $attributes, 'created_list');
508 // Handles the XML node 'status-change-column'
509 function doXmlStatusChangeColumn ($resource, $attributes) {
510 // There are three attributes, by default
511 if (count($attributes) != 3) {
512 // Not the right count
513 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
514 } elseif (!isset($attributes['NAME'])) {
516 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
517 } elseif (!isset($attributes['TYPE'])) {
519 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
520 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
522 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
523 } elseif (!isset($attributes['VALUE'])) {
525 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
526 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
527 // Not valid/verifyable
528 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
529 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
530 // doXmlCallbackFunction is missing
531 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
534 // Add the entry to the list
535 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['status_list'][$attributes['VALUE']] = array();
538 // Handles the XML node 'status-change-list'
539 function doXmlStatusChangeList ($resource, $attributes) {
540 // There should be no attributes
541 if (count($attributes) > 0) {
542 // Please don't add any attributes to foo-list nodes
543 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
544 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
545 // doXmlCallbackFunction is missing
546 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
549 // Add the entry to the list
550 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['status_list'] = array();
553 // Handles the XML node 'status-change-list-entry'
554 function doXmlStatusChangeListEntry ($resource, $attributes) {
555 // There are for attributes, by default
556 if (count($attributes) != 4) {
557 // Not the right count
558 reportBug(__FUNCTION__, __LINE__, 'Expected 4 attributes, got ' . count($attributes));
559 } elseif (!isset($attributes['NAME'])) {
561 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
562 } elseif (!isset($attributes['TYPE'])) {
564 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
565 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
567 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
568 } elseif (!isset($attributes['VALUE'])) {
570 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
571 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['OLD'])) {
572 // Not valid/verifyable
573 reportBug(__FUNCTION__, __LINE__, 'Attribute OLD does not validate. TYPE=' . $attributes['TYPE'] . ',OLD=' . $attributes['OLD']);
574 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
575 // Not valid/verifyable
576 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
577 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['status_list'])) {
578 // doXmlCallbackFunction is missing
579 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list/change-list not included around this node. Please fix your XML.');
582 // Add the entry to the list
583 addXmlValueToCallbackAttributes('status_list', $attributes, $attributes['NAME'], 'OLD');
586 // Handles the XML node 'enable-modify-entries'
587 function doXmlEnableModifyEntries ($resource, $attributes) {
588 // There are three attributes, by default
589 if (count($attributes) != 3) {
590 // Not the right count
591 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
592 } elseif (!isset($attributes['NAME'])) {
594 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
595 } elseif (!isset($attributes['TYPE'])) {
597 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
598 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
600 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
601 } elseif (!isset($attributes['VALUE'])) {
603 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
604 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
605 // Not valid/verifyable
606 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
607 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
608 // doXmlCallbackFunction is missing
609 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
612 // Add the entry to the list
613 addXmlValueToCallbackAttributes('enable_modify_entries', $attributes);
616 // Handles the XML node 'table-id-column'
617 function doXmlTableIdColumn ($resource, $attributes) {
618 // There are three attributes, by default
619 if (count($attributes) != 3) {
620 // Not the right count
621 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
622 } elseif (!isset($attributes['NAME'])) {
624 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
625 } elseif (!isset($attributes['TYPE'])) {
627 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
628 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
630 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
631 } elseif (!isset($attributes['VALUE'])) {
633 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
634 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
635 // Not valid/verifyable
636 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
637 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
638 // doXmlCallbackFunction is missing
639 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
642 // Add the entry to the array
643 addXmlValueToCallbackAttributes('table_id_column', $attributes);
646 // Handles the XML node 'table-userid-column'
647 function doXmlTableUseridColumn ($resource, $attributes) {
648 // There are three attributes, by default
649 if (count($attributes) != 3) {
650 // Not the right count
651 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
652 } elseif (!isset($attributes['NAME'])) {
654 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
655 } elseif (!isset($attributes['TYPE'])) {
657 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
658 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
660 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
661 } elseif (!isset($attributes['VALUE'])) {
663 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
664 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
665 // Not valid/verifyable
666 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
667 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
668 // doXmlCallbackFunction is missing
669 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
672 // Add the entry to the array
673 addXmlValueToCallbackAttributes('table_userid_column', $attributes);
676 // Handles the XML node 'raw-userid-column-key'
677 function doXmlRawUseridColumnKey ($resource, $attributes) {
678 // There are three attributes, by default
679 if (count($attributes) != 3) {
680 // Not the right count
681 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
682 } elseif (!isset($attributes['NAME'])) {
684 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
685 } elseif (!isset($attributes['TYPE'])) {
687 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
688 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
690 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
691 } elseif (!isset($attributes['VALUE'])) {
693 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
694 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
695 // Not valid/verifyable
696 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
697 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
698 // doXmlCallbackFunction is missing
699 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
702 // Add the entry to the array
703 addXmlValueToCallbackAttributes('raw_userid_column_key', $attributes);
706 // Handles the XML node 'cache-file'
707 function doXmlCacheFile ($resource, $attributes) {
708 // There are three attributes, by default
709 if (count($attributes) != 3) {
710 // Not the right count
711 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
712 } elseif (!isset($attributes['NAME'])) {
714 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
715 } elseif (!isset($attributes['TYPE'])) {
717 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
718 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
720 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
721 } elseif (!isset($attributes['VALUE'])) {
723 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
724 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
725 // Not valid/verifyable
726 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
727 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
728 // doXmlCallbackFunction is missing
729 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
732 // Add the entry to the array
733 addXmlValueToCallbackAttributes('cache_file', $attributes);
736 //-----------------------------------------------------------------------------
737 // Call-back functions for listing of data in admin area
738 //-----------------------------------------------------------------------------
740 // Handles the XML node 'admin-list-data'
741 function doXmlAdminListData ($resource, $attributes) {
742 // There should be no attributes
743 if (count($attributes) > 0) {
744 // Please don't add any attributes to foo-list nodes
745 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes, got ' . count($attributes));
749 // Handles the XML node 'member-list-data'
750 function doXmlMemberListData ($resource, $attributes) {
751 // There should be no attributes
752 if (count($attributes) > 0) {
753 // Please don't add any attributes to foo-list nodes
754 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes, got ' . count($attributes));
758 // Handles the XML node 'data-tables'
759 function doXmlDataTables ($resource, $attributes) {
760 // There should be no attributes
761 if (count($attributes) > 0) {
762 // Please don't add any attributes to foo-list nodes
763 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes, got ' . count($attributes));
767 // Handles the XML node 'data-table'
768 function doXmlDataTable ($resource, $attributes) {
769 // There are three attributes, by default
770 if (count($attributes) != 3) {
771 // Not the right count
772 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
773 } elseif (!isset($attributes['VALUE'])) {
775 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
776 } elseif (!isset($attributes['TYPE'])) {
778 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
779 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
781 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
782 } elseif (!isset($attributes['ALIAS'])) {
784 reportBug(__FUNCTION__, __LINE__, 'Required attribute ALIAS not found.');
785 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
786 // Not valid/verifyable
787 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
788 } elseif ((trim($attributes['ALIAS']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['ALIAS']))) {
789 // Not valid/verifyable
790 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. ALIAS=' . $attributes['ALIAS']);
791 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
792 // doXmlCallbackFunction is missing
793 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
796 // Add the entry to the array
797 addXmlValueToCallbackAttributes('data_table', $attributes);
800 // Handles the XML node 'select-data-from-list'
801 function doXmlSelectDataFromList ($resource, $attributes) {
802 // There should be no attributes
803 if (count($attributes) > 0) {
804 // Please don't add any attributes to foo-list nodes
805 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
806 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'])) {
807 // doXmlCallbackFunction is missing
808 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-table not included around this node. Please fix your XML.');
812 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_column_list'] = array();
815 // Handles the XML node 'select-data-from-list-entry'
816 function doXmlSelectDataFromListEntry ($resource, $attributes) {
817 // There are five attributes, by default
818 if (count($attributes) != 5) {
819 // Not the right count
820 reportBug(__FUNCTION__, __LINE__, 'Expected 5 attributes, got ' . count($attributes));
821 } elseif (!isset($attributes['VALUE'])) {
823 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
824 } elseif (!isset($attributes['TYPE'])) {
826 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
827 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
829 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
830 } elseif (!isset($attributes['ALIAS'])) {
832 reportBug(__FUNCTION__, __LINE__, 'Required attribute ALIAS not found.');
833 } elseif (!isset($attributes['FUNCTION'])) {
834 // 'FUNCTION' not found
835 reportBug(__FUNCTION__, __LINE__, 'Required attribute FUNCTION not found.');
836 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
837 // 'VALUE' not valid/verifyable
838 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
839 } elseif ((trim($attributes['ALIAS']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['ALIAS']))) {
840 // 'ALIAS' not valid/verifyable
841 reportBug(__FUNCTION__, __LINE__, 'Attribute ALIAS does not validate. ALIAS=' . $attributes['ALIAS']);
842 } elseif ((trim($attributes['FUNCTION']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['FUNCTION']))) {
843 // 'FUNCTION' not valid/verifyable
844 reportBug(__FUNCTION__, __LINE__, 'Attribute FUNCTION does not validate. FUNCTION=' . $attributes['FUNCTION']);
845 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_column_list'])) {
846 // doXmlCallbackFunction is missing
847 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/select-data-from-list not included around this node. Please fix your XML.');
850 // Add the entry to the array
851 addXmlValueToCallbackAttributes('data_column_list', $attributes);
854 // Handles the XML node 'where-select-from-list'
855 function doXmlWhereSelectFromList ($resource, $attributes) {
856 // There should be no attributes
857 if (count($attributes) > 0) {
858 // Please don't add any attributes to foo-list nodes
859 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
860 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'])) {
861 // doXmlCallbackFunction is missing
862 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-table not included around this node. Please fix your XML.');
866 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['where_select_list'] = array();
869 // Handles the XML node 'where-select-from-list-entry'
870 function doXmlWhereSelectFromListEntry ($resource, $attributes) {
871 // There are five attributes, by default
872 if (count($attributes) != 5) {
873 // Not the right count
874 reportBug(__FUNCTION__, __LINE__, 'Expected 5 attributes, got ' . count($attributes));
875 } elseif (!isset($attributes['TYPE'])) {
877 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
878 } elseif (!isset($attributes['TABLE'])) {
880 reportBug(__FUNCTION__, __LINE__, 'Required attribute TABLE not found.');
881 } elseif (!isset($attributes['VALUE'])) {
883 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
884 } elseif (!isset($attributes['CONDITION'])) {
885 // 'CONDITION' not found
886 reportBug(__FUNCTION__, __LINE__, 'Required attribute CONDITION not found.');
887 } elseif (!isset($attributes['LOOK-FOR'])) {
888 // 'LOOK-FOR' not found
889 reportBug(__FUNCTION__, __LINE__, 'Required attribute LOOK-FOR not found.');
890 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
892 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
893 } elseif ((trim($attributes['TABLE']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['TABLE']))) {
894 // 'TABLE' not valid/verifyable
895 reportBug(__FUNCTION__, __LINE__, 'Attribute TABLE does not validate. TABLE=' . $attributes['TABLE']);
896 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
897 // 'VALUE' not valid/verifyable
898 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
899 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['CONDITION'])) {
900 // 'CONDITION' not valid/verifyable
901 reportBug(__FUNCTION__, __LINE__, 'Attribute CONDITION does not validate. CONDITION=' . $attributes['CONDITION']);
902 } elseif (!isXmlConditionValid($attributes['CONDITION'])) {
903 // 'CONDITION' is not known
904 reportBug(__FUNCTION__, __LINE__, 'Attribute CONDITION is not valid. LOOK-FOR=' . $attributes['CONDITION']);
905 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_column_list'])) {
906 // doXmlCallbackFunction is missing
907 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-column-list not included around this node. Please fix your XML.');
910 // Add the entry to the array
911 addXmlValueToCallbackAttributes('where_select_list', $attributes);
914 // Handles the XML node 'where-condition'
915 function doXmlWhereCondition ($resource, $attributes) {
916 // There are two attributes, by default
917 if (count($attributes) != 3) {
918 // Please don't add any attributes to foo-list nodes
919 reportBug(__FUNCTION__, __LINE__, 'Expected 2 attributes because this is a where-condition node, got ' . count($attributes));
920 } elseif (!isset($attributes['TYPE'])) {
922 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
923 } elseif (!isset($attributes['CONDITION'])) {
924 // 'CONDITION' not found
925 reportBug(__FUNCTION__, __LINE__, 'Required attribute CONDITION not found.');
926 } elseif (!isset($attributes['NAME'])) {
928 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
929 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'])) {
930 // doXmlCallbackFunction is missing
931 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-table not included around this node. Please fix your XML.');
935 addXmlValueToCallbackAttributes('where_condition', $attributes);
938 // Handles the XML node 'order-by-list'
939 function doXmlOrderByList ($resource, $attributes) {
940 // There should be no attributes
941 if (count($attributes) > 0) {
942 // Please don't add any attributes to foo-list nodes
943 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
944 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'])) {
945 // doXmlCallbackFunction is missing
946 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-table not included around this node. Please fix your XML.');
950 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['order_by_list'] = array();
953 // Handles the XML node 'order-by-list-entry'
954 function doXmlOrderByListEntry ($resource, $attributes) {
955 // There are four attributes, by default
956 if (count($attributes) != 4) {
957 // Not the right count
958 reportBug(__FUNCTION__, __LINE__, 'Expected 5 attributes, got ' . count($attributes));
959 } elseif (!isset($attributes['ORDER'])) {
961 reportBug(__FUNCTION__, __LINE__, 'Required attribute ORDER not found.');
962 } elseif (!isset($attributes['TYPE'])) {
964 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
965 } elseif (!isset($attributes['TABLE'])) {
967 reportBug(__FUNCTION__, __LINE__, 'Required attribute TABLE not found.');
968 } elseif (!isset($attributes['VALUE'])) {
970 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
971 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
973 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
974 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['ORDER'])) {
975 // 'ORDER' not valid/verifyable
976 reportBug(__FUNCTION__, __LINE__, 'Attribute ORDER does not validate. ORDER=' . $attributes['ORDER']);
977 } elseif ((trim($attributes['TABLE']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['TABLE']))) {
978 // 'TABLE' not valid/verifyable
979 reportBug(__FUNCTION__, __LINE__, 'Attribute TABLE does not validate. TABLE=' . $attributes['TABLE']);
980 } elseif ((trim($attributes['VALUE']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE']))) {
981 // 'VALUE' not valid/verifyable
982 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
983 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_column_list'])) {
984 // doXmlCallbackFunction is missing
985 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-column-list not included around this node. Please fix your XML.');
988 // Add the entry to the array
989 addXmlValueToCallbackAttributes('order_by_list', $attributes);
992 // Handles the XML node 'list-template'
993 function doXmlListTemplate ($resource, $attributes) {
994 // There are two attributes, by default
995 if (count($attributes) != 2) {
996 // Not the right count
997 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
998 } elseif (!isset($attributes['VALUE'])) {
1000 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
1001 } elseif (!isset($attributes['TYPE'])) {
1003 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
1004 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
1006 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
1007 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
1008 // Not valid/verifyable
1009 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
1010 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
1011 // doXmlCallbackFunction is missing
1012 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
1015 // Add the entry to the array
1016 addXmlValueToCallbackAttributes('list_template', $attributes);
1019 // Handles the XML node 'list-row-template'
1020 function doXmlListRowTemplate ($resource, $attributes) {
1021 // There are two attributes, by default
1022 if (count($attributes) != 2) {
1023 // Not the right count
1024 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
1025 } elseif (!isset($attributes['VALUE'])) {
1026 // 'VALUE' not found
1027 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
1028 } elseif (!isset($attributes['TYPE'])) {
1030 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
1031 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
1033 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
1034 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
1035 // Not valid/verifyable
1036 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
1037 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
1038 // doXmlCallbackFunction is missing
1039 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
1042 // Add the entry to the array
1043 addXmlValueToCallbackAttributes('list_row_template', $attributes);
1046 // Handles the XML node 'column-callback-list'
1047 function doXmlColumnCallbackList ($resource, $attributes) {
1048 // There should be no attributes
1049 if (count($attributes) > 0) {
1050 // Please don't add any attributes to foo-list nodes
1051 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
1052 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'])) {
1053 // doXmlCallbackFunction is missing
1054 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-table not included around this node. Please fix your XML.');
1057 // Add an empty list
1058 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_callback_list'] = array();
1061 // Handles the XML node 'column-callback-list-entry'
1062 function doXmlColumnCallbackListEntry ($resource, $attributes) {
1063 // There should be no attributes
1064 if (count($attributes) > 0) {
1065 // Please don't add any attributes to foo-list nodes
1066 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
1067 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_callback_list'])) {
1068 // doXmlCallbackFunction is missing
1069 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/column-callback not included around this node. Please fix your XML.');
1073 // Handles the XML node 'column-callback-data'
1074 function doXmlColumnCallbackData ($resource, $attributes) {
1075 // There are three attributes, by default
1076 if (count($attributes) != 3) {
1077 // Not the right count
1078 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
1079 } elseif (!isset($attributes['VALUE'])) {
1080 // 'VALUE' not found
1081 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
1082 } elseif (!isset($attributes['TYPE'])) {
1084 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
1085 } elseif (!isset($attributes['CALLBACK'])) {
1086 // 'CALLBACK' not found
1087 reportBug(__FUNCTION__, __LINE__, 'Required attribute CALLBACK not found.');
1088 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
1090 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
1091 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
1092 // Not valid/verifyable
1093 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
1094 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
1095 // doXmlCallbackFunction is missing
1096 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
1097 } elseif ((trim($attributes['CALLBACK']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['CALLBACK']))) {
1098 // 'CALLBACK' not valid/verifyable
1099 reportBug(__FUNCTION__, __LINE__, 'Attribute CALLBACK does not validate. CALLBACK=' . $attributes['CALLBACK']);
1102 // Add the entry to the array
1103 addXmlValueToCallbackAttributes('column_callback_list', $attributes);
1106 // Handles the XML node 'callback-extra-parameter-list'
1107 function doXmlCallbackExtraParameterList ($resource, $attributes) {
1108 // There should be no attributes
1109 if (count($attributes) > 0) {
1110 // Please don't add any attributes to foo-list nodes
1111 reportBug(__FUNCTION__, __LINE__, 'Expected 1 attributes because this is a named foo-list node, got ' . count($attributes));
1112 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_callback_list'])) {
1113 // doXmlCallbackFunction is missing
1114 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/column-callback-list not included around this node. Please fix your XML.');
1115 } elseif (isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['__EXTRA_PARAMETER'])) {
1116 // Abort silently here, no one wants to kill this array
1120 // Add an empty list
1121 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['__EXTRA_PARAMETER'] = array();
1124 // Handles the XML node 'callback-extra-parameter-list-entry'
1125 function doXmlCallbackExtraParameterListEntry ($resource, $attributes) {
1126 // There are three attributes, by default
1127 if (count($attributes) != 3) {
1128 // Not the right count
1129 reportBug(__FUNCTION__, __LINE__, 'Expected 5 attributes, got ' . count($attributes));
1130 } elseif (!isset($attributes['COLUMN'])) {
1131 // 'COLUMN' not found
1132 reportBug(__FUNCTION__, __LINE__, 'Required attribute COLUMN not found.');
1133 } elseif (!isset($attributes['TYPE'])) {
1135 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
1136 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
1138 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
1139 } elseif (!isset($attributes['VALUE'])) {
1140 // 'VALUE' not found
1141 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
1142 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
1143 // 'VALUE' not valid/verifyable
1144 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
1145 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['__EXTRA_PARAMETER'])) {
1146 // doXmlCallbackFunction is missing
1147 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/__EXTRA_PARAMETER not included around this node. Please fix your XML.');
1150 // Add the entry to the array
1151 addXmlValueToCallbackAttributes('__EXTRA_PARAMETER', $attributes);
1154 // Handles the XML node 'no-entry-found-message'
1155 function doXmlNoEntryFoundMessage ($resource, $attributes) {
1156 // There are two attributes, by default
1157 if (count($attributes) != 2) {
1158 // Not the right count
1159 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
1160 } elseif (!isset($attributes['VALUE'])) {
1161 // 'VALUE' not found
1162 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
1163 } elseif (!isset($attributes['TYPE'])) {
1165 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
1166 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
1168 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
1169 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
1170 // Not valid/verifyable
1171 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
1172 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
1173 // doXmlCallbackFunction is missing
1174 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
1177 // Add the entry to the array
1178 addXmlValueToCallbackAttributes('no_entry_message_id', $attributes);
1181 //-----------------------------------------------------------------------------
1182 // XML type validation
1183 //-----------------------------------------------------------------------------
1185 // Checks for string without any added extra data
1186 function isXmlTypeString ($value) {
1187 // Just let SQL_ESCAPE() do the job
1188 return ($value == SQL_ESCAPE($value));
1191 // Fake-check for array type
1192 function isXmlTypeArray ($value) {
1193 // This value is always a string
1194 return (is_string($value));
1197 // Check for boolean type
1198 function isXmlTypeBool ($value) {
1200 $value = trim($value);
1202 // This value is always a string
1203 return (($value == 'true') || ($value == 'false'));
1206 // Check for integer type
1207 function isXmlTypeInt ($value) {
1209 $value = trim($value);
1211 // This value is always a string
1212 return (bigintval($value) == $value);
1215 // Check for callback type
1216 function isXmlTypeCallback ($value) {
1218 $value = trim($value);
1220 // This value is always a string
1221 return (function_exists($value));
1224 //-----------------------------------------------------------------------------
1225 // Private XML functions
1226 //-----------------------------------------------------------------------------
1228 // Adds given attribut to element
1229 function addXmlValueToCallbackAttributes ($element, $attributes, $extraKey = '', $key = '') {
1230 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',key=' . $key . ' - ENTERED!');
1231 // Is it boolean type?
1232 if (($attributes['TYPE'] == 'bool') && (isset($attributes['VALUE']))) {
1233 // Then convert VALUE
1234 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'TYPE=' . $attributes['TYPE'] . ',element=' . $element . ' - CONVERTING!');
1235 $attributes['VALUE'] = convertStringToBoolean($attributes['VALUE']);
1236 } elseif ($attributes['TYPE'] == 'callback') {
1237 // It is a simple call-back type
1238 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'TYPE=' . $attributes['TYPE'] . ',element=' . $element . ' - CALLING!');
1239 $attributes['VALUE'] = call_user_func($attributes['VALUE']);
1242 // What do we need to add?
1243 if ($attributes['TYPE'] == 'array') {
1244 // Another nested array
1245 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'TYPE=' . $attributes['TYPE'] . ',element=' . $element);
1246 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['VALUE'] . '_list'] = array();
1247 } elseif (!empty($extraKey)) {
1248 // Sub-array (one level only)
1249 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ' - ANALYSING...');
1250 if (trim($attributes['NAME']) == '') {
1252 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NUMERICAL!');
1253 if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey])) {
1254 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey] = array();
1256 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey])] = $attributes['VALUE'];
1257 } elseif (!empty($key)) {
1259 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - KEY! (key=' . $attributes[$key] . ')');
1260 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey][$attributes[$key]] = $attributes['VALUE'];
1263 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NAME! (NAME=' . $attributes['NAME'] . ')');
1264 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey][$attributes['NAME']] = $attributes['VALUE'];
1266 } elseif ((isset($attributes['FUNCTION'])) && (isset($attributes['ALIAS']))) {
1268 * ALIAS and FUNCTION detected? This may happen with SQL queries
1269 * like: UNIX_TIMESTAMP(`foo_timestamp`) AS `foo_timestamp`
1272 // Fix missing 'NAME'
1273 if (!isset($attributes['NAME'])) {
1274 $attributes['NAME'] = '';
1279 'column' => trim($attributes['VALUE']),
1280 'alias' => trim($attributes['ALIAS']),
1281 'function' => trim($attributes['FUNCTION']),
1282 'table' => trim($attributes['TABLE']),
1283 'name' => trim($attributes['NAME'])
1287 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',ALIAS[' . gettype($attributes['ALIAS']) . ']=' . $attributes['ALIAS'] . ',FUNCTION[' . gettype($attributes['FUNCTION']) . ']=' . $attributes['FUNCTION'] . ' - FUNCTION! (VALUE=' . $attributes['VALUE'] . ')');
1288 if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])) {
1289 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = array();
1291 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $array;
1292 } elseif ((isset($attributes['CONDITION'])) && (isset($attributes['LOOK-FOR']))) {
1293 // CONDITION/LOOK-FOR detected
1296 'column' => trim($attributes['VALUE']),
1297 'table' => trim($attributes['TABLE']),
1298 'condition' => convertXmlContion(trim($attributes['CONDITION'])),
1299 'look_for' => trim($attributes['LOOK-FOR'])
1302 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',CONDITION[' . gettype($attributes['CONDITION']) . ']=' . $attributes['CONDITION'] . ',LOOK-FOR[' . gettype($attributes['LOOK-FOR']) . ']=' . $attributes['LOOK-FOR'] . ' - CONDITION! (VALUE=' . $attributes['VALUE'] . ')');
1303 if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])) {
1304 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = array();
1306 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $array;
1307 } elseif ((isset($attributes['CONDITION'])) && (isset($attributes['NAME']))) {
1308 // CONDITION/NAME detected
1309 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',CONDITION[' . gettype($attributes['CONDITION']) . ']=' . $attributes['CONDITION'] . ',NAME[' . gettype($attributes['NAME']) . ']=' . $attributes['NAME'] . ' - CONDITION!');
1310 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['NAME']] = $attributes['CONDITION'];
1311 } elseif (isset($attributes['CALLBACK'])) {
1312 // CALLBACK/VALUE detected
1313 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',CALLBACK[' . gettype($attributes['CALLBACK']) . ']=' . $attributes['CALLBACK'] . ' - CALLBACK! (VALUE=' . $attributes['VALUE'] . ')');
1314 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['VALUE']] = $attributes['CALLBACK'];
1315 } elseif (isset($attributes['ORDER'])) {
1316 // ORDER/TABLE detected
1317 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',ORDER[' . gettype($attributes['ORDER']) . ']=' . $attributes['ORDER'] . ' - ORDER! (VALUE=' . $attributes['VALUE'] . ')');
1318 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['ORDER']][$attributes['TABLE']] = $attributes['VALUE'];
1319 } elseif (isset($attributes['COLUMN'])) {
1320 // COLUMN/VALUE detected
1321 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ',COLUMN[' . gettype($attributes['COLUMN']) . ']=' . $attributes['COLUMN'] . ' - COLUMN!');
1322 if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']])) {
1323 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']] = array();
1325 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']])] = $attributes['VALUE'];
1326 } elseif ((!isset($attributes['NAME'])) || (trim($attributes['NAME']) == '')) {
1328 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NUMERICAL!');
1329 if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])) {
1330 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = array();
1332 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $attributes['VALUE'];
1333 } elseif (isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['NAME']])) {
1335 reportBug(__FUNCTION__, __LINE__, 'NAME=' . $attributes['NAME'] . ' already addded to ' . $element . ' attributes=<pre>' . print_r($attributes, TRUE) . '</pre>');
1338 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',NAME=' . $attributes['NAME'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NAME!');
1339 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['NAME']] = $attributes['VALUE'];
1341 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',key=' . $key . ' - EXIT!');
1344 //-----------------------------------------------------------------------------
1345 // Execute call-back functions
1346 //-----------------------------------------------------------------------------
1348 // Execute function for doXmlCallbackFunction()
1349 function doXmlCallbackFunctionExecute ($callbackName, $args, $columnIndex, $content) {
1350 // Is 'id_index' set and form sent?
1351 if ((isset($args['id_index'])) && (isFormSent())) {
1352 // Prepare 'id_index'
1353 $args['id_index'] = postRequestElement($args['id_index']);
1357 $args['_content'] = $content;
1360 //* DEBUG: */ die(__FUNCTION__.':callbackFunction=' . $callbackName . ',<br />columnIndex=' . $columnIndex . ',<br />args(' . count($args) . ')=<pre>'.print_r($args, TRUE).'</pre>');
1361 //* DEBUG: */ reportBug(__FUNCTION__, __LINE__, 'Called!');
1362 call_user_func_array($callbackName, $args);
1365 // For 'doing' add referral level, the column-index is required
1366 function addXmlSpecialAdminAddDoReferralLevels () {
1367 // So set it all here
1368 $GLOBALS['__COLUMN_INDEX']['doXmlCallbackFunction'] = 'column';
1369 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_index'] = 'column';