]> git.mxchange.org Git - mailer.git/commitdiff
Filter support added to template engine, functions renamed
authorRoland Häder <roland@mxchange.org>
Wed, 25 Nov 2009 22:26:10 +0000 (22:26 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 25 Nov 2009 22:26:10 +0000 (22:26 +0000)
- Function FILTER_COMPILE_EXTENSION() is now known as FILTER_COMPILE_EXPRESSION_CODE()
- That function does now support the command 'filter', which can insert results
  from filter chains
- First filters 'body_on_load' and 'body_on_unload' added to template page_body.tpl

inc/filter-functions.php
inc/filters.php
inc/language/de.php
templates/de/html/page_body.tpl

index 41e5adeca08236ea36d2126e5457919c1cb259f9..e96ab005b547a10040be3c33188d53265b51db20 100644 (file)
@@ -163,7 +163,7 @@ ORDER BY
 
        // Compiling code
        registerFilter('compile_code', 'COMPILE_CONFIG');
-       registerFilter('compile_code', 'COMPILE_EXTENSION');
+       registerFilter('compile_code', 'COMPILE_EXPRESSION_CODE');
 
        // Generic extension update filters
        registerFilter('extension_update', 'UPDATE_EXTENSION_DATA');
index 1019759bdee08d74e290dda0760ec7cbc0122c71..2b43a8faa82a11eb79c1653352af98eeafd59b56 100644 (file)
@@ -443,11 +443,10 @@ function FILTER_COMPILE_CONFIG ($code, $compiled = false) {
        return $GLOBALS['compiled_config'][$uncompiled];
 }
 
-// Filter for compiling extension data
-function FILTER_COMPILE_EXTENSION ($code) {
-       // Compile {%cmd=some_value%} to get extension data
-       // Support cmd is:
-       //   - version -> getExtensionVersion() call
+// Filter for compiling expression code
+function FILTER_COMPILE_EXPRESSION_CODE ($code) {
+       // Compile {%cmd=some_value%} to get expression code snippets
+       // See switch() command below for supported commands
        preg_match_all('/\{%(([a-zA-Z0-9-_,]+)(=([^\}]+)){0,1})*%\}/', $code, $matches);
        //* DEBUG: */ print('<pre>'.print_r($matches, true).'</pre>');
 
@@ -555,6 +554,11 @@ function FILTER_COMPILE_EXTENSION ($code) {
                                        $code = str_replace($matches[0][$key], $configValue, $code);
                                        break;
 
+                               case 'filter':
+                                       // Run the filter and insert result
+                                       $code = str_replace($matches[0][$key], runFilterChain($matches[4][$key]), $code);
+                                       break;
+
                                default:
                                        // Unsupported command detected
                                        debug_report_bug('Command=' . $cmd . ', callback=' . $callback . ', extra=' . $extraFunction . ' is unsupported.');
index 33fdb449fafe14ec655ae927acf406f59df4c9bd..201ef9e1711fa6ab9135870a3ca43bf54a691c11 100644 (file)
@@ -97,6 +97,7 @@ addMessages(array(
        'ADMIN_REG_LOGIN' => "Geben Sie einen Loginnamen ein",
        'ADMIN_REG_PASS1' => "Vergeben Sie ein Passwort",
        'ADMIN_REG_PASS2' => "Passwort wiederholen",
+       'ADMIN_NO_PASS' => "Kein Passwort eingegeben!",
        'CLEAR_FORM' => "Nochmal eingeben",
        'ADMIN_REG_SUBMIT' => "Admin-Account erstellen",
        'ADMIN_NO_LOGIN' => "Sie haben keinen Loginnamen eingegeben.",
index 4803bf36ccb4c6eb4c4e78de757b069feed8e288..db8355c2d47c17f8dfbd7b25227501c4064f76e5 100644 (file)
@@ -1,2 +1,2 @@
-<body>
+<body onload="{%filter=body_on_load%}" onunload="{%filter=body_on_unload%}">
 <div class="masterbox" id="master">