From a7f3cec3c03ac29c358b5cfd3241d2108e9cbc47 Mon Sep 17 00:00:00 2001 From: quix0r Date: Sat, 3 Nov 2012 23:07:42 +0000 Subject: [PATCH] Introduced new template helper 'doTemplateDeferrerUrl' to encapsulate generating uniform 'admin-testing-code' --- inc/template-functions.php | 12 ++++++++++++ templates/de/html/admin/admin_delete_email_bonus.tpl | 2 +- .../de/html/admin/admin_delete_email_normal.tpl | 2 +- .../de/html/admin/admin_delete_email_notify.tpl | 2 +- .../de/html/admin/admin_list_server_name_log_row.tpl | 2 +- .../de/html/admin/admin_list_sponsor_details.tpl | 2 +- 6 files changed, 17 insertions(+), 5 deletions(-) diff --git a/inc/template-functions.php b/inc/template-functions.php index 7bfe4b9ddd..208c2f2126 100644 --- a/inc/template-functions.php +++ b/inc/template-functions.php @@ -2239,6 +2239,18 @@ function doTemplatePointsPaymentMethodSelectionBox ($templateName, $clear = FALS return $content; } +// Template helper function to create a deferrer code if URL is not empty +function doTemplateDereferrerUrl ($templateName, $clear = FALSE, $url = NULL) { + // Is the URL not NULL and not empty? + if ((!is_null($url)) && (!empty($url))) { + // Set HTML with EL code + $url = '{--ADMIN_TEST_URL--}'; + } // END - if + + // Return URL (or content) or dashes if empty + return fixEmptyContentToDashes($url); +} + // Tries to anonymize some sensitive data (e.g. IP address, user agent, referrer, etc.) function anonymizeSensitiveData ($data) { // Trim it diff --git a/templates/de/html/admin/admin_delete_email_bonus.tpl b/templates/de/html/admin/admin_delete_email_bonus.tpl index 0dc3b484bc..10944f4822 100644 --- a/templates/de/html/admin/admin_delete_email_bonus.tpl +++ b/templates/de/html/admin/admin_delete_email_bonus.tpl @@ -16,7 +16,7 @@ $content[id] $content[subject] - {--ADMIN_TEST_URL--} + {%template,DereferrerUrl=$content[url]%} $content[timestamp] $content[count] diff --git a/templates/de/html/admin/admin_delete_email_normal.tpl b/templates/de/html/admin/admin_delete_email_normal.tpl index e9fdf88c26..dc3cad1cd5 100644 --- a/templates/de/html/admin/admin_delete_email_normal.tpl +++ b/templates/de/html/admin/admin_delete_email_normal.tpl @@ -17,7 +17,7 @@ {%pipe,generateUserProfileLink=$content[sender]%} $content[subject] - {--ADMIN_TEST_URL--} + {%template,DereferrerUrl=$content[url]%} $content[timestamp] diff --git a/templates/de/html/admin/admin_delete_email_notify.tpl b/templates/de/html/admin/admin_delete_email_notify.tpl index 4eb0776cbd..bb3ba3be0a 100644 --- a/templates/de/html/admin/admin_delete_email_notify.tpl +++ b/templates/de/html/admin/admin_delete_email_notify.tpl @@ -15,7 +15,7 @@ $content[id] $content[subject] - {--ADMIN_TEST_URL--} + {%template,DereferrerUrl=$content[url]%} $content[timestamp] $content[count] diff --git a/templates/de/html/admin/admin_list_server_name_log_row.tpl b/templates/de/html/admin/admin_list_server_name_log_row.tpl index 31f41718cb..fde1d99a71 100644 --- a/templates/de/html/admin/admin_list_server_name_log_row.tpl +++ b/templates/de/html/admin/admin_list_server_name_log_row.tpl @@ -12,7 +12,7 @@ {%pipe,fixEmptyContentToDashes=$content[server_name_ua]%} - {%pipe,generateDereferrerUrl,fixEmptyContentToDashes=$content[server_name_referrer]%} + {%template,DereferrerUrl=$content[server_name_referrer]%} $content[server_name_added] diff --git a/templates/de/html/admin/admin_list_sponsor_details.tpl b/templates/de/html/admin/admin_list_sponsor_details.tpl index f2979bf6f5..bff4efec28 100644 --- a/templates/de/html/admin/admin_list_sponsor_details.tpl +++ b/templates/de/html/admin/admin_list_sponsor_details.tpl @@ -65,7 +65,7 @@ {--SPONSOR_ENTER_URL--}: - [{--ADMIN_TEST_URL--}] + [{%template,DereferrerUrl=$content[url]%}] -- 2.39.5