From: Roland Häder Date: Sun, 25 Nov 2012 00:10:09 +0000 (+0000) Subject: Moved template helpers out of regular functions X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=1b80720b69d8de70d2119165cdf2e402b0514adf Moved template helpers out of regular functions --- diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index 331f588e2f..a00ba05614 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -9,7 +9,7 @@ ./inc/daily/daily_beg.php:52:// @TODO This should be converted in a daily beg rallye ./inc/daily/daily_birthday.php:99: // @TODO 4 is hard-coded here, should we move it out in config? ./inc/email-functions.php:109: * @TODO Rewrite this to an extension 'smtp' -./inc/email-functions.php:227:// @TODO $rawUserId is currently unused +./inc/email-functions.php:205:// @TODO $rawUserId is currently unused ./inc/expression-functions.php:173:// @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again ./inc/expression-functions.php:46: // @TODO is escapeQuotes() enough for strings with single/double quotes? ./inc/extensions/ext-html_mail.php:136: // @TODO Move these arrays into config @@ -56,10 +56,10 @@ ./inc/functions.php:1102: // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ? ./inc/functions.php:1188: // @TODO Are these convertions still required? ./inc/functions.php:1209:// @TODO Rewrite this function to use readFromFile() and writeToFile() -./inc/functions.php:1817: // @TODO Find a way to cache this -./inc/functions.php:1922: // @TODO This is still very static, rewrite it somehow -./inc/functions.php:2126: // @TODO Rename column data_type to e.g. mail_status -./inc/functions.php:2476:// @TODO cacheFiles is not yet supported +./inc/functions.php:1814: // @TODO Find a way to cache this +./inc/functions.php:1919: // @TODO This is still very static, rewrite it somehow +./inc/functions.php:2123: // @TODO Rename column data_type to e.g. mail_status +./inc/functions.php:2473:// @TODO cacheFiles is not yet supported ./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter ./inc/header.php:66:// @TODO Find a way to not use direct module comparison ./inc/install-functions.php:402: // @TODO Comparing with DEFAULT_MAIN_TITLE doesn't work diff --git a/inc/email-functions.php b/inc/email-functions.php index 1bd2e4e7d7..43cedae31e 100644 --- a/inc/email-functions.php +++ b/inc/email-functions.php @@ -201,28 +201,6 @@ function sendAdminNotification ($subject, $templateName, $content = array(), $us } } -// ---------------------------------------------------------------------------- -// Template helper functions -// ---------------------------------------------------------------------------- - -// Helper function to add extra headers to text mails -function doTemplateAddExtraTextMailHeaders ($templateName, $clear, $extraHeaders = '') { - // Run the header through the filter - $extraHeaders = runFilterChain('add_extra_text_mail_headers', $extraHeaders); - - // And return it - return $extraHeaders; -} - -// Helper function to add extra headers to HTML mails -function doTemplateAddExtraHtmlMailHeaders ($templateName, $clear, $extraHeaders = '') { - // Run the header through the filter - $extraHeaders = runFilterChain('add_extra_html_mail_headers', $extraHeaders); - - // And return it - return $extraHeaders; -} - // Send mails for del/edit/lock build modes // @TODO $rawUserId is currently unused function sendGenericBuildMails ($mode, $tableName, $content, $id, $subjectPart = '', $userIdColumn = array('userid'), $rawUserId = array('userid')) { @@ -271,5 +249,27 @@ function sendGenericBuildMails ($mode, $tableName, $content, $id, $subjectPart = } } +// ---------------------------------------------------------------------------- +// Template helper functions +// ---------------------------------------------------------------------------- + +// Helper function to add extra headers to text mails +function doTemplateAddExtraTextMailHeaders ($templateName, $clear, $extraHeaders = '') { + // Run the header through the filter + $extraHeaders = runFilterChain('add_extra_text_mail_headers', $extraHeaders); + + // And return it + return $extraHeaders; +} + +// Helper function to add extra headers to HTML mails +function doTemplateAddExtraHtmlMailHeaders ($templateName, $clear, $extraHeaders = '') { + // Run the header through the filter + $extraHeaders = runFilterChain('add_extra_html_mail_headers', $extraHeaders); + + // And return it + return $extraHeaders; +} + // [EOF] ?>