X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fexpression-functions.php;h=9bd74b48cc5d8597a530457668ddb2b22641c38f;hb=61621983cc6d7195fcc7eab29b5f6080ff283b34;hp=3e8da702f936ba04e5f8e5d034e9aa767d54e5e0;hpb=c5e4e7531db6a636c66ba2e672b832f9a13be648;p=mailer.git diff --git a/inc/expression-functions.php b/inc/expression-functions.php index 3e8da702f9..9bd74b48cc 100644 --- a/inc/expression-functions.php +++ b/inc/expression-functions.php @@ -10,13 +10,8 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Expression-Callback-Funktionen * * -------------------------------------------------------------------- * - * $Revision:: $ * - * $Date:: $ * - * $Tag:: 0.2.1-FINAL $ * - * $Author:: $ * - * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2016 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -157,7 +152,7 @@ function doExpressionExt ($data) { } // END - if // Generate replacer - $replacer = sprintf("&ext=%s&ver=%s&rev={?CURRENT_REPOSITORY_REVISION?}", $data['matches'][4][$data['key']], $replacer); + $replacer = sprintf('&ext=%s&ver=%s', $data['matches'][4][$data['key']], $replacer); // Replace it and insert parameter for GET request $code = replaceExpressionCode($data, $replacer); @@ -281,7 +276,7 @@ function doExpressionMessage ($data) { // Expression call-back for template functions function doExpressionTemplate ($data) { // Construct call-back function name - $callbackFunction = 'doTemplate' . $data['callback']; + $callbackFunction = 'doTemplate' . ucfirst($data['callback']); // Init replacer $replacer = ''; @@ -444,7 +439,7 @@ function doExpressionForm ($data) { if ($value == 'formmethodpost') { // Use it $data['__form_method'] = 'post'; - } elseif (($value == 'formmethodpost') && (!isSpider()) && (!isSessionValid())) { + } elseif (($value == 'formmethodpost') && (!isSpider()) && (!isValidSession())) { // Then expand 'value' with session id if (strpos($data['value'], '?') !== FALSE) { // '?' is set @@ -467,7 +462,7 @@ function doExpressionForm ($data) { $data['__form_id'] = substr($value, 6); } elseif (substr($value, 0, 6) == 'server') { // {%server,foo%} found - $data['__server'] = '{%server=' . substr($value, 6) . '%}'; + $data['__server'] = '{%server,' . substr($value, 6) . '%}'; } } // END - foreach @@ -524,19 +519,32 @@ function doExpressionFormClose ($data) { // Expression call-back to handle jquery inclusion function doExpressionJquery ($data) { // Default is compressed - $jquery = 'jquery.js'; + $jquery = 'jquery'; + $data['output_mode'] = ''; + + // Is there JS-mode? + if ($data['callback'] == 'js') { + // Switch to it + $data['output_mode'] = ',js'; + } // END - if + + // Is there a value? + if ($data['callback'] == 'js') { + // Then load special library + $jquery .= '-' . $data['value']; + } // END - if // Is debug mode enabled? if ((isGetRequestElementSet('jquery')) || (isSessionVariableSet('jquery'))) { // Then use uncompressed - $jquery = 'jquery-uncompressed.js'; + $jquery .= '.uncompressed'; // Remember it in session setSession('jquery', '1'); } // END - if // Add {%url%} around it - $replacer = '{%url=js/' . $jquery . '?dummy=1%}'; + $replacer = '{%url' . $data['output_mode'] . '=js/' . $jquery . '.js?dummy=1%}'; // Replace the code $code = replaceExpressionCode($data, $replacer);