* -------------------------------------------------------------------- *
* 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 *
} // 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);
// 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 = '<!-- [' . __FUNCTION__ . ':' . __LINE__.'] Call-back function ' . $callbackFunction . ' does not exist. //-->';
// Replace the code
$code = replaceExpressionCode($data, $replacer);
- // Load include once
- loadIncludeOnce('inc/math-functions.php');
-
// Return the (maybe) replaced code
return $code;
}
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
$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
// Expression call-back to handle jquery inclusion
function doExpressionJquery ($data) {
- // Default is compressed
- $jquery = 'jquery.js';
+ // Default is uncompressed
+ $scriptName = 'jquery';
+ $data['output_mode'] = '';
- // Is debug mode enabled?
- if ((isGetRequestElementSet('jquery')) || (isSessionVariableSet('jquery'))) {
- // Then use uncompressed
- $jquery = 'jquery-uncompressed.js';
+ // Is there JS-mode?
+ if ($data['callback'] == 'js') {
+ // Switch to it
+ $data['output_mode'] = ',js';
+ } // END - if
- // Remember it in session
- setSession('jquery', '1');
+ // Is there a value?
+ if (!empty($data['value'])) {
+ // Then load special library
+ $scriptName .= '-' . $data['value'];
} // END - if
+ // Is debug-mode enabled and parameter/session key 'jquery' given?
+ if ((!isDebugModeEnabled()) || ((!isGetRequestElementSet('jquery')) && (!isSessionVariableSet('jquery')))) {
+ // Productive systems want minimized version
+ $scriptName .= '.min';
+ } else {
+ // Debug version is uncompressed, remember it in session
+ setSession('jquery', '1');
+ }
+
// Add {%url%} around it
- $replacer = '{%url=js/' . $jquery . '?dummy=1%}';
+ $replacer = sprintf('{%%url%s=js/jquery/%s.js?dummy=1%%}', $data['output_mode'], $scriptName);
// Replace the code
$code = replaceExpressionCode($data, $replacer);
return $code;
}
-// [EOF]
-?>
+// Expression call-back to handle JavaScript inclusion
+function doExpressionJs ($data) {
+ /* DEBUG-DIE: */ die(sprintf('[%s:%d]: data=<pre>%s</pre>', __FUNCTION__, __LINE__, print_r($data, TRUE)));
+}