From: Roland Häder Date: Sun, 29 Aug 2010 22:14:01 +0000 (+0000) Subject: Naming convention applied to language strings, new API function added: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9553dbc9eed40bfa2beffa79813f2d5cd21fa8ac;p=mailer.git Naming convention applied to language strings, new API function added: - Naming convention applied on many language strings (guest/admin) - New API function getConfirmationMessageFromUserStatus() introduced - TODOs.txt updated --- diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index ecde42a1f5..1ae53b9adc 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -49,10 +49,10 @@ ./inc/functions.php:2261: // @TODO This is still very static, rewrite it somehow ./inc/gen_sql_patches.php:96:// @TODO Rewrite this to a filter ./inc/install-functions.php:59: // @TODO DEACTIVATED: changeDataInFile(getCachePath() . 'config-local.php', 'OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0); -./inc/language/de.php:1099:// @TODO Rewrite these two constants -./inc/language/de.php:1114:// @TODO Rewrite these three constants +./inc/language/de.php:1101:// @TODO Rewrite these two constants +./inc/language/de.php:1116:// @TODO Rewrite these three constants ./inc/language/de.php:300: // @TODO Following two are unused? -./inc/language/de.php:799:// @TODO Are these constants longer used? +./inc/language/de.php:801:// @TODO Are these constants longer used? ./inc/language-functions.php:234: // @TODO These are all valid languages, again hard-coded ./inc/language-functions.php:46:// @TODO Rewrite all language constants to this function. ./inc/language/newsletter_de.php:13: * @TODO This language file is completely out-dated, please do no * diff --git a/inc/language/de.php b/inc/language/de.php index 96f5900eaa..21f6321240 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -127,9 +127,9 @@ addMessages(array( 'YOU_ARE_HERE' => "Sie sind hier:", 'ID_SELECT' => "ID:", 'KEY_SELECT' => "Eintrag:", - 'DISPLAY_ACTION' => "Aktion", - 'DISPLAY_WHAT' => "Unteraktion", - 'DISPLAY_TITLE' => "Titel", + 'ADMIN_DISPLAY_ACTION' => "Aktion", + 'ADMIN_DISPLAY_WHAT' => "Unteraktion", + 'ADMIN_DISPLAY_TITLE' => "Titel", 'UNDO_SELECTIONS' => "Auswahl zurücknehmen", 'ADMIN_EDIT_MENUS' => "Menüs bearbeiten", 'ADMIN_DELETE_MENUS' => "Menüs löschen", @@ -149,16 +149,16 @@ addMessages(array( 'ADMIN_ADD_MENU' => "Menü hinzufügen", 'ADMIN_ENTER_TITLE' => "Geben Sie den Linktitel zum neuen Menüpunkt ein", 'ADMIN_SELECT_PARENT_MENU' => "Wählen Sie das übergeordnete Hauptmenü aus", - 'IS_TOP_MENU' => "Ist ein Hauptmenü", + 'ADMIN_IS_TOP_MENU' => "Ist ein Hauptmenü", 'ADMIN_SELECT_WHAT_NAME' => "Wählen Sie den passenden Suffix aus der Liste aus", - 'ENTER_DESCR' => "Geben Sie eine kurze aussagekräftige Beschreibung des Menüpunktes ein", + 'ADMIN_ENTER_MENU_DESCRIPTION' => "Geben Sie eine kurze aussagekräftige Beschreibung des Menüpunktes ein", 'ADMIN_SELECT_BELOW_MENU' => "Wählen Sie den Menüpunkt aus, unterhalb dem der neue Punkt erscheinen soll", 'ADMIN_EDIT_DESCRIPTION' => "Beschreibung ändern", - 'CREATE_WHAT_FIRST' => "Bitte erstellen Sie zuerst die what-xxxxx.php Datei. Dann können Sie sie hier auswählen.", - 'MENU_IS_VISIBLE' => "Menüpunkt ist sichtbar", - 'MENU_IS_ACTIVE' => "Menüpunkt ist aktiviert", - 'CREATE_ACTION_FIRST' => "Bitte erstellen Sie zuerst die action-xxxxx.php Datei. Dann können Sie sie hier auswählen.", - 'IS_FIRST_MENU' => "Ist das erste Hauptmenü", + 'ADMIN_CREATE_WHAT_FIRST' => "Bitte erstellen Sie zuerst die what-xxxxx.php Datei. Dann können Sie sie hier auswählen.", + 'ADMIN_MENU_IS_VISIBLE' => "Menüpunkt ist sichtbar", + 'ADMIN_MENU_IS_ACTIVE' => "Menüpunkt ist aktiviert", + 'ADMIN_CREATE_ACTION_FIRST' => "Bitte erstellen Sie zuerst die action-xxxxx.php Datei. Dann können Sie sie hier auswählen.", + 'ADMIN_IS_FIRST_MENU' => "Ist das erste Hauptmenü", 'NO_DB_LINK' => "Keine Verbindung zur Datenbank.", 'NO_DB_LINK_SHUTDOWN' => "Keine Verbindung zur Datenbank beim Schliessen der Verbindung.", 'MYSQL_DATA_MISSING' => "Die Konfiguration Ihrer Datenbankverbindung ist unnvollständig. Bitte in {?CACHE_PATH?}/config-local.php mindestens den Hostnamen, Datenbanknamen und Login zur Datenbank eingeben.", @@ -710,12 +710,14 @@ addMessages(array( 'GUEST_STATS_MODULES' => "Klicks in allen Modulen (TOP-10)", 'GUEST_STATS_MEMBERS' => "Statistiken über unsere Mitglieder", 'ADMIN_EDIT_REFERAL_BANNER_TITLE' => "Werbebanner editieren", - 'REQUEST_CONFIRM_LINK_TITLE' => "Bestätigungslink erneut anfordern", + 'GUEST_LOGIN_ID_UNKNOWN_STATUS' => "Ihr Account weist einen unbekannten Status %s auf. Bitte melden Sie sich beim Support.", + 'GUEST_REQUEST_CONFIRM_LINK_TITLE' => "Bestätigungslink erneut anfordern", 'GUEST_CONFIRM_LINK_NOTE' => "Sie haben Ihren Bestätigungslink verlegt? Kein Problem, hier können Sie ihn erneut anfordern. Geben Sie einfach Ihre angemeldete eMail-Adresse an. Der Link wird Ihnen dann per Mail zugesandt.", - 'REQUEST_CONFIRM_LINK' => "Erneut anfordern", - 'LOGIN_ID_CONFIRMED' => "Sie haben bereits Ihre E-Mail Adresse bestätigt.", - 'CONFIRM_LINK_SENT' => "Der Bestätigungslink wurde an Ihre E-Mail Adresse ausgesandt.", - 'REQUEST_CONFIRM_LINK_SUBJECT' => "Anforderung Ihres Bestätigunglinkes", + 'GUEST_REQUEST_CONFIRM_LINK' => "Erneut anfordern", + 'GUEST_LOGIN_ID_CONFIRMED' => "Sie haben bereits Ihre E-Mail Adresse bestätigt.", + 'GUEST_LOGIN_ID_LOCKED' => "Ihr Account ist gesperrt. Bitte melden Sie sich beim Support.", + 'GUEST_CONFIRM_LINK_SENT' => "Der Bestätigungslink wurde an Ihre E-Mail Adresse ausgesandt.", + 'GUEST_REQUEST_CONFIRM_LINK_SUBJECT' => "Anforderung Ihres Bestätigunglinkes", 'EMAIL_404' => "Unter der angegebenen E-Mail Adresse konnten wir keinen Account finden! Bitte versuchen Sie es erneut.", 'SELECT_NONE' => "Keine/s/r", 'ADMIN_CONFIG_STATS_TITLE' => "Einstellungen an den Gast-Statistiken", @@ -726,7 +728,7 @@ addMessages(array( 'ADMIN_GSTATS_MODULES_NOTE' => "Zeigt Klicks in den 10 am häufigsten angeklickten Gast- und Mitgliedsmodulen an.", 'ADMIN_GSTATS_INACTIVE_NOTE' => "Deaktiviert die Gast-Statistiken komplett.", 'ADMIN_DELETE_PAYMENT_TITLE' => "Mailvergütungen löschen", - 'REFERAL_PAYOUT' => "Wie viele Mails müssen die Mitglieder mindestens bestätigen, um den Willkommensbonus, einmaliger Referal-Bonus usw. gutgeschrieben zu bekommen?", + 'ADMIN_CONFIG_REFERAL_PAYOUT' => "Wie viele Mails müssen die Mitglieder mindestens bestätigen, um den Willkommensbonus, einmaliger Referal-Bonus usw. gutgeschrieben zu bekommen?", 'ADMIN_EXTENSION_UPDATED' => "Erweiterung aktualisiert.", 'ADMIN_UPDATE_EXTENSION_SUBJECT' => "Erweiterung-Update installiert", 'MEMBER_ORDER_PAGE1_INTRO' => "Mailbuchung - Schritt 1 von 4: PLZ eingeben", @@ -739,9 +741,9 @@ addMessages(array( 'LOCKED_POINTS' => "Nicht vergütete {?POINTS?}", 'LAST_UPDATE' => "Letzte Profiländerung", 'LAST_PROFILE_SENT' => "Erinnerung gesendet", - 'USER_REFERAL_PAYOUT' => "Noch zu best. Mails", + 'ADMIN_USER_REFERAL_PAYOUT' => "Noch zu best. Mails", 'DISPLAY_REFID' => "Ref-Id anzeigen", - 'SORT_NAVIGATION' => "Sortieren", + 'ADMIN_SORT_NAVIGATION' => "Sortieren", 'HIGHER' => "Höher", 'LOWER' => "Niedriger", 'MEMBER_SETTINGS_SAVED' => "Einstellungen gespeichert.", diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index 4a24b2d73b..c3304a72fe 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -651,36 +651,59 @@ LIMIT 1", // Does resend the user's confirmation link for given email address function doResendUserConfirmationLink ($email) { + // Email address not registered is default message + $message = '{--EMAIL_404--}'; + // Confirmation link requested if (fetchUserData($email, 'email')) { // Email address found $content = getUserDataArray(); - // Detect status - switch ($content['status']) { - case 'UNCONFIRMED': // Account not confirmed - // Load email template - $message = loadEmailTemplate('guest_request_confirm', array('hash' => $content['user_hash']), $content['userid']); + // Is the account unconfirmed? + if ($content['status'] == 'UNCONFIRMED') { + // Load email template + $message = loadEmailTemplate('guest_request_confirm', array('hash' => $content['user_hash']), $content['userid']); - // Send email - sendEmail($email, '{--REQUEST_CONFIRM_LINK_SUBJECT--}', $message); + // Send email + sendEmail($email, '{--GUEST_REQUEST_CONFIRM_LINK_SUBJECT--}', $message); + } // END - if - // And set message - $content['message'] = '{--CONFIRM_LINK_SENT--}'; - break; + // Create message based on the status + $message = getConfirmationMessageFromUserStatus($content['status']); + } // END - if - case 'CONFIRMED': // Account already confirmed - $content['message'] = '{--LOGIN_ID_CONFIRMED--}'; - break; + // Output message + loadTemplate('admin_settings_saved', false, $message); +} - case 'LOCKED': // Account is locked - $content['message'] = '{--LOGIN_ID_LOCKED--}'; - break; - } // END - switch - } else { - // Email address not registered - $content['message'] = '{--EMAIL_404--}'; - } +// Get a message (somewhat translation) from user status for confirmation link. +// This is different to translateUserStatus() in text messages. +function getConfirmationMessageFromUserStatus ($status) { + // Default is 'UNKNOWN' + $message = getMaskedMessage('GUEST_LOGIN_ID_UNKNOWN_STATUS', $status); + + // Which status is it? + switch ($status) { + case 'UNCONFIRMED': // Account is unconfirmed + // And set message + $message = '{--GUEST_CONFIRM_LINK_SENT--}'; + break; + + case 'CONFIRMED': // Account already confirmed + $message = '{--GUEST_LOGIN_ID_CONFIRMED--}'; + break; + + case 'LOCKED': // Account is locked + $message = '{--GUEST_LOGIN_ID_LOCKED--}'; + break; + + default: // This should not happen + debug_report_bug(__FUNCTION__, __LINE__, 'Unknown user status ' . $status . ' detected.'); + break; + } // END - switch + + // Return message + return $message; } // Expression call-back function for fetching user data diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php index df3a61d2e1..d22f14cc41 100644 --- a/inc/libs/wernis_functions.php +++ b/inc/libs/wernis_functions.php @@ -320,6 +320,8 @@ function WERNIS_EXECUTE_PAYOUT ($wdsId, $amount) { function translateWernisTransferStatus ($status) { // Default status $return = getMaskedMessage('WERNIS_STATUS_UNKNWOWN', $status); + + // Which status? switch ($status) { case 'IN': // Withdraw $return = '{--WERNIS_STATUS_WITHDRAW--}'; @@ -332,7 +334,7 @@ function translateWernisTransferStatus ($status) { case 'FAILED': // Payout $return = '{--WERNIS_STATUS_FAILED--}'; break; - } + } // END - switch // Return the status return $return; diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 9a3c519451..7638b2fc06 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -589,7 +589,7 @@ function adminAddMenuSelectionBox ($menu, $type, $name, $default = '') { $menuArray = getArrayFromDirectory(sprintf("inc/modules/%s/", $menu), '', false, false); // Init the selection box - $OUT = ''; // Walk through all files foreach ($menuArray as $file) { diff --git a/inc/modules/admin/what-admin_add.php b/inc/modules/admin/what-admin_add.php index a661994fc2..c5ae169766 100644 --- a/inc/modules/admin/what-admin_add.php +++ b/inc/modules/admin/what-admin_add.php @@ -136,7 +136,7 @@ if (!isFormSent()) { } $OUT = ' - '; + '; foreach ($below as $key => $m) { if (is_array($m)) { foreach ($m as $key2 => $m2) { diff --git a/inc/modules/admin/what-mem_add.php b/inc/modules/admin/what-mem_add.php index 78e06a63ab..6986b682b8 100644 --- a/inc/modules/admin/what-mem_add.php +++ b/inc/modules/admin/what-mem_add.php @@ -144,7 +144,7 @@ if (!isFormSent()) { } // END - if $OUT = ' - {--SELECT_WHAT_NAME--}: + {--ADMIN_SELECT_WHAT_NAME--}: $content[what_selection]
- ({--CREATE_WHAT_FIRST--}) + ({--ADMIN_CREATE_WHAT_FIRST--}) - {--SELECT_PARENT_MENU--}: + {--ADMIN_SELECT_PARENT_MENU--}: $content[action_selection]
- ({--CREATE_ACTION_FIRST--}) + ({--ADMIN_CREATE_ACTION_FIRST--}) - {--ENTER_DESCR--}: + {--ADMIN_ENTER_MENU_DESCRIPTION--}: - {--SELECT_BELOW_MENU--}: + {--ADMIN_SELECT_BELOW_MENU--}: $content[below_selection] diff --git a/templates/de/html/admin/admin_add_guest_menu.tpl b/templates/de/html/admin/admin_add_guest_menu.tpl index cddf51f8f8..22fac02516 100644 --- a/templates/de/html/admin/admin_add_guest_menu.tpl +++ b/templates/de/html/admin/admin_add_guest_menu.tpl @@ -11,14 +11,14 @@ {--ADMIN_SELECT_WHAT_NAME--}: $content[what_selection]
- ({--CREATE_WHAT_FIRST--}) + ({--ADMIN_CREATE_WHAT_FIRST--}) {--ADMIN_SELECT_PARENT_MENU--}: $content[action_selection]
- ({--CREATE_ACTION_FIRST--}) + ({--ADMIN_CREATE_ACTION_FIRST--}) @@ -26,7 +26,7 @@ $content[below_selection] - {--MENU_IS_VISIBLE--}: + {--ADMIN_MENU_IS_VISIBLE--}: diff --git a/templates/de/html/admin/admin_add_member_menu.tpl b/templates/de/html/admin/admin_add_member_menu.tpl index 26c80bfa12..337bf92ecd 100644 --- a/templates/de/html/admin/admin_add_member_menu.tpl +++ b/templates/de/html/admin/admin_add_member_menu.tpl @@ -11,14 +11,14 @@ {--ADMIN_SELECT_WHAT_NAME--}: $content[what_selection]
- ({--CREATE_WHAT_FIRST--}) + ({--ADMIN_CREATE_WHAT_FIRST--}) {--ADMIN_SELECT_PARENT_MENU--}: $content[action_selection]
- ({--CREATE_ACTION_FIRST--}) + ({--ADMIN_CREATE_ACTION_FIRST--}) @@ -26,7 +26,7 @@ $content[below_selection] - {--MENU_IS_VISIBLE--}: + {--ADMIN_MENU_IS_VISIBLE--}: diff --git a/templates/de/html/admin/admin_config_point_settings.tpl b/templates/de/html/admin/admin_config_point_settings.tpl index b89749b653..e30a64c723 100644 --- a/templates/de/html/admin/admin_config_point_settings.tpl +++ b/templates/de/html/admin/admin_config_point_settings.tpl @@ -29,7 +29,7 @@ - {--REFERAL_PAYOUT--} + {--ADMIN_CONFIG_REFERAL_PAYOUT--} diff --git a/templates/de/html/admin/admin_edit_admin_menu.tpl b/templates/de/html/admin/admin_edit_admin_menu.tpl index 3752310dc4..3cbc7a4a47 100644 --- a/templates/de/html/admin/admin_edit_admin_menu.tpl +++ b/templates/de/html/admin/admin_edit_admin_menu.tpl @@ -4,10 +4,10 @@ {--ID_SELECT--} - {--DISPLAY_ACTION--} - {--DISPLAY_WHAT--} - {--DISPLAY_TITLE--} - {--SORT_NAVIGATION--} + {--ADMIN_DISPLAY_ACTION--} + {--ADMIN_DISPLAY_WHAT--} + {--ADMIN_DISPLAY_TITLE--} + {--ADMIN_SORT_NAVIGATION--} $content[rows] diff --git a/templates/de/html/admin/admin_edit_guest_menu.tpl b/templates/de/html/admin/admin_edit_guest_menu.tpl index ac820e0473..4761f0b427 100644 --- a/templates/de/html/admin/admin_edit_guest_menu.tpl +++ b/templates/de/html/admin/admin_edit_guest_menu.tpl @@ -3,10 +3,10 @@ - - - - + + + + $content[rows] diff --git a/templates/de/html/admin/admin_expert_settings_form.tpl b/templates/de/html/admin/admin_expert_settings_form.tpl index f01f9e561a..189d3441a0 100644 --- a/templates/de/html/admin/admin_expert_settings_form.tpl +++ b/templates/de/html/admin/admin_expert_settings_form.tpl @@ -1,3 +1,4 @@ +
{--ID_SELECT--}{--DISPLAY_ACTION--}{--DISPLAY_WHAT--}{--DISPLAY_TITLE--}{--SORT_NAVIGATION--}{--ADMIN_DISPLAY_ACTION--}{--ADMIN_DISPLAY_WHAT--}{--ADMIN_DISPLAY_TITLE--}{--ADMIN_SORT_NAVIGATION--}
@@ -26,3 +27,4 @@
+ diff --git a/templates/de/html/admin/admin_member_menu_overview.tpl b/templates/de/html/admin/admin_member_menu_overview.tpl index 3877dbd7a8..9a18d40a3c 100644 --- a/templates/de/html/admin/admin_member_menu_overview.tpl +++ b/templates/de/html/admin/admin_member_menu_overview.tpl @@ -3,10 +3,10 @@ - - - - + + + + $content[rows] diff --git a/templates/de/html/admin/admin_user_details.tpl b/templates/de/html/admin/admin_user_details.tpl index c8ee13497c..4082e56b8c 100644 --- a/templates/de/html/admin/admin_user_details.tpl +++ b/templates/de/html/admin/admin_user_details.tpl @@ -133,7 +133,7 @@
{--ID_SELECT--}{--DISPLAY_ACTION--}{--DISPLAY_WHAT--}{--DISPLAY_TITLE--}{--SORT_NAVIGATION--}{--ADMIN_DISPLAY_ACTION--}{--ADMIN_DISPLAY_WHAT--}{--ADMIN_DISPLAY_TITLE--}{--ADMIN_SORT_NAVIGATION--}
- {--USER_REFERAL_PAYOUT--}:
+ {--ADMIN_USER_REFERAL_PAYOUT--}:
$content[ref_payout]
diff --git a/templates/de/html/guest/guest_confirm_link.tpl b/templates/de/html/guest/guest_confirm_link.tpl index 9364485c67..dd98e4f25c 100644 --- a/templates/de/html/guest/guest_confirm_link.tpl +++ b/templates/de/html/guest/guest_confirm_link.tpl @@ -3,7 +3,7 @@ @@ -20,7 +20,7 @@
-
{--REQUEST_CONFIRM_LINK_TITLE--}
+
{--GUEST_REQUEST_CONFIRM_LINK_TITLE--}