From: Roland Häder Date: Wed, 25 Nov 2009 22:26:10 +0000 (+0000) Subject: Filter support added to template engine, functions renamed X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=01c643fbb3dabb7953a6e9646113eb5742ebe3be Filter support added to template engine, functions renamed - 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 --- diff --git a/inc/filter-functions.php b/inc/filter-functions.php index 41e5adeca0..e96ab005b5 100644 --- a/inc/filter-functions.php +++ b/inc/filter-functions.php @@ -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'); diff --git a/inc/filters.php b/inc/filters.php index 1019759bde..2b43a8faa8 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -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('
'.print_r($matches, true).'
'); @@ -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.'); diff --git a/inc/language/de.php b/inc/language/de.php index 33fdb449fa..201ef9e171 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -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.", diff --git a/templates/de/html/page_body.tpl b/templates/de/html/page_body.tpl index 4803bf36cc..db8355c2d4 100644 --- a/templates/de/html/page_body.tpl +++ b/templates/de/html/page_body.tpl @@ -1,2 +1,2 @@ - +