]> git.mxchange.org Git - mailer.git/blobdiff - inc/callback-functions.php
Temporary configuration 'RAND_NUMBER' is now 'cached' in session variable, possibly...
[mailer.git] / inc / callback-functions.php
index d6d2b927e52ec1bc0fa543f5ca3f1c61bdf24b5e..55616a03685508e7fbbbf87f1b1bbd35e5c5923d 100644 (file)
@@ -49,6 +49,15 @@ function doXmlAdminEntryMetaData ($resource, $attributes) {
        } // END - if
 }
 
+// Handles the XML node 'member-entry-meta-data'
+function doXmlMemberEntryMetaData ($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 'callback-function'
 function doXmlCallbackFunction ($resource, $attributes) {
        // There are two attributes, by default
@@ -310,6 +319,18 @@ function doXmlExtraParameterReloadList ($resource, $attributes) {
        }
 }
 
+// Handles the XML node 'extra-parameter-waiting-list'
+function doXmlExtraParameterWaitingList ($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 because this is a foo-list node, got ' . count($attributes));
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['waiting_list'])) {
+               // This list should be created already
+               reportBug(__FUNCTION__, __LINE__, 'waiting_list should be already created.');
+       }
+}
+
 // Handles the XML node 'extra-parameter-member-list-entry'
 function doXmlExtraParameterMemberListEntry ($resource, $attributes) {
        // There are three attributes, by default
@@ -370,6 +391,36 @@ function doXmlExtraParameterReloadListEntry ($resource, $attributes) {
        addXmlValueToCallbackAttributes('extra_list', $attributes, 'reload_list');
 }
 
+// Handles the XML node 'extra-parameter-waiting-list-entry'
+function doXmlExtraParameterWaitingListEntry ($resource, $attributes) {
+       // There are three attributes, by default
+       if (count($attributes) != 3) {
+               // Not the right count
+               reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+       } elseif (!isset($attributes['NAME'])) {
+               // 'NAME' not found
+               reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
+       } elseif (!isset($attributes['TYPE'])) {
+               // 'TYPE' not found
+               reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+       } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+               // No valid type
+               reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+       } elseif (!isset($attributes['VALUE'])) {
+               // 'VALUE' not found
+               reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+               // Not valid/verifyable
+               reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['waiting_list'])) {
+               // doXmlCallbackFunction is missing
+               reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list/waiting-list not included around this node. Please fix your XML.');
+       }
+
+       // Add the entry to the list
+       addXmlValueToCallbackAttributes('extra_list', $attributes, 'waiting_list');
+}
+
 // Handles the XML node 'extra-parameter-added-list'
 function doXmlExtraParameterAddedList ($resource, $attributes) {
        // There should be no attributes
@@ -692,6 +743,15 @@ function doXmlAdminListData ($resource, $attributes) {
        } // END - if
 }
 
+// Handles the XML node 'member-list-data'
+function doXmlMemberListData ($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 'data-tables'
 function doXmlDataTables ($resource, $attributes) {
        // There should be no attributes
@@ -836,9 +896,6 @@ function doXmlWhereSelectFromListEntry ($resource, $attributes) {
        } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['CONDITION'])) {
                // 'CONDITION' not valid/verifyable
                reportBug(__FUNCTION__, __LINE__, 'Attribute CONDITION does not validate. CONDITION=' . $attributes['CONDITION']);
-       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['LOOK-FOR'])) {
-               // 'LOOK-FOR' not valid/verifyable
-               reportBug(__FUNCTION__, __LINE__, 'Attribute LOOK-FOR does not validate. LOOK-FOR=' . $attributes['LOOK-FOR']);
        } elseif (!isXmlConditionValid($attributes['CONDITION'])) {
                // 'CONDITION' is not known
                reportBug(__FUNCTION__, __LINE__, 'Attribute CONDITION is not valid. LOOK-FOR=' . $attributes['CONDITION']);
@@ -1257,7 +1314,7 @@ function addXmlValueToCallbackAttributes ($element, $attributes, $extraKey = '',
                $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][] = $attributes['VALUE'];
        } elseif (isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['NAME']])) {
                // Already created
-               reportBug(__FUNCTION__, __LINE__, 'NAME=' . $attributes['NAME'] . ' already addded to ' . $element . ' attributes=<pre>' . print_r($attributes, true) . '</pre>');
+               reportBug(__FUNCTION__, __LINE__, 'NAME=' . $attributes['NAME'] . ' already addded to ' . $element . ' attributes=<pre>' . print_r($attributes, TRUE) . '</pre>');
        } else {
                // Use from NAME
                //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',NAME=' . $attributes['NAME'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NAME!');
@@ -1279,7 +1336,7 @@ function doXmlCallbackFunctionExecute ($callbackName, $args, $columnIndex) {
        } // END - if
 
        // Just call it
-       //* DEBUG: */ die('callbackFunction=' . $callbackName . ',columnIndex=' . $columnIndex . ',args=<pre>'.print_r($args, true).'</pre>');
+       //* DEBUG: */ die(__FUNCTION__.':callbackFunction=' . $callbackName . ',columnIndex=' . $columnIndex . ',args=<pre>'.print_r($args, TRUE).'</pre>');
        call_user_func_array($callbackName, $args);
 }