]> git.mxchange.org Git - mailer.git/blobdiff - inc/expression-functions.php
Fixes for broken saving config in ext-yoomedia
[mailer.git] / inc / expression-functions.php
index 47da9de13818aff53d7dc1bfbf76f85613678ac5..c8129ddb21dc2072b52edb1ff0b8cff43c2481f0 100644 (file)
@@ -65,7 +65,7 @@ function isExpressionFunctionAvaiable ($data) {
                        // Add non-empty parts
                        if (!empty($piece)) {
                                // Add it
-                               $functionName .= ucfirst(strtolower($piece));
+                               $functionName .= capitalizeUnderscoreString($piece);
                        } // END - if
                } // END - foreach
 
@@ -146,7 +146,7 @@ function doExpressionExt ($data) {
        // Is the extension installed?
        if (isExtensionInstalled($data['matches'][4][$data['key']])) {
                // Construct call-back function name
-               $functionName = 'getExtension' . ucfirst(strtolower($data['callback']));
+               $functionName = 'getExtension' . capitalizeUnderscoreString($data['callback']);
 
                // Construct call of the function
                $replacer = "{DQUOTE} . call_user_func_array('" . $functionName . "', array('" . $data['matches'][4][$data['key']] . "', true)) . {DQUOTE}";
@@ -168,7 +168,7 @@ function doExpressionConfig ($data) {
        // Do we have a special expression function for it?
        if (isExpressionFunctionAvaiable($data)) {
                // Then use it
-               $replacer = '{DQUOTE}  . ' . $data['callback'] . '('.getExpressionFunction($data).'(' . "'" . $data['matches'][4][$data['key']] . "'" . ')) . {DQUOTE}';
+               $replacer = '{DQUOTE}  . ' . $data['callback'] . '(' . getExpressionFunction($data) . '()) . {DQUOTE}';
        } else {
                // Default replacer is the config value itself
                $replacer = '{DQUOTE}  . ' . $data['callback'] . '(getConfig(' . "'" . $data['matches'][4][$data['key']] . "'" . ')) . {DQUOTE}';
@@ -301,5 +301,29 @@ function doExpressionMath ($data) {
        return $code;
 }
 
+// Expression call-back for GET request
+function doExpressionGet ($data) {
+       // Construct the replacer
+       $replacer = '{%pipe,getRequestParameter=' . $data['value'] . '%}';
+
+       // Replace the code
+       $code = replaceExpressionCode($data, $replacer);
+
+       // Return the (maybe) replaced code
+       return $code;
+}
+
+// Expression call-back for POST request
+function doExpressionPost ($data) {
+       // Construct the replacer
+       $replacer = '{%pipe,postRequestParameter=' . $data['value'] . '%}';
+
+       // Replace the code
+       $code = replaceExpressionCode($data, $replacer);
+
+       // Return the (maybe) replaced code
+       return $code;
+}
+
 // [EOF]
 ?>