From 4b9887f734067dc52a1730468e25ba066036a3e1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 29 Jul 2010 23:49:29 +0000 Subject: [PATCH] Even more usage of EL --- inc/language/network_de.php | 18 +++++----- inc/libs/network_functions.php | 16 +++++---- inc/modules/admin/what-list_network_types.php | 35 ++----------------- inc/mysql-manager.php | 6 ++-- .../admin/admin_edit_network_params_row.tpl | 4 +-- 5 files changed, 26 insertions(+), 53 deletions(-) diff --git a/inc/language/network_de.php b/inc/language/network_de.php index 28ea78c5a1..993e1f987d 100644 --- a/inc/language/network_de.php +++ b/inc/language/network_de.php @@ -126,26 +126,26 @@ addMessages(array( // - Other messages 'ADMIN_NETWORK_REQUEST_PARAMETER_LIST_LIMITED_TO_TYPE' => "Es wurden nur die API-Parameter des ausgewählten Werbeart-Handlers angezeigt.", // - Advertise types + 'ADMIN_NETWORK_TYPES_BANNER' => "Banner-Klick/-View", 'ADMIN_NETWORK_TYPES_BANNER_CLICK' => "Banner-Klick", 'ADMIN_NETWORK_TYPES_BANNER_VIEW' => "Banner-View", - 'ADMIN_NETWORK_TYPES_BANNER_CLICK_VIEW' => "Banner-Klick/-View", + 'ADMIN_NETWORK_TYPES_BUTTON' => "Button-Klick/-View", 'ADMIN_NETWORK_TYPES_BUTTON_CLICK' => "Button-Klick", 'ADMIN_NETWORK_TYPES_BUTTON_VIEW' => "Button-View", - 'ADMIN_NETWORK_TYPES_BUTTON_CLICK_VIEW' => "Button-Klick/-View", + 'ADMIN_NETWORK_TYPES_SURFBAR' => "Surfbar-Klick/-View", 'ADMIN_NETWORK_TYPES_SURFBAR_CLICK' => "Surfbar-Klick", 'ADMIN_NETWORK_TYPES_SURFBAR_VIEW' => "Surfbar-View", - 'ADMIN_NETWORK_TYPES_SURFBAR_CLICK_VIEW' => "Surfbar-Klick/-View", - 'ADMIN_NETWORK_TYPES_FORCED_BANNER' => "Forced-Banner", - 'ADMIN_NETWORK_TYPES_FORCED_TEXTLINK' => "Forced-Textlink", + 'ADMIN_NETWORK_TYPES_FORCEDBANNER' => "Forced-Banner", + 'ADMIN_NETWORK_TYPES_FORCEDTEXTLINK' => "Forced-Textlink", + 'ADMIN_NETWORK_TYPES_TEXTLINK' => "Textlink-Klick/-View", 'ADMIN_NETWORK_TYPES_TEXTLINK_CLICK' => "Textlink-Klick", 'ADMIN_NETWORK_TYPES_TEXTLINK_VIEW' => "Textlink-View", - 'ADMIN_NETWORK_TYPES_TEXTLINK_CLICK_VIEW' => "Textlink-Klick/-View", + 'ADMIN_NETWORK_TYPES_SKYBANNER' => "Sky-Klick/-View", 'ADMIN_NETWORK_TYPES_SKYBANNER_CLICK' => "Sky-Klick", 'ADMIN_NETWORK_TYPES_SKYBANNER_VIEW' => "Sky-View", - 'ADMIN_NETWORK_TYPES_SKYBANNER_CLICK_VIEW' => "Sky-Klick/-View", + 'ADMIN_NETWORK_TYPES_LAYER' => "Layer-Klick/-View", 'ADMIN_NETWORK_TYPES_LAYER_CLICK' => "Layer-Klick", 'ADMIN_NETWORK_TYPES_LAYER_VIEW' => "Layer-View", - 'ADMIN_NETWORK_TYPES_LAYER_CLICK_VIEW' => "Layer-Klick/-View", 'ADMIN_NETWORK_TYPES_POPUP' => "PopUp", 'ADMIN_NETWORK_TYPES_POPDOWN' => "PopDown", 'ADMIN_NETWORK_TYPES_TEXTMAIL' => "Textmail", @@ -206,7 +206,7 @@ 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", - // Text-represations of column translate_name + // Textual represations of column translate_name 'ADMIN_NETWORK_TRANSLATE_ALTERNATE_TEXT_NAME' => "Alternativer Bildtext", 'ADMIN_NETWORK_TRANSLATE_BANNER_ID_NAME' => "Banner-Id", 'ADMIN_NETWORK_TRANSLATE_ID_NAME' => "Kampagnen-Id", diff --git a/inc/libs/network_functions.php b/inc/libs/network_functions.php index 228fb83982..7289d551c5 100644 --- a/inc/libs/network_functions.php +++ b/inc/libs/network_functions.php @@ -497,7 +497,9 @@ function generateNetworkTypeOptions ($id) { sprintf( "WHERE `network_id`=%s", bigintval(getRequestParameter('network')) - ) + ), + '', + 'translateNetworkTypeHandler' ); } // END - if @@ -581,6 +583,12 @@ function translateNetworkTranslationName ($name) { return getMessage('ADMIN_NETWORK_TRANSLATE_' . strtoupper($name) . '_NAME'); } +// Translates the network type handler (e.g. banner, paidmail) for templates +function translateNetworkTypeHandler ($type) { + // Get the message id + return getMessage('ADMIN_NETWORK_TYPES_' . strtoupper($type) . ''); +} + //------------------------------------------------------------------------------ // Call-back functions //------------------------------------------------------------------------------ @@ -758,12 +766,6 @@ function doAdminNetworkProcessHandlerequestparamsForm () { // Do we have found the network? if (count($networkRequestData) > 0) { if (isFormSent('edit')) { - // Add options list for network type - $networkRequestData['type_options'] = generateNetworkTypeOptions($networkRequestData['network_type_id']); - - // Add options list for request key - $networkRequestData['key_options'] = generateNetworkRequestKeyOptions($networkRequestData['request_param_key']); - // Add row template for deleting $OUT .= loadTemplate('admin_edit_network_params_row', true, $networkRequestData); } elseif (isFormSent('del')) { diff --git a/inc/modules/admin/what-list_network_types.php b/inc/modules/admin/what-list_network_types.php index f2b38556a3..9aa4f31216 100644 --- a/inc/modules/admin/what-list_network_types.php +++ b/inc/modules/admin/what-list_network_types.php @@ -141,39 +141,10 @@ ORDER BY 'pagepeel', 'traffic' ), - array( - '{--ADMIN_NETWORK_TYPES_BANNER_CLICK_VIEW--}', - '{--ADMIN_NETWORK_TYPES_BANNER_CLICK--}', - '{--ADMIN_NETWORK_TYPES_BANNER_VIEW--}', - '{--ADMIN_NETWORK_TYPES_BUTTON_CLICK_VIEW--}', - '{--ADMIN_NETWORK_TYPES_BUTTON_CLICK--}', - '{--ADMIN_NETWORK_TYPES_BUTTON_VIEW--}', - '{--ADMIN_NETWORK_TYPES_SURFBAR_CLICK_VIEW--}', - '{--ADMIN_NETWORK_TYPES_SURFBAR_CLICK--}', - '{--ADMIN_NETWORK_TYPES_SURFBAR_VIEW--}', - '{--ADMIN_NETWORK_TYPES_FORCED_BANNER--}', - '{--ADMIN_NETWORK_TYPES_FORCED_TEXTLINK--}', - '{--ADMIN_NETWORK_TYPES_TEXTLINK_CLICK_VIEW--}', - '{--ADMIN_NETWORK_TYPES_TEXTLINK_CLICK--}', - '{--ADMIN_NETWORK_TYPES_TEXTLINK_VIEW--}', - '{--ADMIN_NETWORK_TYPES_SKYBANNER_CLICK_VIEW--}', - '{--ADMIN_NETWORK_TYPES_SKYBANNER_CLICK--}', - '{--ADMIN_NETWORK_TYPES_SKYBANNER_VIEW--}', - '{--ADMIN_NETWORK_TYPES_LAYER_CLICK_VIEW--}', - '{--ADMIN_NETWORK_TYPES_LAYER_CLICK--}', - '{--ADMIN_NETWORK_TYPES_LAYER_VIEW--}', - '{--ADMIN_NETWORK_TYPES_POPUP--}', - '{--ADMIN_NETWORK_TYPES_POPDOWN--}', - '{--ADMIN_NETWORK_TYPES_TEXTMAIL--}', - '{--ADMIN_NETWORK_TYPES_HTMLMAIL--}', - '{--ADMIN_NETWORK_TYPES_LEAD--}', - '{--ADMIN_NETWORK_TYPES_SALE--}', - '{--ADMIN_NETWORK_TYPES_PAYPERACTIVE--}', - '{--ADMIN_NETWORK_TYPES_PAGEPEEL--}', - '{--ADMIN_NETWORK_TYPES_TRAFFIC--}' - ), + array(), '', '', '', - $networkData['disabled'] + $networkData['disabled'], + 'translateNetworkTypeHandler' ); // Add form for adding new types diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 665dc6946b..b2083285c0 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -1383,7 +1383,7 @@ function generateOptionList ($table, $id, $name, $default = '', $special = '', $ $ret = ''; if ($table == '/ARRAY/') { // Selection from array - if ((is_array($id)) && (is_array($name)) && (count($id)) == (count($name))) { + if ((is_array($id)) && (is_array($name)) && ((count($id)) == (count($name)) || (!empty($callback)))) { // Both are arrays foreach ($id as $idx => $value) { $ret .= '