]> git.mxchange.org Git - mailer.git/commitdiff
Even more usage of EL
authorRoland Häder <roland@mxchange.org>
Thu, 29 Jul 2010 23:49:29 +0000 (23:49 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 29 Jul 2010 23:49:29 +0000 (23:49 +0000)
inc/language/network_de.php
inc/libs/network_functions.php
inc/modules/admin/what-list_network_types.php
inc/mysql-manager.php
templates/de/html/admin/admin_edit_network_params_row.tpl

index 28ea78c5a1da8a9b74d3b573c86d8f9233352257..993e1f987dc787d44c6f30a0040cd41a60fd1b52 100644 (file)
@@ -126,26 +126,26 @@ addMessages(array(
        // - Other messages
        'ADMIN_NETWORK_REQUEST_PARAMETER_LIST_LIMITED_TO_TYPE' => "Es wurden nur die API-Parameter des ausgew&auml;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&ouml;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",
index 228fb839826657e48159b76685fd78dec0ecf5ae..7289d551c5af87ab07d0dfd3cdcd9cfee1d093ac 100644 (file)
@@ -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')) {
index f2b38556a35a704690ec8aa3976208e94df36f18..9aa4f31216ba2c89db85910fb67a4aea875190ba 100644 (file)
@@ -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
index 665dc6946b87365f678c02b00e268dc8aa003d75..b2083285c0abf408f78975e0a718587d06865ee3 100644 (file)
@@ -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 .= '<option value="' . $value . '"';
@@ -1398,7 +1398,7 @@ function generateOptionList ($table, $id, $name, $default = '', $special = '', $
                                // Is the call-back function set?
                                if (!empty($callback)) {
                                        // Call it
-                                       $name[$idx] = call_user_func_array($callback, array($name[$idx]));
+                                       $name[$idx] = call_user_func_array($callback, array($id[$idx]));
                                } // END - if
 
                                // Finish option tag
@@ -1406,7 +1406,7 @@ function generateOptionList ($table, $id, $name, $default = '', $special = '', $
                        } // END - foreach
                } else {
                        // Problem in request
-                       debug_report_bug(__FUNCTION__, __LINE__, 'Not all are arrays: id[' . count($id) . ']=' . gettype($id) . ',name[' . count($name) . ']=' . gettype($name));
+                       debug_report_bug(__FUNCTION__, __LINE__, 'Not all are arrays: id[' . count($id) . ']=' . gettype($id) . ',name[' . count($name) . ']=' . gettype($name) . ',callback=' . $callback);
                }
        } else {
                // Data from database
index e2cc056e1289c01d9c24ad1e65e8b46faee9db79..1a25912a53407b8dfd6ac811dd428f6576de21f1 100644 (file)
@@ -3,7 +3,7 @@
        <td class="{%template,ColorSwitch%}">
                <input type="hidden" name="sel[$content[network_param_id]]" value="1" />
                <select name="network_type_id[$content[network_param_id]]" class="admin_select" size="1">
-                       $content[type_options]
+                       {%pipe,generateNetworkTypeOptions=$content[network_type_id]%}
                </select>
        </td>
 </tr>
@@ -11,7 +11,7 @@
        <td class="{%template,ColorSwitch%}" style="padding-left:5px">{--ADMIN_NETWORK_REQUEST_PARAMETER_KEY--}:</td>
        <td class="{%template,ColorSwitch%}">
                <select name="request_param_key[$content[network_param_id]]" class="admin_select" size="1">
-                       $content[key_options]
+                       {%pipe,generateNetworkRequestKeyOptions=$content[network_param_key]%}
                </select>
        </td>
 </tr>