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']['status_list'])) {
545 // doXmlCallbackFunction is missing
546 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/status-list not included around this node. Please fix your XML.');
550 // Handles the XML node 'status-change-list-entry'
551 function doXmlStatusChangeListEntry ($resource, $attributes) {
552 // There are for attributes, by default
553 if (count($attributes) != 4) {
554 // Not the right count
555 reportBug(__FUNCTION__, __LINE__, 'Expected 4 attributes, got ' . count($attributes));
556 } elseif (!isset($attributes['NAME'])) {
558 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
559 } elseif (!isset($attributes['TYPE'])) {
561 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
562 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
564 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
565 } elseif (!isset($attributes['VALUE'])) {
567 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
568 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['OLD'])) {
569 // Not valid/verifyable
570 reportBug(__FUNCTION__, __LINE__, 'Attribute OLD does not validate. TYPE=' . $attributes['TYPE'] . ',OLD=' . $attributes['OLD']);
571 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
572 // Not valid/verifyable
573 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
574 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['status_list'])) {
575 // doXmlCallbackFunction is missing
576 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list/change-list not included around this node. Please fix your XML.');
579 // Add the entry to the list
580 addXmlValueToCallbackAttributes('status_list', $attributes, $attributes['NAME'], 'OLD');
583 // Handles the XML node 'enable-modify-entries'
584 function doXmlEnableModifyEntries ($resource, $attributes) {
585 // There are three attributes, by default
586 if (count($attributes) != 3) {
587 // Not the right count
588 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
589 } elseif (!isset($attributes['NAME'])) {
591 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
592 } elseif (!isset($attributes['TYPE'])) {
594 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
595 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
597 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
598 } elseif (!isset($attributes['VALUE'])) {
600 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
601 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
602 // Not valid/verifyable
603 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
604 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
605 // doXmlCallbackFunction is missing
606 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
609 // Add the entry to the list
610 addXmlValueToCallbackAttributes('enable_modify_entries', $attributes);
613 // Handles the XML node 'table-id-column'
614 function doXmlTableIdColumn ($resource, $attributes) {
615 // There are three attributes, by default
616 if (count($attributes) != 3) {
617 // Not the right count
618 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
619 } elseif (!isset($attributes['NAME'])) {
621 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
622 } elseif (!isset($attributes['TYPE'])) {
624 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
625 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
627 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
628 } elseif (!isset($attributes['VALUE'])) {
630 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
631 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
632 // Not valid/verifyable
633 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
634 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
635 // doXmlCallbackFunction is missing
636 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
639 // Add the entry to the array
640 addXmlValueToCallbackAttributes('table_id_column', $attributes);
643 // Handles the XML node 'table-userid-column'
644 function doXmlTableUseridColumn ($resource, $attributes) {
645 // There are three attributes, by default
646 if (count($attributes) != 3) {
647 // Not the right count
648 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
649 } elseif (!isset($attributes['NAME'])) {
651 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
652 } elseif (!isset($attributes['TYPE'])) {
654 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
655 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
657 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
658 } elseif (!isset($attributes['VALUE'])) {
660 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
661 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
662 // Not valid/verifyable
663 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
664 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
665 // doXmlCallbackFunction is missing
666 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
669 // Add the entry to the array
670 addXmlValueToCallbackAttributes('table_userid_column', $attributes);
673 // Handles the XML node 'raw-userid-column-key'
674 function doXmlRawUseridColumnKey ($resource, $attributes) {
675 // There are three attributes, by default
676 if (count($attributes) != 3) {
677 // Not the right count
678 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
679 } elseif (!isset($attributes['NAME'])) {
681 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
682 } elseif (!isset($attributes['TYPE'])) {
684 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
685 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
687 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
688 } elseif (!isset($attributes['VALUE'])) {
690 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
691 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
692 // Not valid/verifyable
693 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
694 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
695 // doXmlCallbackFunction is missing
696 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
699 // Add the entry to the array
700 addXmlValueToCallbackAttributes('raw_userid_column_key', $attributes);
703 // Handles the XML node 'cache-file'
704 function doXmlCacheFile ($resource, $attributes) {
705 // There are three attributes, by default
706 if (count($attributes) != 3) {
707 // Not the right count
708 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
709 } elseif (!isset($attributes['NAME'])) {
711 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
712 } elseif (!isset($attributes['TYPE'])) {
714 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
715 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
717 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
718 } elseif (!isset($attributes['VALUE'])) {
720 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
721 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
722 // Not valid/verifyable
723 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
724 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
725 // doXmlCallbackFunction is missing
726 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
729 // Add the entry to the array
730 addXmlValueToCallbackAttributes('cache_file', $attributes);
733 //-----------------------------------------------------------------------------
734 // Call-back functions for listing of data in admin area
735 //-----------------------------------------------------------------------------
737 // Handles the XML node 'admin-list-data'
738 function doXmlAdminListData ($resource, $attributes) {
739 // There should be no attributes
740 if (count($attributes) > 0) {
741 // Please don't add any attributes to foo-list nodes
742 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes, got ' . count($attributes));
746 // Handles the XML node 'member-list-data'
747 function doXmlMemberListData ($resource, $attributes) {
748 // There should be no attributes
749 if (count($attributes) > 0) {
750 // Please don't add any attributes to foo-list nodes
751 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes, got ' . count($attributes));
755 // Handles the XML node 'data-tables'
756 function doXmlDataTables ($resource, $attributes) {
757 // There should be no attributes
758 if (count($attributes) > 0) {
759 // Please don't add any attributes to foo-list nodes
760 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes, got ' . count($attributes));
764 // Handles the XML node 'data-table'
765 function doXmlDataTable ($resource, $attributes) {
766 // There are three attributes, by default
767 if (count($attributes) != 3) {
768 // Not the right count
769 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
770 } elseif (!isset($attributes['VALUE'])) {
772 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
773 } elseif (!isset($attributes['TYPE'])) {
775 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
776 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
778 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
779 } elseif (!isset($attributes['ALIAS'])) {
781 reportBug(__FUNCTION__, __LINE__, 'Required attribute ALIAS not found.');
782 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
783 // Not valid/verifyable
784 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
785 } elseif ((trim($attributes['ALIAS']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['ALIAS']))) {
786 // Not valid/verifyable
787 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. ALIAS=' . $attributes['ALIAS']);
788 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
789 // doXmlCallbackFunction is missing
790 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
793 // Add the entry to the array
794 addXmlValueToCallbackAttributes('data_table', $attributes);
797 // Handles the XML node 'select-data-from-list'
798 function doXmlSelectDataFromList ($resource, $attributes) {
799 // There should be no attributes
800 if (count($attributes) > 0) {
801 // Please don't add any attributes to foo-list nodes
802 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
803 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'])) {
804 // doXmlCallbackFunction is missing
805 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-table not included around this node. Please fix your XML.');
809 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_column_list'] = array();
812 // Handles the XML node 'select-data-from-list-entry'
813 function doXmlSelectDataFromListEntry ($resource, $attributes) {
814 // There are five attributes, by default
815 if (count($attributes) != 5) {
816 // Not the right count
817 reportBug(__FUNCTION__, __LINE__, 'Expected 5 attributes, got ' . count($attributes));
818 } elseif (!isset($attributes['VALUE'])) {
820 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
821 } elseif (!isset($attributes['TYPE'])) {
823 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
824 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
826 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
827 } elseif (!isset($attributes['ALIAS'])) {
829 reportBug(__FUNCTION__, __LINE__, 'Required attribute ALIAS not found.');
830 } elseif (!isset($attributes['FUNCTION'])) {
831 // 'FUNCTION' not found
832 reportBug(__FUNCTION__, __LINE__, 'Required attribute FUNCTION not found.');
833 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
834 // 'VALUE' not valid/verifyable
835 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
836 } elseif ((trim($attributes['ALIAS']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['ALIAS']))) {
837 // 'ALIAS' not valid/verifyable
838 reportBug(__FUNCTION__, __LINE__, 'Attribute ALIAS does not validate. ALIAS=' . $attributes['ALIAS']);
839 } elseif ((trim($attributes['FUNCTION']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['FUNCTION']))) {
840 // 'FUNCTION' not valid/verifyable
841 reportBug(__FUNCTION__, __LINE__, 'Attribute FUNCTION does not validate. FUNCTION=' . $attributes['FUNCTION']);
842 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_column_list'])) {
843 // doXmlCallbackFunction is missing
844 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/select-data-from-list not included around this node. Please fix your XML.');
847 // Add the entry to the array
848 addXmlValueToCallbackAttributes('data_column_list', $attributes);
851 // Handles the XML node 'where-select-from-list'
852 function doXmlWhereSelectFromList ($resource, $attributes) {
853 // There should be no attributes
854 if (count($attributes) > 0) {
855 // Please don't add any attributes to foo-list nodes
856 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
857 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'])) {
858 // doXmlCallbackFunction is missing
859 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-table not included around this node. Please fix your XML.');
863 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['where_select_list'] = array();
866 // Handles the XML node 'where-select-from-list-entry'
867 function doXmlWhereSelectFromListEntry ($resource, $attributes) {
868 // There are five attributes, by default
869 if (count($attributes) != 5) {
870 // Not the right count
871 reportBug(__FUNCTION__, __LINE__, 'Expected 5 attributes, got ' . count($attributes));
872 } elseif (!isset($attributes['TYPE'])) {
874 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
875 } elseif (!isset($attributes['TABLE'])) {
877 reportBug(__FUNCTION__, __LINE__, 'Required attribute TABLE not found.');
878 } elseif (!isset($attributes['VALUE'])) {
880 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
881 } elseif (!isset($attributes['CONDITION'])) {
882 // 'CONDITION' not found
883 reportBug(__FUNCTION__, __LINE__, 'Required attribute CONDITION not found.');
884 } elseif (!isset($attributes['LOOK-FOR'])) {
885 // 'LOOK-FOR' not found
886 reportBug(__FUNCTION__, __LINE__, 'Required attribute LOOK-FOR not found.');
887 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
889 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
890 } elseif ((trim($attributes['TABLE']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['TABLE']))) {
891 // 'TABLE' not valid/verifyable
892 reportBug(__FUNCTION__, __LINE__, 'Attribute TABLE does not validate. TABLE=' . $attributes['TABLE']);
893 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
894 // 'VALUE' not valid/verifyable
895 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
896 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['CONDITION'])) {
897 // 'CONDITION' not valid/verifyable
898 reportBug(__FUNCTION__, __LINE__, 'Attribute CONDITION does not validate. CONDITION=' . $attributes['CONDITION']);
899 } elseif (!isXmlConditionValid($attributes['CONDITION'])) {
900 // 'CONDITION' is not known
901 reportBug(__FUNCTION__, __LINE__, 'Attribute CONDITION is not valid. LOOK-FOR=' . $attributes['CONDITION']);
902 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_column_list'])) {
903 // doXmlCallbackFunction is missing
904 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-column-list not included around this node. Please fix your XML.');
907 // Add the entry to the array
908 addXmlValueToCallbackAttributes('where_select_list', $attributes);
911 // Handles the XML node 'where-condition'
912 function doXmlWhereCondition ($resource, $attributes) {
913 // There are two attributes, by default
914 if (count($attributes) != 3) {
915 // Please don't add any attributes to foo-list nodes
916 reportBug(__FUNCTION__, __LINE__, 'Expected 2 attributes because this is a where-condition node, got ' . count($attributes));
917 } elseif (!isset($attributes['TYPE'])) {
919 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
920 } elseif (!isset($attributes['CONDITION'])) {
921 // 'CONDITION' not found
922 reportBug(__FUNCTION__, __LINE__, 'Required attribute CONDITION not found.');
923 } elseif (!isset($attributes['NAME'])) {
925 reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
926 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'])) {
927 // doXmlCallbackFunction is missing
928 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-table not included around this node. Please fix your XML.');
932 addXmlValueToCallbackAttributes('where_condition', $attributes);
935 // Handles the XML node 'order-by-list'
936 function doXmlOrderByList ($resource, $attributes) {
937 // There should be no attributes
938 if (count($attributes) > 0) {
939 // Please don't add any attributes to foo-list nodes
940 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
941 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'])) {
942 // doXmlCallbackFunction is missing
943 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-table not included around this node. Please fix your XML.');
947 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['order_by_list'] = array();
950 // Handles the XML node 'order-by-list-entry'
951 function doXmlOrderByListEntry ($resource, $attributes) {
952 // There are four attributes, by default
953 if (count($attributes) != 4) {
954 // Not the right count
955 reportBug(__FUNCTION__, __LINE__, 'Expected 5 attributes, got ' . count($attributes));
956 } elseif (!isset($attributes['ORDER'])) {
958 reportBug(__FUNCTION__, __LINE__, 'Required attribute ORDER not found.');
959 } elseif (!isset($attributes['TYPE'])) {
961 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
962 } elseif (!isset($attributes['TABLE'])) {
964 reportBug(__FUNCTION__, __LINE__, 'Required attribute TABLE not found.');
965 } elseif (!isset($attributes['VALUE'])) {
967 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
968 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
970 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
971 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['ORDER'])) {
972 // 'ORDER' not valid/verifyable
973 reportBug(__FUNCTION__, __LINE__, 'Attribute ORDER does not validate. ORDER=' . $attributes['ORDER']);
974 } elseif ((trim($attributes['TABLE']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['TABLE']))) {
975 // 'TABLE' not valid/verifyable
976 reportBug(__FUNCTION__, __LINE__, 'Attribute TABLE does not validate. TABLE=' . $attributes['TABLE']);
977 } elseif ((trim($attributes['VALUE']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE']))) {
978 // 'VALUE' not valid/verifyable
979 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
980 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_column_list'])) {
981 // doXmlCallbackFunction is missing
982 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-column-list not included around this node. Please fix your XML.');
985 // Add the entry to the array
986 addXmlValueToCallbackAttributes('order_by_list', $attributes);
989 // Handles the XML node 'list-template'
990 function doXmlListTemplate ($resource, $attributes) {
991 // There are two attributes, by default
992 if (count($attributes) != 2) {
993 // Not the right count
994 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
995 } elseif (!isset($attributes['VALUE'])) {
997 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
998 } elseif (!isset($attributes['TYPE'])) {
1000 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
1001 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
1003 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
1004 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
1005 // Not valid/verifyable
1006 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
1007 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
1008 // doXmlCallbackFunction is missing
1009 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
1012 // Add the entry to the array
1013 addXmlValueToCallbackAttributes('list_template', $attributes);
1016 // Handles the XML node 'list-row-template'
1017 function doXmlListRowTemplate ($resource, $attributes) {
1018 // There are two attributes, by default
1019 if (count($attributes) != 2) {
1020 // Not the right count
1021 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
1022 } elseif (!isset($attributes['VALUE'])) {
1023 // 'VALUE' not found
1024 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
1025 } elseif (!isset($attributes['TYPE'])) {
1027 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
1028 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
1030 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
1031 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
1032 // Not valid/verifyable
1033 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
1034 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
1035 // doXmlCallbackFunction is missing
1036 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
1039 // Add the entry to the array
1040 addXmlValueToCallbackAttributes('list_row_template', $attributes);
1043 // Handles the XML node 'column-callback-list'
1044 function doXmlColumnCallbackList ($resource, $attributes) {
1045 // There should be no attributes
1046 if (count($attributes) > 0) {
1047 // Please don't add any attributes to foo-list nodes
1048 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
1049 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'])) {
1050 // doXmlCallbackFunction is missing
1051 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-table not included around this node. Please fix your XML.');
1054 // Add an empty list
1055 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_callback_list'] = array();
1058 // Handles the XML node 'column-callback-list-entry'
1059 function doXmlColumnCallbackListEntry ($resource, $attributes) {
1060 // There should be no attributes
1061 if (count($attributes) > 0) {
1062 // Please don't add any attributes to foo-list nodes
1063 reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
1064 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_callback_list'])) {
1065 // doXmlCallbackFunction is missing
1066 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/column-callback not included around this node. Please fix your XML.');
1070 // Handles the XML node 'column-callback-data'
1071 function doXmlColumnCallbackData ($resource, $attributes) {
1072 // There are three attributes, by default
1073 if (count($attributes) != 3) {
1074 // Not the right count
1075 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
1076 } elseif (!isset($attributes['VALUE'])) {
1077 // 'VALUE' not found
1078 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
1079 } elseif (!isset($attributes['TYPE'])) {
1081 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
1082 } elseif (!isset($attributes['CALLBACK'])) {
1083 // 'CALLBACK' not found
1084 reportBug(__FUNCTION__, __LINE__, 'Required attribute CALLBACK not found.');
1085 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
1087 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
1088 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
1089 // Not valid/verifyable
1090 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
1091 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
1092 // doXmlCallbackFunction is missing
1093 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
1094 } elseif ((trim($attributes['CALLBACK']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['CALLBACK']))) {
1095 // 'CALLBACK' not valid/verifyable
1096 reportBug(__FUNCTION__, __LINE__, 'Attribute CALLBACK does not validate. CALLBACK=' . $attributes['CALLBACK']);
1099 // Add the entry to the array
1100 addXmlValueToCallbackAttributes('column_callback_list', $attributes);
1103 // Handles the XML node 'callback-extra-parameter-list'
1104 function doXmlCallbackExtraParameterList ($resource, $attributes) {
1105 // There should be no attributes
1106 if (count($attributes) > 0) {
1107 // Please don't add any attributes to foo-list nodes
1108 reportBug(__FUNCTION__, __LINE__, 'Expected 1 attributes because this is a named foo-list node, got ' . count($attributes));
1109 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_callback_list'])) {
1110 // doXmlCallbackFunction is missing
1111 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/column-callback-list not included around this node. Please fix your XML.');
1112 } elseif (isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['__EXTRA_PARAMETER'])) {
1113 // Abort silently here, no one wants to kill this array
1117 // Add an empty list
1118 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['__EXTRA_PARAMETER'] = array();
1121 // Handles the XML node 'callback-extra-parameter-list-entry'
1122 function doXmlCallbackExtraParameterListEntry ($resource, $attributes) {
1123 // There are three attributes, by default
1124 if (count($attributes) != 3) {
1125 // Not the right count
1126 reportBug(__FUNCTION__, __LINE__, 'Expected 5 attributes, got ' . count($attributes));
1127 } elseif (!isset($attributes['COLUMN'])) {
1128 // 'COLUMN' not found
1129 reportBug(__FUNCTION__, __LINE__, 'Required attribute COLUMN not found.');
1130 } elseif (!isset($attributes['TYPE'])) {
1132 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
1133 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
1135 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
1136 } elseif (!isset($attributes['VALUE'])) {
1137 // 'VALUE' not found
1138 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
1139 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
1140 // 'VALUE' not valid/verifyable
1141 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
1142 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['__EXTRA_PARAMETER'])) {
1143 // doXmlCallbackFunction is missing
1144 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/__EXTRA_PARAMETER not included around this node. Please fix your XML.');
1147 // Add the entry to the array
1148 addXmlValueToCallbackAttributes('__EXTRA_PARAMETER', $attributes);
1151 // Handles the XML node 'no-entry-found-message'
1152 function doXmlNoEntryFoundMessage ($resource, $attributes) {
1153 // There are two attributes, by default
1154 if (count($attributes) != 2) {
1155 // Not the right count
1156 reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
1157 } elseif (!isset($attributes['VALUE'])) {
1158 // 'VALUE' not found
1159 reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
1160 } elseif (!isset($attributes['TYPE'])) {
1162 reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
1163 } elseif (!isInvalidXmlType($attributes['TYPE'])) {
1165 reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
1166 } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
1167 // Not valid/verifyable
1168 reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
1169 } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
1170 // doXmlCallbackFunction is missing
1171 reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
1174 // Add the entry to the array
1175 addXmlValueToCallbackAttributes('no_entry_message_id', $attributes);
1178 //-----------------------------------------------------------------------------
1179 // XML type validation
1180 //-----------------------------------------------------------------------------
1182 // Checks for string without any added extra data
1183 function isXmlTypeString ($value) {
1184 // Just let SQL_ESCAPE() do the job
1185 return ($value == SQL_ESCAPE($value));
1188 // Fake-check for array type
1189 function isXmlTypeArray ($value) {
1190 // This value is always a string
1191 return (is_string($value));
1194 // Check for boolean type
1195 function isXmlTypeBool ($value) {
1197 $value = trim($value);
1199 // This value is always a string
1200 return (($value == 'true') || ($value == 'false'));
1203 // Check for integer type
1204 function isXmlTypeInt ($value) {
1206 $value = trim($value);
1208 // This value is always a string
1209 return (bigintval($value) == $value);
1212 // Check for callback type
1213 function isXmlTypeCallback ($value) {
1215 $value = trim($value);
1217 // This value is always a string
1218 return (function_exists($value));
1221 //-----------------------------------------------------------------------------
1222 // Private XML functions
1223 //-----------------------------------------------------------------------------
1225 // Adds given attribut to element
1226 function addXmlValueToCallbackAttributes ($element, $attributes, $extraKey = '', $key = '') {
1227 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',key=' . $key . ' - ENTERED!');
1228 // Is it boolean type?
1229 if (($attributes['TYPE'] == 'bool') && (isset($attributes['VALUE']))) {
1230 // Then convert VALUE
1231 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'TYPE=' . $attributes['TYPE'] . ',element=' . $element . ' - CONVERTING!');
1232 $attributes['VALUE'] = convertStringToBoolean($attributes['VALUE']);
1233 } elseif ($attributes['TYPE'] == 'callback') {
1234 // It is a simple call-back type
1235 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'TYPE=' . $attributes['TYPE'] . ',element=' . $element . ' - CALLING!');
1236 $attributes['VALUE'] = call_user_func($attributes['VALUE']);
1239 // What do we need to add?
1240 if ($attributes['TYPE'] == 'array') {
1241 // Another nested array
1242 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'TYPE=' . $attributes['TYPE'] . ',element=' . $element);
1243 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['VALUE'] . '_list'] = array();
1244 } elseif (!empty($extraKey)) {
1245 // Sub-array (one level only)
1246 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ' - ANALYSING...');
1247 if (trim($attributes['NAME']) == '') {
1249 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NUMERICAL!');
1250 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey][] = $attributes['VALUE'];
1251 } elseif (!empty($key)) {
1253 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - KEY! (key=' . $attributes[$key] . ')');
1254 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey][$attributes[$key]] = $attributes['VALUE'];
1257 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NAME! (NAME=' . $attributes['NAME'] . ')');
1258 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey][$attributes['NAME']] = $attributes['VALUE'];
1260 } elseif ((isset($attributes['FUNCTION'])) && (isset($attributes['ALIAS']))) {
1262 * ALIAS and FUNCTION detected? This may happen with SQL queries
1263 * like: UNIX_TIMESTAMP(`foo_timestamp`) AS `foo_timestamp`
1266 // Fix missing 'NAME'
1267 if (!isset($attributes['NAME'])) {
1268 $attributes['NAME'] = '';
1273 'column' => trim($attributes['VALUE']),
1274 'alias' => trim($attributes['ALIAS']),
1275 'function' => trim($attributes['FUNCTION']),
1276 'table' => trim($attributes['TABLE']),
1277 'name' => trim($attributes['NAME'])
1281 //* 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'] . ')');
1282 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][] = $array;
1283 } elseif ((isset($attributes['CONDITION'])) && (isset($attributes['LOOK-FOR']))) {
1284 // CONDITION/LOOK-FOR detected
1287 'column' => trim($attributes['VALUE']),
1288 'table' => trim($attributes['TABLE']),
1289 'condition' => convertXmlContion(trim($attributes['CONDITION'])),
1290 'look_for' => trim($attributes['LOOK-FOR'])
1293 //* 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'] . ')');
1294 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][] = $array;
1295 } elseif ((isset($attributes['CONDITION'])) && (isset($attributes['NAME']))) {
1296 // CONDITION/NAME detected
1297 //* 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!');
1298 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['NAME']] = $attributes['CONDITION'];
1299 } elseif (isset($attributes['CALLBACK'])) {
1300 // CALLBACK/VALUE detected
1301 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',CALLBACK[' . gettype($attributes['CALLBACK']) . ']=' . $attributes['CALLBACK'] . ' - CALLBACK! (VALUE=' . $attributes['VALUE'] . ')');
1302 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['VALUE']] = $attributes['CALLBACK'];
1303 } elseif (isset($attributes['ORDER'])) {
1304 // ORDER/TABLE detected
1305 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',ORDER[' . gettype($attributes['ORDER']) . ']=' . $attributes['ORDER'] . ' - ORDER! (VALUE=' . $attributes['VALUE'] . ')');
1306 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['ORDER']][$attributes['TABLE']] = $attributes['VALUE'];
1307 } elseif (isset($attributes['COLUMN'])) {
1308 // COLUMN/VALUE detected
1309 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ',COLUMN[' . gettype($attributes['COLUMN']) . ']=' . $attributes['COLUMN'] . ' - COLUMN!');
1310 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']][] = $attributes['VALUE'];
1311 } elseif ((!isset($attributes['NAME'])) || (trim($attributes['NAME']) == '')) {
1313 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NUMERICAL!');
1314 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][] = $attributes['VALUE'];
1315 } elseif (isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['NAME']])) {
1317 reportBug(__FUNCTION__, __LINE__, 'NAME=' . $attributes['NAME'] . ' already addded to ' . $element . ' attributes=<pre>' . print_r($attributes, TRUE) . '</pre>');
1320 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',NAME=' . $attributes['NAME'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NAME!');
1321 $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['NAME']] = $attributes['VALUE'];
1323 //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',key=' . $key . ' - EXIT!');
1326 //-----------------------------------------------------------------------------
1327 // Execute call-back functions
1328 //-----------------------------------------------------------------------------
1330 // Execute function for doXmlCallbackFunction()
1331 function doXmlCallbackFunctionExecute ($callbackName, $args, $columnIndex) {
1332 // Is 'id_index' set and form sent?
1333 if ((isset($args['id_index'])) && (isFormSent())) {
1334 // Prepare 'id_index'
1335 $args['id_index'] = postRequestElement($args['id_index']);
1339 //* DEBUG: */ die(__FUNCTION__.':callbackFunction=' . $callbackName . ',columnIndex=' . $columnIndex . ',args=<pre>'.print_r($args, TRUE).'</pre>');
1340 call_user_func_array($callbackName, $args);