Some old lost copyright lines fixed, edit/delete admin functions rewritten
[mailer.git] / inc / functions.php
index f4fa1f7e6ae4d055188c7dc025d8476a9dc4a5d9..0bfa73075cb3eb8c3ec2584602d62f597008d900 100644 (file)
@@ -2405,6 +2405,35 @@ function RESET_ADD_INCLUDES () {
                UPDATE_CONFIG("last_month", $currMonth);
        } // END - if
 }
+// Handle extra values
+function HANDLE_EXTRA_VALUES ($filterFunction, $value, $extraValue) {
+       // Default is the value itself
+       $ret = $value;
+
+       // Do we have a special filter function?
+       if (!empty($filterFunction)) {
+               // Do we have extra parameters here?
+               if (!empty($extraValue)) {
+                       // Put both parameters in one new array by default
+                       $args = array($value, $extraValue);
+
+                       // If we have an array simply use it and pre-extend it with our value
+                       if (is_array($extraValue)) {
+                               // Make the new args array
+                               $args = array_merge(array($vaue), $extraValue);
+                       } // END - if
+
+                       // Call the multi-parameter call-back
+                       $ret = call_user_func_array($filterFunction, $args);
+               } else {
+                       // One parameter call
+                       $ret = call_user_func($filterFunction, $value);
+               }
+       } // END - if
+
+       // Return the value
+       return $ret;
+}
 //
 //////////////////////////////////////////////////
 //                                              //