X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fxml-functions.php;h=f2de15092655addb342fd1f9639cf6512c4c7a81;hb=cf6871becb7cc557fe28de464adfcb23cc3df3c9;hp=8958bdb157f30000cfa7ccc8dfcd1ee7f2bb4701;hpb=d6417790061e18fc1a9770ff93bb4e9d106b2f6e;p=mailer.git diff --git a/inc/xml-functions.php b/inc/xml-functions.php index 8958bdb157..f2de150926 100644 --- a/inc/xml-functions.php +++ b/inc/xml-functions.php @@ -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] ?>