// Handles the XML node 'admin-entry-meta-data'
function doXmlAdminEntryMetaData ($resource, $attributes) {
- /*
- * This node has no attributes by default so it remains just with this
- * comment.
- */
+ // There should be no attributes
+ if (count($attributes) > 0) {
+ // Please don't add any attributes to foo-list nodes
+ debug_report_bug(__FUNCTION__, __LINE__, 'Expected 0 attributes, got ' . count($attributes));
+ } // END - if
}
-// Handles the XML node 'admin-callback-function'
-function doXmlAdminCallbackFunction ($resource, $attributes) {
+// Handles the XML node 'callback-function'
+function doXmlCallbackFunction ($resource, $attributes) {
// There are two attributes, by default
if (count($attributes) != 2) {
// Not the right count
} elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
// Not valid/verifyable
debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
- } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'])) {
- // doXmlAdminCallbackFunction is missing
- debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function not included around this node. Please fix your XML.');
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
}
// Add the POST data index for 'id'
- $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['id_index'] = $attributes['VALUE'];
+ addXmlValueToCallbackAttributes('id_index', $attributes);
+ //$GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['id_index'] = $attributes['VALUE'];
}
// Handles the XML node 'database-table'
} elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
// Not valid/verifyable
debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
- } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'])) {
- // doXmlAdminCallbackFunction is missing
- debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function not included around this node. Please fix your XML.');
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
}
- // Add the database's name
- $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['database_table'] = $attributes['VALUE'];
+ // Add the entry to the list
+ addXmlValueToCallbackAttributes('database_table', $attributes);
+ //$GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['database_table'] = $attributes['VALUE'];
}
// Handles the XML node 'database-column-list'
} // END - if
// Add an empty list
- $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['column_list'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_list'] = array();
}
// Handles the XML node 'database-column-list-entry'
} elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
// Not valid/verifyable
debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
- } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['column_list'])) {
- // doXmlAdminCallbackFunction is missing
- debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function/database-column-list not included around this node. Please fix your XML.');
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_list'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/database-column-list not included around this node. Please fix your XML.');
}
// Add the entry to the list
} // END - if
// Add an empty list
- $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['callback_list'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['callback_list'] = array();
}
// Handles the XML node 'callback-function-list-entry'
} elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
// Not valid/verifyable
debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
- } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['callback_list'])) {
- // doXmlAdminCallbackFunction is missing
- debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function/callback-function-list not included around this node. Please fix your XML.');
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['callback_list'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/callback-function-list not included around this node. Please fix your XML.');
}
// Add the entry to the list
} // END - if
// Add an empty list
- $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['extra_list'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list'] = array();
}
// Handles the XML node 'extra-parameter-list-entry'
} elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
// Not valid/verifyable
debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
- } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['extra_list'])) {
- // doXmlAdminCallbackFunction is missing
- debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function/extra-parameter-list not included around this node. Please fix your XML.');
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list not included around this node. Please fix your XML.');
}
// Add the entry to the list
if (count($attributes) > 0) {
// Please don't add any attributes to foo-list nodes
debug_report_bug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
- } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['extra_list']['member_list'])) {
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['member_list'])) {
// This list should be created already
debug_report_bug(__FUNCTION__, __LINE__, 'member_list should be already created.');
}
} elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
// Not valid/verifyable
debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
- } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['extra_list']['member_list'])) {
- // doXmlAdminCallbackFunction is missing
- debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function/extra-parameter-list/member-list not included around this node. Please fix your XML.');
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['member_list'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list/member-list not included around this node. Please fix your XML.');
}
// Add the entry to the list
} elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
// Not valid/verifyable
debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
- } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'])) {
- // doXmlAdminCallbackFunction is missing
- debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function not included around this node. Please fix your XML.');
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__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']['doXmlAdminCallbackFunction']['status_list'][$attributes['VALUE']] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['status_list'][$attributes['VALUE']] = array();
}
// Handles the XML node 'status-change-list'
if (count($attributes) > 0) {
// Please don't add any attributes to foo-list nodes
debug_report_bug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
- } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['status_list'])) {
- // doXmlAdminCallbackFunction is missing
- debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function/status-list not included around this node. Please fix your XML.');
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['status_list'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/status-list not included around this node. Please fix your XML.');
}
}
} elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
// Not valid/verifyable
debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
- } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['status_list'])) {
- // doXmlAdminCallbackFunction is missing
- debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function/extra-parameter-list/member-list not included around this node. Please fix your XML.');
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['status_list'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list/member-list not included around this node. Please fix your XML.');
}
// Add the entry to the list
} elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
// Not valid/verifyable
debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
- } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'])) {
- // doXmlAdminCallbackFunction is missing
- debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function not included around this node. Please fix your XML.');
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
}
- // Add the entry to the array
- $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['enable_modify_entries'] = convertStringToBoolean($attributes['VALUE']);
+ // Add the entry to the list
+ addXmlValueToCallbackAttributes('enable_modify_entries', $attributes);
+ //$GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['enable_modify_entries'] = convertStringToBoolean($attributes['VALUE']);
}
// Handles the XML node 'table-id-column'
} elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
// Not valid/verifyable
debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
- } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'])) {
- // doXmlAdminCallbackFunction is missing
- debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function not included around this node. Please fix your XML.');
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
}
// Add the entry to the array
- $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['table_id_column'] = $attributes['VALUE'];
+ addXmlValueToCallbackAttributes('table_id_column', $attributes);
+ //$GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['table_id_column'] = $attributes['VALUE'];
}
// Handles the XML node 'table-userid-column'
} elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
// Not valid/verifyable
debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
- } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'])) {
- // doXmlAdminCallbackFunction is missing
- debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function not included around this node. Please fix your XML.');
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
}
// Add the entry to the array
- $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['table_userid_column'] = $attributes['VALUE'];
+ addXmlValueToCallbackAttributes('table_userid_column', $attributes);
+ //$GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['table_userid_column'] = $attributes['VALUE'];
}
// Handles the XML node 'raw-userid-column-key'
} elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
// Not valid/verifyable
debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
- } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'])) {
- // doXmlAdminCallbackFunction is missing
- debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function not included around this node. Please fix your XML.');
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
+ }
+
+ // Add the entry to the array
+ addXmlValueToCallbackAttributes('raw_userid_column_key', $attributes);
+ //$GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['raw_userid_column_key'] = $attributes['VALUE'];
+}
+
+//-----------------------------------------------------------------------------
+// Call-back functions for listing of data in admin area
+//-----------------------------------------------------------------------------
+
+// Handles the XML node 'admin-list-data'
+function doXmlAdminListData ($resource, $attributes) {
+ // There should be no attributes
+ if (count($attributes) > 0) {
+ // Please don't add any attributes to foo-list nodes
+ debug_report_bug(__FUNCTION__, __LINE__, 'Expected 0 attributes, got ' . count($attributes));
+ } // END - if
+}
+
+// Handles the XML node 'data-tables'
+function doXmlDataTables ($resource, $attributes) {
+ // There should be no attributes
+ if (count($attributes) > 0) {
+ // Please don't add any attributes to foo-list nodes
+ debug_report_bug(__FUNCTION__, __LINE__, 'Expected 0 attributes, got ' . count($attributes));
+ } // END - if
+}
+
+// Handles the XML node 'data-table'
+function doXmlDataTable ($resource, $attributes) {
+ // There are three attributes, by default
+ if (count($attributes) != 3) {
+ // Not the right count
+ debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+ } elseif (!isset($attributes['VALUE'])) {
+ // 'VALUE' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+ } elseif (!isset($attributes['TYPE'])) {
+ // 'TYPE' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+ } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+ // No valid type
+ debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+ } elseif (!isset($attributes['ALIAS'])) {
+ // 'ALIAS' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute ALIAS not found.');
+ } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+ // Not valid/verifyable
+ debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
+ } elseif ((trim($attributes['ALIAS']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['ALIAS']))) {
+ // Not valid/verifyable
+ debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. ALIAS=' . $attributes['ALIAS']);
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
+ }
+
+ // Add the entry to the array
+ addXmlValueToCallbackAttributes('data_table', $attributes);
+}
+
+// Handles the XML node 'select-data-from-list'
+function doXmlSelectDataFromList ($resource, $attributes) {
+ // There should be no attributes
+ if (count($attributes) > 0) {
+ // Please don't add any attributes to foo-list nodes
+ debug_report_bug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-table not included around this node. Please fix your XML.');
+ }
+
+ // Add an empty list
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_column_list'] = array();
+}
+
+// Handles the XML node 'select-data-from-list-entry'
+function doXmlSelectDataFromListEntry ($resource, $attributes) {
+ // There are five attributes, by default
+ if (count($attributes) != 5) {
+ // Not the right count
+ debug_report_bug(__FUNCTION__, __LINE__, 'Expected 5 attributes, got ' . count($attributes));
+ } elseif (!isset($attributes['VALUE'])) {
+ // 'VALUE' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+ } elseif (!isset($attributes['TYPE'])) {
+ // 'TYPE' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+ } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+ // No valid type
+ debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+ } elseif (!isset($attributes['ALIAS'])) {
+ // 'ALIAS' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute ALIAS not found.');
+ } elseif (!isset($attributes['FUNCTION'])) {
+ // 'FUNCTION' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute FUNCTION not found.');
+ } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+ // 'VALUE' not valid/verifyable
+ debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
+ } elseif ((trim($attributes['ALIAS']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['ALIAS']))) {
+ // 'ALIAS' not valid/verifyable
+ debug_report_bug(__FUNCTION__, __LINE__, 'Attribute ALIAS does not validate. ALIAS=' . $attributes['ALIAS']);
+ } elseif ((trim($attributes['FUNCTION']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['FUNCTION']))) {
+ // 'FUNCTION' not valid/verifyable
+ debug_report_bug(__FUNCTION__, __LINE__, 'Attribute FUNCTION does not validate. FUNCTION=' . $attributes['FUNCTION']);
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_column_list'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/select-data-from-list not included around this node. Please fix your XML.');
+ }
+
+ // Add the entry to the array
+ addXmlValueToCallbackAttributes('data_column_list', $attributes);
+}
+
+// Handles the XML node 'where-select-from-list'
+function doXmlWhereSelectFromList ($resource, $attributes) {
+ // There should be no attributes
+ if (count($attributes) > 0) {
+ // Please don't add any attributes to foo-list nodes
+ debug_report_bug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-table not included around this node. Please fix your XML.');
+ }
+
+ // Add an empty list
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['where_select_list'] = array();
+}
+
+// Handles the XML node 'order-by-list'
+function doXmlOrderByList ($resource, $attributes) {
+ // There should be no attributes
+ if (count($attributes) > 0) {
+ // Please don't add any attributes to foo-list nodes
+ debug_report_bug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-table not included around this node. Please fix your XML.');
+ }
+
+ // Add an empty list
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['order_by_list'] = array();
+}
+
+// Handles the XML node 'order-by-list-entry'
+function doXmlOrderByListEntry ($resource, $attributes) {
+ // There are four attributes, by default
+ if (count($attributes) != 4) {
+ // Not the right count
+ debug_report_bug(__FUNCTION__, __LINE__, 'Expected 5 attributes, got ' . count($attributes));
+ } elseif (!isset($attributes['ORDER'])) {
+ // 'ORDER' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute ORDER not found.');
+ } elseif (!isset($attributes['TYPE'])) {
+ // 'TYPE' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+ } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+ // No valid type
+ debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+ } elseif (!isset($attributes['TABLE'])) {
+ // 'TABLE' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TABLE not found.');
+ } elseif (!isset($attributes['VALUE'])) {
+ // 'VALUE' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+ } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['ORDER'])) {
+ // 'ORDER' not valid/verifyable
+ debug_report_bug(__FUNCTION__, __LINE__, 'Attribute ORDER does not validate. ORDER=' . $attributes['ORDER']);
+ } elseif ((trim($attributes['TABLE']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['TABLE']))) {
+ // 'TABLE' not valid/verifyable
+ debug_report_bug(__FUNCTION__, __LINE__, 'Attribute TABLE does not validate. TABLE=' . $attributes['TABLE']);
+ } elseif ((trim($attributes['VALUE']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE']))) {
+ // 'VALUE' not valid/verifyable
+ debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_column_list'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-column-list not included around this node. Please fix your XML.');
+ }
+
+ // Add the entry to the array
+ addXmlValueToCallbackAttributes('order_by_list', $attributes);
+}
+
+// Handles the XML node 'list-template'
+function doXmlListTemplate ($resource, $attributes) {
+ // There are two attributes, by default
+ if (count($attributes) != 2) {
+ // Not the right count
+ debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+ } elseif (!isset($attributes['VALUE'])) {
+ // 'VALUE' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+ } elseif (!isset($attributes['TYPE'])) {
+ // 'TYPE' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+ } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+ // No valid type
+ debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+ } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+ // Not valid/verifyable
+ debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
}
// Add the entry to the array
- $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['raw_userid_column_key'] = $attributes['VALUE'];
+ addXmlValueToCallbackAttributes('list_template', $attributes);
+}
+
+// Handles the XML node 'list-row-template'
+function doXmlListRowTemplate ($resource, $attributes) {
+ // There are two attributes, by default
+ if (count($attributes) != 2) {
+ // Not the right count
+ debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+ } elseif (!isset($attributes['VALUE'])) {
+ // 'VALUE' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+ } elseif (!isset($attributes['TYPE'])) {
+ // 'TYPE' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+ } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+ // No valid type
+ debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+ } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+ // Not valid/verifyable
+ debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
+ }
+
+ // Add the entry to the array
+ addXmlValueToCallbackAttributes('list_row_template', $attributes);
+}
+
+// Handles the XML node 'column-callback-list'
+function doXmlColumnCallbackList ($resource, $attributes) {
+ // There should be no attributes
+ if (count($attributes) > 0) {
+ // Please don't add any attributes to foo-list nodes
+ debug_report_bug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/data-table not included around this node. Please fix your XML.');
+ }
+
+ // Add an empty list
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_callback_list'] = array();
}
-// ----------------------------------------------------------------------------
-// XML type validation
-// ----------------------------------------------------------------------------
+// Handles the XML node 'column-callback-list-entry'
+function doXmlColumnCallbackListEntry ($resource, $attributes) {
+ // There should be no attributes
+ if (count($attributes) > 0) {
+ // Please don't add any attributes to foo-list nodes
+ debug_report_bug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_callback_list'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/column-callback not included around this node. Please fix your XML.');
+ }
+}
+
+// Handles the XML node 'column-callback-data'
+function doXmlColumnCallbackData ($resource, $attributes) {
+ // There are three attributes, by default
+ if (count($attributes) != 3) {
+ // Not the right count
+ debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+ } elseif (!isset($attributes['VALUE'])) {
+ // 'VALUE' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+ } elseif (!isset($attributes['TYPE'])) {
+ // 'TYPE' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+ } elseif (!isset($attributes['CALLBACK'])) {
+ // 'CALLBACK' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute CALLBACK not found.');
+ } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+ // No valid type
+ debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+ } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+ // Not valid/verifyable
+ debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
+ } elseif ((trim($attributes['CALLBACK']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['CALLBACK']))) {
+ // 'CALLBACK' not valid/verifyable
+ debug_report_bug(__FUNCTION__, __LINE__, 'Attribute CALLBACK does not validate. CALLBACK=' . $attributes['CALLBACK']);
+ }
+
+ // Add the entry to the array
+ addXmlValueToCallbackAttributes('column_callback_list', $attributes);
+}
+
+// Handles the XML node 'callback-extra-parameter-list'
+function doXmlCallbackExtraParameterList ($resource, $attributes) {
+ // There should be no attributes
+ if (count($attributes) > 0) {
+ // Please don't add any attributes to foo-list nodes
+ debug_report_bug(__FUNCTION__, __LINE__, 'Expected 1 attributes because this is a named foo-list node, got ' . count($attributes));
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_callback_list'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/column-callback-list not included around this node. Please fix your XML.');
+ } elseif (isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['__EXTRA_PARAMETER'])) {
+ // Abort silently here, no one wants to kill this array
+ return;
+ }
+
+ // Add an empty list
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['__EXTRA_PARAMETER'] = array();
+}
+
+// Handles the XML node 'callback-extra-parameter-list-entry'
+function doXmlCallbackExtraParameterListEntry ($resource, $attributes) {
+ // There are three attributes, by default
+ if (count($attributes) != 3) {
+ // Not the right count
+ debug_report_bug(__FUNCTION__, __LINE__, 'Expected 5 attributes, got ' . count($attributes));
+ } elseif (!isset($attributes['COLUMN'])) {
+ // 'COLUMN' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute COLUMN not found.');
+ } elseif (!isset($attributes['TYPE'])) {
+ // 'TYPE' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+ } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+ // No valid type
+ debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+ } elseif (!isset($attributes['VALUE'])) {
+ // 'VALUE' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+ } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+ // 'VALUE' not valid/verifyable
+ debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['__EXTRA_PARAMETER'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/__EXTRA_PARAMETER not included around this node. Please fix your XML.');
+ }
+
+ // Add the entry to the array
+ addXmlValueToCallbackAttributes('__EXTRA_PARAMETER', $attributes);
+}
+
+// Handles the XML node 'no-entry-found-message'
+function doXmlNoEntryFoundMessage ($resource, $attributes) {
+ // There are two attributes, by default
+ if (count($attributes) != 2) {
+ // Not the right count
+ debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+ } elseif (!isset($attributes['VALUE'])) {
+ // 'VALUE' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+ } elseif (!isset($attributes['TYPE'])) {
+ // 'TYPE' not found
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+ } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+ // No valid type
+ debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+ } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+ // Not valid/verifyable
+ debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. VALUE=' . $attributes['VALUE']);
+ } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'])) {
+ // doXmlCallbackFunction is missing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function not included around this node. Please fix your XML.');
+ }
+
+ // Add the entry to the array
+ addXmlValueToCallbackAttributes('no_entry_message_id', $attributes);
+}
+
+//-----------------------------------------------------------------------------
+// XML type validation
+//-----------------------------------------------------------------------------
// Checks for string without any added extra data
function isXmlTypeString ($value) {
return (($value == 'true') || ($value == 'false'));
}
-// ----------------------------------------------------------------------------
+// Check for integer type
+function isXmlTypeInt ($value) {
+ // Trim value
+ $value = trim($value);
+
+ // This value is always a string
+ return (bigintval($value) == $value);
+}
+
+//-----------------------------------------------------------------------------
// Private XML functions
-// ----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
// Adds given attribut to element
function addXmlValueToCallbackAttributes ($element, $attributes, $extraKey = '', $key = '') {
+ // What do we need to add?
+ /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',key=' . $key . ' - ENTERED!');
if ($attributes['TYPE'] == 'array') {
// Another nested array
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'TYPE=ARRAY, element=' . $element);
- $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'][$element][$attributes['VALUE'] . '_list'] = array();
+ /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'TYPE=ARRAY, element=' . $element);
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['VALUE'] . '_list'] = array();
} elseif (!empty($extraKey)) {
// Is it bool?
- if ($attributes['TYPE'] == 'bool') {
+ if (($attributes['TYPE'] == 'bool') && (isset($attributes['VALUE']))) {
// Then convert VALUE
$attributes['VALUE'] = convertStringToBoolean($attributes['VALUE']);
} // END - if
// Sub-array (one level only)
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE='.$attributes['TYPE'].',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE']);
+ /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ' - ANALYSING...');
if (trim($attributes['NAME']) == '') {
// Numerical index
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE='.$attributes['TYPE'].',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NUMERICAL!');
- $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'][$element][$extraKey][] = $attributes['VALUE'];
+ /* 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'];
} elseif (!empty($key)) {
// Use from $key
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE='.$attributes['TYPE'].',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - KEY! (key=' . $attributes[$key] . ')');
- $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'][$element][$extraKey][$attributes[$key]] = $attributes['VALUE'];
+ /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'].',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - KEY! (key=' . $attributes[$key] . ')');
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey][$attributes[$key]] = $attributes['VALUE'];
} else {
// Use from NAME
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE='.$attributes['TYPE'].',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NAME! (name=' . $attributes['NAME'] . ')');
- $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'][$element][$extraKey][$attributes['NAME']] = $attributes['VALUE'];
+ /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'].',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NAME! (NAME=' . $attributes['NAME'] . ')');
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey][$attributes['NAME']] = $attributes['VALUE'];
}
- } elseif (trim($attributes['NAME']) == '') {
+ } elseif ((isset($attributes['FUNCTION'])) && (isset($attributes['ALIAS']))) {
+ /*
+ * ALIAS and FUNCTION detected? This may happen with SQL queries
+ * like: UNIX_TIMESTAMP(`foo_timestamp`) AS `foo_timestamp`
+ */
+ // Init array
+ $array = array(
+ 'column' => trim($attributes['VALUE']),
+ 'alias' => trim($attributes['ALIAS']),
+ 'function' => trim($attributes['FUNCTION']),
+ 'table' => trim($attributes['TABLE'])
+ );
+
+ // 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;
+ } 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'] . ')');
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['VALUE']] = $attributes['CALLBACK'];
+ } elseif (isset($attributes['ORDER'])) {
+ // 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['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']) == '')) {
// Numerical index
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE']);
- $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'][$element][] = $attributes['VALUE'];
- } elseif (isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'][$element][$attributes['NAME']])) {
+ /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NUMERICAL!');
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][] = $attributes['VALUE'];
+ } elseif (isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['NAME']])) {
// Already created
- debug_report_bug(__FUNCTION__, __LINE__, 'NAME=' . $attributes['NAME'] . ' already addded to ' . $element . '.');
+ debug_report_bug(__FUNCTION__, __LINE__, 'NAME=' . $attributes['NAME'] . ' already addded to ' . $element . ' attributes=<pre>' . print_r($attributes, true) . '</pre>');
} else {
// Use from NAME
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',NAME=' . $attributes['NAME'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE']);
- $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'][$element][$attributes['NAME']] = $attributes['VALUE'];
+ /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',NAME=' . $attributes['NAME'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NAME!');
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['NAME']] = $attributes['VALUE'];
}
+ /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',key=' . $key . ' - EXIT!');
}
-// ----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
// Execute call-back functions
-// ----------------------------------------------------------------------------
-
-// Execute function for doXmlAdminCallbackFunction()
-function doXmlAdminCallbackFunctionExecute ($function, $args) {
- // Prepare 'id_index'
- $args['id_index'] = postRequestParameter($args['id_index']);
+//-----------------------------------------------------------------------------
+
+// Execute function for doXmlCallbackFunction()
+function doXmlCallbackFunctionExecute ($function, $args) {
+ // Is 'id_index' set and form sent?
+ if ((isset($args['id_index'])) && (isFormSent())) {
+ // Prepare 'id_index'
+ $args['id_index'] = postRequestParameter($args['id_index']);
+ } // END - if
// Just call it
//* DEBUG: */ die('<pre>'.print_r($args, true).'</pre>');