X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fcallback-functions.php;h=965e545d9348b6390ad20cd3ad4aa37d147df3c5;hb=1bacd30abeb24cbdff3f2f220c047444cf034f7c;hp=8f5aada84de8ae366c08753432fa58b16e982e50;hpb=7052cc3bd3ca07281078acbbce6ce595d753def1;p=mailer.git diff --git a/inc/callback-functions.php b/inc/callback-functions.php index 8f5aada84d..965e545d93 100644 --- a/inc/callback-functions.php +++ b/inc/callback-functions.php @@ -541,10 +541,13 @@ function doXmlStatusChangeList ($resource, $attributes) { if (count($attributes) > 0) { // Please don't add any attributes to foo-list nodes reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes)); - } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['status_list'])) { + } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) { // doXmlCallbackFunction is missing - reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/status-list not included around this node. Please fix your XML.'); + reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.'); } + + // Add the entry to the list + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['status_list'] = array(); } // Handles the XML node 'status-change-list-entry' @@ -790,10 +793,168 @@ function doXmlDataTable ($resource, $attributes) { reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.'); } + // Init array + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'] = array(); + // Add the entry to the array addXmlValueToCallbackAttributes('data_table', $attributes); } +// Handles the XML node 'table-join-condition' +function doXmlTableJoinCondition ($resource, $attributes) { + // There should be no attributes + if (count($attributes) > 0) { + // Please don't add any attributes to foo-list nodes + reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes, got ' . count($attributes)); + } // END - if +} + +// Handles the XML node 'table-join-type' +function doXmlTableJoinType ($resource, $attributes) { + if (count($attributes) != 1) { + // Not the right count + reportBug(__FUNCTION__, __LINE__, 'Expected 1 attributes, got ' . count($attributes)); + } elseif (!isset($attributes['TYPE'])) { + // 'TYPE' not found + reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.'); + } elseif (isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['table_join_type'])) { + // Array is already defined + reportBug(__FUNCTION__, __LINE__, 'Required XML node table-join-type already set. Only one JOIN is currently supported.'); + } + + // Init array + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['table_join_type'] = array(); + + // Add the entry to the array + addXmlValueToCallbackAttributes('table_join_type', $attributes); +} + +// Handles the XML node 'table-join-name' +function doXmlTableJoinName ($resource, $attributes) { + if (count($attributes) != 2) { + // Not the right count + reportBug(__FUNCTION__, __LINE__, 'Expected 2 attributes, got ' . count($attributes)); + } elseif (!isset($attributes['NAME'])) { + // 'NAME' not found + reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.'); + } elseif (!isset($attributes['ALIAS'])) { + // 'ALIAS' not found + reportBug(__FUNCTION__, __LINE__, 'Required attribute ALIAS not found.'); + } elseif (isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['table_join_name'])) { + // Array is already defined + reportBug(__FUNCTION__, __LINE__, 'Required XML node table-join-name already set. Only one JOIN is currently supported.'); + } + + // Init array + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['table_join_name'] = array(); + + // Add the entry to the array + addXmlValueToCallbackAttributes('table_join_name', $attributes); +} + +// Handles the XML node 'join-on' +function doXmlJoinOn ($resource, $attributes) { + // There should be no attributes + if (count($attributes) > 0) { + // Please don't add any attributes to foo-list nodes + reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes, got ' . count($attributes)); + } // END - if +} + +// Handles the XML node 'join-on-left-table' +function doXmlJoinOnLeftTable ($resource, $attributes) { + if (count($attributes) != 3) { + // Not the right count + reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes)); + } elseif (!isset($attributes['TYPE'])) { + // 'TYPE' not found + reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.'); + } elseif (!isset($attributes['NAME'])) { + // 'NAME' not found + reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.'); + } elseif (!isset($attributes['COLUMN'])) { + // 'COLUMN' not found + reportBug(__FUNCTION__, __LINE__, 'Required attribute COLUMN not found.'); + } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['NAME'])) { + // 'NAME' not valid/verifyable + reportBug(__FUNCTION__, __LINE__, 'Attribute NAME does not validate. NAME=' . $attributes['NAME']); + } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['COLUMN'])) { + // 'COLUMN' not valid/verifyable + reportBug(__FUNCTION__, __LINE__, 'Attribute COLUMN does not validate. COLUMN=' . $attributes['COLUMN']); + } elseif (isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['join_on_left_table'])) { + // Array is already defined + reportBug(__FUNCTION__, __LINE__, 'Required XML node join-on-left-table already set. Only one JOIN is currently supported.'); + } + + // Init array + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['join_on_left_table'] = array(); + + // Add the entry to the array + addXmlValueToCallbackAttributes('join_on_left_table', $attributes); +} + +// Handles the XML node 'join-on-right-table' +function doXmlJoinOnRightTable ($resource, $attributes) { + if (count($attributes) != 3) { + // Not the right count + reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes)); + } elseif (!isset($attributes['TYPE'])) { + // 'TYPE' not found + reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.'); + } elseif (!isset($attributes['NAME'])) { + // 'NAME' not found + reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.'); + } elseif (!isset($attributes['COLUMN'])) { + // 'COLUMN' not found + reportBug(__FUNCTION__, __LINE__, 'Required attribute COLUMN not found.'); + } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['NAME'])) { + // 'NAME' not valid/verifyable + reportBug(__FUNCTION__, __LINE__, 'Attribute NAME does not validate. NAME=' . $attributes['NAME']); + } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['COLUMN'])) { + // 'COLUMN' not valid/verifyable + reportBug(__FUNCTION__, __LINE__, 'Attribute COLUMN does not validate. COLUMN=' . $attributes['COLUMN']); + } elseif (isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['join_on_right_table'])) { + // Array is already defined + reportBug(__FUNCTION__, __LINE__, 'Required XML node join-on-right-table already set. Only one JOIN is currently supported.'); + } + + // Init array + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['join_on_right_table'] = array(); + + // Add the entry to the array + addXmlValueToCallbackAttributes('join_on_right_table', $attributes); +} + +// Handles the XML node 'join-on-condition' +function doXmlJoinOnCondition ($resource, $attributes) { + if (count($attributes) != 2) { + // Not the right count + reportBug(__FUNCTION__, __LINE__, 'Expected 2 attributes, got ' . count($attributes)); + } elseif (!isset($attributes['TYPE'])) { + // 'TYPE' not found + reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.'); + } elseif (!isset($attributes['CONDITION'])) { + // 'CONDITION' not found + reportBug(__FUNCTION__, __LINE__, 'Required attribute CONDITION not found.'); + } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['CONDITION'])) { + // 'CONDITION' not valid/verifyable + reportBug(__FUNCTION__, __LINE__, 'Attribute CONDITION does not validate. CONDITION=' . $attributes['CONDITION']); + } elseif (!isXmlConditionValid($attributes['CONDITION'])) { + // 'CONDITION' is not known + reportBug(__FUNCTION__, __LINE__, 'Attribute CONDITION is not valid. CONDITION=' . $attributes['CONDITION']); + } elseif (isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['join_on_condition'])) { + // Array is already defined + reportBug(__FUNCTION__, __LINE__, 'Required XML node join-on-condition already set. Only one JOIN is currently supported.'); + } + + // Init array + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['join_on_condition'] = array(); + + // Add the entry to the array + //die('
'.print_r($attributes,true).'
'); + addXmlValueToCallbackAttributes('join_on_condition', $attributes); +} + // Handles the XML node 'select-data-from-list' function doXmlSelectDataFromList ($resource, $attributes) { // There should be no attributes @@ -898,7 +1059,7 @@ function doXmlWhereSelectFromListEntry ($resource, $attributes) { reportBug(__FUNCTION__, __LINE__, 'Attribute CONDITION does not validate. CONDITION=' . $attributes['CONDITION']); } elseif (!isXmlConditionValid($attributes['CONDITION'])) { // 'CONDITION' is not known - reportBug(__FUNCTION__, __LINE__, 'Attribute CONDITION is not valid. LOOK-FOR=' . $attributes['CONDITION']); + reportBug(__FUNCTION__, __LINE__, 'Attribute CONDITION is not valid. CONDITION=' . $attributes['CONDITION']); } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_column_list'])) { // doXmlCallbackFunction is missing reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-column-list not included around this node. Please fix your XML.'); @@ -923,6 +1084,12 @@ function doXmlWhereCondition ($resource, $attributes) { } elseif (!isset($attributes['NAME'])) { // 'NAME' not found reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.'); + } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['CONDITION'])) { + // 'CONDITION' not valid/verifyable + reportBug(__FUNCTION__, __LINE__, 'Attribute CONDITION does not validate. CONDITION=' . $attributes['CONDITION']); + } elseif ((!empty($attributes['CONDITION'])) && (!isXmlConditionValid($attributes['CONDITION']))) { + // 'CONDITION' is not known + reportBug(__FUNCTION__, __LINE__, 'Attribute CONDITION is not valid. CONDITION=' . $attributes['CONDITION']); } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'])) { // doXmlCallbackFunction is missing reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-table not included around this node. Please fix your XML.'); @@ -1226,18 +1393,18 @@ function isXmlTypeCallback ($value) { function addXmlValueToCallbackAttributes ($element, $attributes, $extraKey = '', $key = '') { //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',key=' . $key . ' - ENTERED!'); // Is it boolean type? - if (($attributes['TYPE'] == 'bool') && (isset($attributes['VALUE']))) { + if ((isset($attributes['TYPE'])) && ($attributes['TYPE'] == 'bool') && (isset($attributes['VALUE']))) { // Then convert VALUE //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'TYPE=' . $attributes['TYPE'] . ',element=' . $element . ' - CONVERTING!'); $attributes['VALUE'] = convertStringToBoolean($attributes['VALUE']); - } elseif ($attributes['TYPE'] == 'callback') { + } elseif ((isset($attributes['TYPE'])) && ($attributes['TYPE'] == 'callback')) { // It is a simple call-back type //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'TYPE=' . $attributes['TYPE'] . ',element=' . $element . ' - CALLING!'); $attributes['VALUE'] = call_user_func($attributes['VALUE']); } // What do we need to add? - if ($attributes['TYPE'] == 'array') { + if ((isset($attributes['TYPE'])) && ($attributes['TYPE'] == 'array')) { // Another nested array //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'TYPE=' . $attributes['TYPE'] . ',element=' . $element); $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['VALUE'] . '_list'] = array(); @@ -1247,7 +1414,10 @@ function addXmlValueToCallbackAttributes ($element, $attributes, $extraKey = '', if (trim($attributes['NAME']) == '') { // Numerical index //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NUMERICAL!'); - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey][] = $attributes['VALUE']; + if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey])) { + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey] = array(); + } // END - if + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey])] = $attributes['VALUE']; } elseif (!empty($key)) { // Use from $key //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - KEY! (key=' . $attributes[$key] . ')'); @@ -1269,7 +1439,7 @@ function addXmlValueToCallbackAttributes ($element, $attributes, $extraKey = '', } // END - if // Init array - $array = array( + $array = array( 'column' => trim($attributes['VALUE']), 'alias' => trim($attributes['ALIAS']), 'function' => trim($attributes['FUNCTION']), @@ -1279,11 +1449,30 @@ function addXmlValueToCallbackAttributes ($element, $attributes, $extraKey = '', // Add the entry //* 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'] . ')'); - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][] = $array; + if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])) { + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = array(); + } // END - if + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $array; + } elseif ((isset($attributes['NAME'])) && (isset($attributes['ALIAS']))) { + // NAME/ALIAS detected + $array = array( + 'name' => trim($attributes['NAME']), + 'alias' => trim($attributes['ALIAS']) + ); + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',NAME=' . $attributes['NAME'] . ',ALIAS[' . gettype($attributes['ALIAS']) . ']=' . $attributes['ALIAS']); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $array; + } elseif ((isset($attributes['VALUE'])) && (isset($attributes['ALIAS']))) { + // NAME/ALIAS detected + $array = array( + 'value' => trim($attributes['VALUE']), + 'alias' => trim($attributes['ALIAS']) + ); + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',NAME=' . $attributes['VALUE'] . ',ALIAS[' . gettype($attributes['ALIAS']) . ']=' . $attributes['ALIAS']); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $array; } elseif ((isset($attributes['CONDITION'])) && (isset($attributes['LOOK-FOR']))) { // CONDITION/LOOK-FOR detected // Init array - $array = array( + $array = array( 'column' => trim($attributes['VALUE']), 'table' => trim($attributes['TABLE']), 'condition' => convertXmlContion(trim($attributes['CONDITION'])), @@ -1291,11 +1480,18 @@ function addXmlValueToCallbackAttributes ($element, $attributes, $extraKey = '', ); //* 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'] . ')'); - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][] = $array; + if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])) { + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = array(); + } // END - if + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $array; } elseif ((isset($attributes['CONDITION'])) && (isset($attributes['NAME']))) { // CONDITION/NAME detected - //* 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!'); + //* 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-NAME!'); $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['NAME']] = $attributes['CONDITION']; + } elseif (isset($attributes['CONDITION'])) { + // CONDITION detected + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',CONDITION[' . gettype($attributes['CONDITION']) . ']=' . $attributes['CONDITION'] . ' - CONDITION!'); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = convertXmlContion(trim($attributes['CONDITION'])); } elseif (isset($attributes['CALLBACK'])) { // CALLBACK/VALUE detected //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',CALLBACK[' . gettype($attributes['CALLBACK']) . ']=' . $attributes['CALLBACK'] . ' - CALLBACK! (VALUE=' . $attributes['VALUE'] . ')'); @@ -1304,14 +1500,33 @@ function addXmlValueToCallbackAttributes ($element, $attributes, $extraKey = '', // ORDER/TABLE detected //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',ORDER[' . gettype($attributes['ORDER']) . ']=' . $attributes['ORDER'] . ' - ORDER! (VALUE=' . $attributes['VALUE'] . ')'); $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['ORDER']][$attributes['TABLE']] = $attributes['VALUE']; + } elseif ((isset($attributes['TYPE'])) && (isset($attributes['NAME'])) && (isset($attributes['COLUMN']))) { + // TYPE/NAME/COLUMN detected + // Init array + $array = array( + 'name' => trim($attributes['NAME']), + 'column' => trim($attributes['COLUMN']) + ); + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',NAME[' . gettype($attributes['NAME']) . ']=' . $attributes['NAME'] . ' - TYPE-COLUMN! (COLUMN=' . $attributes['COLUMN'] . ')'); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $array; } elseif (isset($attributes['COLUMN'])) { // COLUMN/VALUE detected //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ',COLUMN[' . gettype($attributes['COLUMN']) . ']=' . $attributes['COLUMN'] . ' - COLUMN!'); - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']][] = $attributes['VALUE']; - } elseif ((!isset($attributes['NAME'])) || (trim($attributes['NAME']) == '')) { + if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']])) { + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']] = array(); + } // END - if + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']])] = $attributes['VALUE']; + } elseif (((!isset($attributes['NAME'])) || (trim($attributes['NAME']) == '')) && (isset($attributes['VALUE']))) { // Numerical index //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NUMERICAL!'); - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][] = $attributes['VALUE']; + if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])) { + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = array(); + } // END - if + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $attributes['VALUE']; + } elseif ((count($attributes) == 1) && (isset($attributes['TYPE']))) { + // Only TYPE found + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',TYPE[' . gettype($attributes['TYPE']) . ']=' . $attributes['TYPE'] . ' - TYPE-ONLY!'); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $attributes['TYPE']; } elseif (isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['NAME']])) { // Already created reportBug(__FUNCTION__, __LINE__, 'NAME=' . $attributes['NAME'] . ' already addded to ' . $element . ' attributes=
' . print_r($attributes, TRUE) . '
'); @@ -1344,5 +1559,12 @@ function doXmlCallbackFunctionExecute ($callbackName, $args, $columnIndex, $cont call_user_func_array($callbackName, $args); } +// For 'doing' add referral level, the column-index is required +function addXmlSpecialAdminAddDoReferralLevels () { + // So set it all here + $GLOBALS['__COLUMN_INDEX']['doXmlCallbackFunction'] = 'column'; + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_index'] = 'column'; +} + // [EOF] ?>