// 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. //-->';
$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';
+ $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);