]> git.mxchange.org Git - mailer.git/blobdiff - inc/xml-functions.php
Typos fixed
[mailer.git] / inc / xml-functions.php
index 8958bdb157f30000cfa7ccc8dfcd1ee7f2bb4701..f2de15092655addb342fd1f9639cf6512c4c7a81 100644 (file)
@@ -197,6 +197,15 @@ function isInvalidXmlType ($type) {
        return (in_array($type, array('string', 'array', 'bool', 'int')));
 }
 
+// Checks if given condition is valid
+function isXmlConditionValid ($condition) {
+       // Trim and make lower-case
+       $condition = trim(strtolower($condition));
+
+       // Is it valid?
+       return (in_array($condition, array('equals')));
+}
+
 // Checks if given value is valid/verifyable
 function isXmlValueValid ($type, $value) {
        // Depends on type, so build a call-back
@@ -212,5 +221,25 @@ function isXmlValueValid ($type, $value) {
        return call_user_func_array($callbackFunction, array($value));
 }
 
+// Converts given condition into a symbol
+function convertXmlContion ($condition) {
+       // Default is an invalid one
+       $return = '???';
+
+       // Detect the condition again
+       switch ($condition) {
+               case 'EQUALS': // Equals
+                       $return = '=';
+                       break;
+
+               default: // Unknown condition
+                       debug_report_bug(__FUNCTION__, __LINE__, 'Condition ' . $condition . ' is unknown/unsupported.');
+                       break;
+       } // END - switch
+
+       // Return it
+       return $return;
+}
+
 // [EOF]
 ?>