From 0187fd5903cddd98c2152dbb4c84da58e5083303 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 29 Jul 2010 22:03:02 +0000 Subject: [PATCH] More usage of EL --- inc/extensions/ext-network.php | 4 ++-- inc/language/network_de.php | 20 ++++++++++++------- inc/libs/network_functions.php | 20 ++++--------------- .../what-list_network_api_translation.php | 16 ++++----------- .../admin/what-list_network_params.php | 10 +--------- .../admin/what-list_network_translations.php | 7 +------ inc/modules/admin/what-list_network_types.php | 10 +--------- .../admin_add_network_api_translation.tpl | 14 ++++++------- .../html/admin/admin_add_network_params.tpl | 8 ++++---- .../de/html/admin/admin_add_network_type.tpl | 4 ++-- .../html/admin/admin_del_network_params.tpl | 6 +++--- .../de/html/admin/admin_del_network_types.tpl | 6 +++--- .../html/admin/admin_edit_network_params.tpl | 6 +++--- .../html/admin/admin_edit_network_types.tpl | 6 +++--- .../html/admin/admin_list_network_params.tpl | 6 +++--- .../html/admin/admin_list_network_types.tpl | 6 +++--- .../de/html/admin/admin_list_networks_row.tpl | 2 +- .../de/html/member/member_transfer_row2.tpl | 2 +- 18 files changed, 59 insertions(+), 94 deletions(-) diff --git a/inc/extensions/ext-network.php b/inc/extensions/ext-network.php index 109c4aa421..145f007400 100644 --- a/inc/extensions/ext-network.php +++ b/inc/extensions/ext-network.php @@ -153,10 +153,10 @@ PRIMARY KEY (`network_translate_id`) `network_api_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`network_translation_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `network_api_index` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0, -`network_index_translation` VARCHAR(100) NOT NULL DEFAULT '', UNIQUE `provider_type_key` (`network_id`,`network_type_id`,`network_api_index`), -UNIQUE `provider_type_trans` (`network_id`,`network_type_id`,`network_index_translation`), +UNIQUE `provider_type_trans` (`network_id`,`network_type_id`,`network_translation_id`), PRIMARY KEY (`network_api_id`) ) TYPE={?_TABLE_TYPE?} COMMENT='Translation of API responses, generic data, DO NOT ALTER!'"); diff --git a/inc/language/network_de.php b/inc/language/network_de.php index b989d54089..fbcbfce4ef 100644 --- a/inc/language/network_de.php +++ b/inc/language/network_de.php @@ -64,8 +64,8 @@ addMessages(array( 'ADMIN_NETWORK_REQUEST_PARAMETER_NOT_ADDED' => "Der API-Parameter %s wurde nicht hinzugefügt.", 'ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_CHANGED' => "Es wurden keine Änderungen an den API-Parametern ausgeführt.", 'ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_REMOVED' => "Es wurden keine API-Parameter gelöscht.", - 'ADMIN_NETWORK_ARRAY_TRANSLATION_404' => "Es wurden keine Übersetzungen zum Antwort-Array zum Werbenetzwerk %s gefunden.", 'ADMIN_NETWORK_TRANSLATIONS_404' => "Es wurden keine Array-Übersetzungen für den Werbeart-Handler %s ({%%network,getNetworkDataById,network_title=%%network%%%%}) gefunden.", + 'ADMIN_NETWORK_API_TRANSLATION_404' => "Es wurden keine Übersetzungen zum Antwort-Array zum Werbenetzwerk %s gefunden.", // - Form titles 'ADMIN_NETWORK_ADD_TITLE' => "Neues Werbenetzwerk hinzufügen - Allgemeine Daten", 'ADMIN_NETWORK_EDIT_TITLE' => "Werbenetzwerk editieren - Allgemeine Daten", @@ -80,11 +80,12 @@ addMessages(array( 'ADMIN_NETWORK_REQUEST_PARAMETER_LIST_TITLE' => "API-Parameter auflisten und verwalten", 'ADMIN_NETWORK_REQUEST_PARAMETER_EDIT_TITLE' => "API-Parameter editieren", 'ADMIN_NETWORK_REQUEST_PARAMETER_DELETE_TITLE' => "API-Parameter löschen", - 'ADMIN_NETWORK_ARRAY_TRANSLATION_ADD_TITLE' => "Werbenetzwerk verwalten - Neuen Rückgabewert hinzufügen", + 'ADMIN_NETWORK_TRANSLATION_ADD_TITLE' => "Werbenetzwerk verwalten - Neue Array-Übersetzung hinzufügen", + 'ADMIN_NETWORK_API_TRANSLATION_ADD_TITLE' => "Werbenetzwerk verwalten - Neuen Rückgabewert hinzufügen", // - Link titles 'ADMIN_NETWORK_LIST_TYPES_LINK_TITLE' => "Weiter zu den Werbearten", 'ADMIN_NETWORK_LIST_PARAMS_LINK_TITLE' => "Weiter zu den API-Parametern", - 'ADMIN_NETWORK_LIST_ARRAY_TRANSLATION_LINK_TITLE' => "Weiter zu den Übersetzungen zum Antwort-Arrayn", + 'ADMIN_NETWORK_LIST_API_TRANSLATION_LINK_TITLE' => "Weiter zu den Übersetzungen zum Antwort-Arrayn", 'ADMIN_NETWORK_LIST_ERROR_CODES_LINK_TITLE' => "Weiter zu den Fehlercodes", // - Buttons 'ADMIN_NETWORK_ADD' => "Allgemeine Daten anlegen", @@ -104,7 +105,7 @@ addMessages(array( 'ADMIN_NETWORK_REQUEST_PARAMETER_DELETE' => "Löschen", 'ADMIN_NETWORK_REQUEST_PARAMETER_CHANGE' => "API-Parameter ändern", 'ADMIN_NETWORK_REQUEST_PARAMETER_REMOVE' => "API-Parameter entfernen", - 'ADMIN_NETWORK_ARRAY_TRANSLATION_ADD' => "Rückgabewert hinzufügen", + 'ADMIN_NETWORK_API_TRANSLATION_ADD' => "Rückgabewert hinzufügen", // - Success titles 'ADMIN_NETWORK_ADDED_TITLE' => "Allgemeine Werbenetzwerkdaten hinzugefügt.", 'ADMIN_NETWORK_TYPES_ADDED_TITLE' => "Werbeart-Handler hinzugefügt.", @@ -123,7 +124,8 @@ addMessages(array( 'ADMIN_NETWORK_TYPES_LIST_NOTE' => "Seien Sie mit dem Löschen und Editieren von Werbeart-Handlern sehr vorsichtig. Sie sollten hierzu Rücksprache im Forum halten. Dokumentation zu den Platzhaltern (%FOO%, %BAR% usw.) finden Sie in der Dokumentation DOCs/de/network/README.txt.", 'ADMIN_NETWORK_REQUEST_PARAMETER_ADD_NOTE' => "Fügen Sie hier weitere API-Parameter dem ausgwählten Werbenetzwerk hinzu. Geben Sie keine Werte an, wie z.B. 5 Sekunden oder 30 Mails, geben Sie bei API-Parameter den GET- bzw. POST-Parameternamen an.", 'ADMIN_NETWORK_REQUEST_PARAMETER_LIST_NOTE' => "Seien Sie mit dem Löschen und Editieren von API-Parameter sehr vorsichtig. Sie sollten hierzu Rücksprache im Forum halten. Dokumentation zu den Abfragenamen (%FOO%, %BAR% usw.) finden Sie in der Dokumentation DOCs/de/network/README.txt.", - 'ADMIN_NETWORK_ARRAY_TRANSLATION_ADD_NOTE' => "Fügen Sie hier weitere Array-Element-Übersetzungen zu dem ausgewählten Netzwerk und Werbeart-Handler ein.", + 'ADMIN_NETWORK_TRANSLATION_ADD_NOTE' => "Fügen Sie Array-Übersetzungen hinzu.", + 'ADMIN_NETWORK_API_TRANSLATION_ADD_NOTE' => "Fügen Sie hier weitere Array-Element-Übersetzungen zu dem ausgewählten Netzwerk und Werbeart-Handler ein.", // - Other messages 'ADMIN_NETWORK_REQUEST_PARAMETER_LIST_LIMITED_TO_TYPE' => "Es wurden nur die API-Parameter des ausgewählten Werbeart-Handlers angezeigt.", // - Advertise types @@ -195,8 +197,8 @@ addMessages(array( 'ADMIN_NETWORK_REQUEST_PARAMETER_EROTIC' => "Erotik erlaubt", 'ADMIN_NETWORK_REQUEST_PARAMETER_EXTRA' => "Extra-Parameter", // - Return code translation - 'ADMIN_NETWORK_ARRAY_TRANSLATION_INDEX' => "Neuen Array-Index eintragen", - 'ADMIN_NETWORK_ARRAY_TRANSLATION_INDEX_TRANSLATION' => "Index-Übersetzung auswählen", + 'ADMIN_NETWORK_API_TRANSLATION_INDEX' => "Neuen Array-Index eintragen", + 'ADMIN_NETWORK_API_TRANSLATION_INDEX_TRANSLATION' => "Index-Übersetzung auswählen", // Error codes 'ADMIN_NETWORK_AFF_ID_PASS_WRONG_ERROR_CODE' => "Affiliate-Id oder -Passwort falsch", 'ADMIN_NETWORK_SITE_ID_NOT_ASSIGNED_ERROR_CODE' => "Seiten-Id nicht zugewiesen/ungültig", @@ -207,6 +209,10 @@ addMessages(array( 'ADMIN_NETWORK_REQUESTS_DEPLETED_ERROR_CODE' => "API-Abfragen erschöpft", 'ADMIN_NETWORK_REQUEST_PARAMETER_INCOMPLETE_ERROR_CODE' => "API-Abfrageparameter nicht komplett", 'ADMIN_NETWORK_SITE_ID_NOT_ALLOWED_TYPE_ERROR_CODE' => "Seiten-Id nicht freigegeben", + // Form 'add_network_translation' + 'ADMIN_NETWORK_SELECTED_NETWORK_TYPE' => "Ausgewähler Werbeart-Handler", + 'ADMIN_NETWORK_ENTER_TRANSLATION' => "Array-Übersetzung eingeben", + 'ADMIN_NETWORK_TRANSLATION_ADD' => "Array-Übersetzung hinzufügen", )); // [EOF] diff --git a/inc/libs/network_functions.php b/inc/libs/network_functions.php index d7d9946c23..db658e0a61 100644 --- a/inc/libs/network_functions.php +++ b/inc/libs/network_functions.php @@ -714,17 +714,11 @@ function doAdminNetworkProcessHandlenetworktypeForm () { // If we have no rows, we don't need to display the edit form if (!empty($OUT)) { - // Prepare content for template - $content = array( - 'rows' => $OUT, - 'network_data' => getNetworkDataById(getRequestParameter('network')) - ); - // Output main template if (isFormSent('edit')) { - loadTemplate('admin_edit_network_types', false, $content); + loadTemplate('admin_edit_network_types', false, $OUT); } elseif (isFormSent('del')) { - loadTemplate('admin_del_network_types', false, $content); + loadTemplate('admin_del_network_types', false, $OUT); } else { // Problem! debug_report_bug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.'); @@ -784,17 +778,11 @@ function doAdminNetworkProcessHandlerequestparamsForm () { // If we have no rows, we don't need to display the edit form if (!empty($OUT)) { - // Prepare content for template - $content = array( - 'rows' => $OUT, - 'network_data' => getNetworkDataById(getRequestParameter('network')) - ); - // Output main template if (isFormSent('edit')) { - loadTemplate('admin_edit_network_params', false, $content); + loadTemplate('admin_edit_network_params', false, $OUT); } elseif (isFormSent('del')) { - loadTemplate('admin_del_network_params', false, $content); + loadTemplate('admin_del_network_params', false, $OUT); } else { // Problem! debug_report_bug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.'); diff --git a/inc/modules/admin/what-list_network_api_translation.php b/inc/modules/admin/what-list_network_api_translation.php index f6b8512f13..31325e6713 100644 --- a/inc/modules/admin/what-list_network_api_translation.php +++ b/inc/modules/admin/what-list_network_api_translation.php @@ -78,11 +78,11 @@ if (isGetRequestParameterSet('network')) { } // END - if // Init disabled list - $GLOBALS['network_api_translation_disabled'] = array(); + $GLOBALS['network_translation_disabled'] = array(); // Load all advert codes for given network $result = SQL_QUERY_ESC("SELECT - p.`network_api_id`, t.`network_type_id`, t.`network_type_handle`, p.`network_api_index`, p.`network_index_translation` + p.`network_api_id`, t.`network_type_id`, t.`network_type_handle`, p.`network_api_index`, p.`network_translation_id` FROM `{?_MYSQL_PREFIX?}_network_api_translation` AS p INNER JOIN @@ -115,19 +115,11 @@ ORDER BY $OUT .= loadTemplate('admin_list_network_api_translation_row', true, $row); } // END - while - // Prepare data for template - $content = array( - 'rows' => $OUT, - 'network_id' => bigintval(getRequestParameter('network')), - 'network_title' => $networkData['network_title'], - 'network_reflink' => $networkData['network_reflink'], - ); - // Load main template - loadTemplate('admin_list_network_api_translation', false, $content); + loadTemplate('admin_list_network_api_translation', false, $OUT); } else { // No entries found - loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_NETWORK_ARRAY_TRANSLATION_404', $networkData['network_title'])); + loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_NETWORK_API_TRANSLATION_404', $networkData['network_title'])); } // Add options list for network type diff --git a/inc/modules/admin/what-list_network_params.php b/inc/modules/admin/what-list_network_params.php index 47f3b62189..9dc97bcde8 100644 --- a/inc/modules/admin/what-list_network_params.php +++ b/inc/modules/admin/what-list_network_params.php @@ -115,16 +115,8 @@ ORDER BY $OUT .= loadTemplate('admin_list_network_params_row', true, $row); } // END - while - // Prepare data for template - $content = array( - 'rows' => $OUT, - 'network_id' => bigintval(getRequestParameter('network')), - 'network_title' => $networkData['network_title'], - 'network_reflink' => $networkData['network_reflink'], - ); - // Load main template - loadTemplate('admin_list_network_params', false, $content); + loadTemplate('admin_list_network_params', false, $OUT); } else { // No entries found loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_NETWORK_REQUEST_PARAMETER_404', $networkData['network_title'])); diff --git a/inc/modules/admin/what-list_network_translations.php b/inc/modules/admin/what-list_network_translations.php index c1d44d5f8e..40bb37f1ea 100644 --- a/inc/modules/admin/what-list_network_translations.php +++ b/inc/modules/admin/what-list_network_translations.php @@ -94,13 +94,8 @@ ORDER BY $OUT .= loadTemplate('admin_list_network_translations_row', true, $row); } // END - while - // Prepare data for template - $content = array( - 'rows' => $OUT, - ); - // Load main template - loadTemplate('admin_list_network_translations', false, $content); + loadTemplate('admin_list_network_translations', false, $OUT); } else { // No entries found loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_NETWORK_TRANSLATIONS_404', $networkData['network_type_handle'])); diff --git a/inc/modules/admin/what-list_network_types.php b/inc/modules/admin/what-list_network_types.php index 3f2b02ec76..f2b38556a3 100644 --- a/inc/modules/admin/what-list_network_types.php +++ b/inc/modules/admin/what-list_network_types.php @@ -97,16 +97,8 @@ ORDER BY $OUT .= loadTemplate('admin_list_network_types_row', true, $row); } // END - while - // Prepare data for template - $content = array( - 'rows' => $OUT, - 'network_id' => bigintval(getRequestParameter('network')), - 'network_title' => $networkData['network_title'], - 'network_reflink' => $networkData['network_reflink'], - ); - // Load main template - loadTemplate('admin_list_network_types', false, $content); + loadTemplate('admin_list_network_types', false, $OUT); } else { // No entries found loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_NETWORK_TYPES_404', $networkData['network_title'])); diff --git a/templates/de/html/admin/admin_add_network_api_translation.tpl b/templates/de/html/admin/admin_add_network_api_translation.tpl index 68ba19c91b..65f654e847 100644 --- a/templates/de/html/admin/admin_add_network_api_translation.tpl +++ b/templates/de/html/admin/admin_add_network_api_translation.tpl @@ -3,9 +3,9 @@ @@ -13,19 +13,19 @@ - + - +
- {--ADMIN_NETWORK_ARRAY_TRANSLATION_ADD_TITLE--} + {--ADMIN_NETWORK_API_TRANSLATION_ADD_TITLE--}
{--ADMIN_NETWORK_TYPE_SELECT--}:
{--ADMIN_NETWORK_ARRAY_TRANSLATION_INDEX--}:{--ADMIN_NETWORK_API_TRANSLATION_INDEX--}: $content[translation_index]
{--ADMIN_NETWORK_ARRAY_TRANSLATION_INDEX_TRANSLATION--}:{--ADMIN_NETWORK_API_TRANSLATION_INDEX_TRANSLATION--}:
@@ -43,5 +43,5 @@
- {--ADMIN_NETWORK_ARRAY_TRANSLATION_ADD_NOTE--} + {--ADMIN_NETWORK_API_TRANSLATION_ADD_NOTE--}
diff --git a/templates/de/html/admin/admin_add_network_params.tpl b/templates/de/html/admin/admin_add_network_params.tpl index 3161f4a82e..2f34c850c0 100644 --- a/templates/de/html/admin/admin_add_network_params.tpl +++ b/templates/de/html/admin/admin_add_network_params.tpl @@ -1,11 +1,11 @@
-
+ @@ -13,7 +13,7 @@ @@ -21,7 +21,7 @@ diff --git a/templates/de/html/admin/admin_add_network_type.tpl b/templates/de/html/admin/admin_add_network_type.tpl index afb83eed96..7464c028bd 100644 --- a/templates/de/html/admin/admin_add_network_type.tpl +++ b/templates/de/html/admin/admin_add_network_type.tpl @@ -1,11 +1,11 @@
- +
{--ADMIN_NETWORK_REQUEST_PARAMETER_ADD_TITLE--}
{--ADMIN_NETWORK_TYPE_SELECT--}:
{--ADMIN_NETWORK_REQUEST_PARAMETER_KEY--}:
diff --git a/templates/de/html/admin/admin_del_network_params.tpl b/templates/de/html/admin/admin_del_network_params.tpl index 4f35e59e95..deb6bdb571 100644 --- a/templates/de/html/admin/admin_del_network_params.tpl +++ b/templates/de/html/admin/admin_del_network_params.tpl @@ -1,5 +1,5 @@
- +
{--ADMIN_NETWORK_TYPES_ADD_TITLE--}
- $content[rows] + $content
@@ -7,11 +7,11 @@ {--ADMIN_NETWORK_REQUEST_PARAMETER_DELETE_TITLE--}