]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_network_types.php
Extension ext-coupon basicly finished, no shortcuts in naming:
[mailer.git] / inc / modules / admin / what-list_network_types.php
index 1ac9a764aaaac87d0a94be7227680e70f1633107..65580e0cf9cd9ed29aff9b31e75402551aaac1cb 100644 (file)
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -42,7 +41,7 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 } // END - if
 
 // Add description as navigation point
-addMenuDescription('admin', __FILE__);
+addYouAreHereLink('admin', __FILE__);
 
 // These are expert settings!
 if (doVerifyExpertSettings() != 'agreed') {
@@ -50,13 +49,25 @@ if (doVerifyExpertSettings() != 'agreed') {
        return;
 } // END - if
 
+// By default we should display list/add new forms
+$GLOBALS['network_display'] = true;
+
 // Handle form here
 doNetworkHandleForm();
 
+// Display forms?
+if ($GLOBALS['network_display'] === false) {
+       // Abort here
+       return;
+} // END - if
+
 // Do we have a network selected?
-if (isGetRequestElementSet('network')) {
+if (isGetRequestParameterSet('network')) {
        // Get its data for template
-       $networkData = getNetworkDataById(getRequestElement('network'));
+       $networkData = getNetworkDataById(getRequestParameter('network'));
+
+       // Init disabled list
+       $GLOBALS['network_types_disabled'] = array();
 
        // Load all advert types for given network
        $result = SQL_QUERY_ESC("SELECT
@@ -67,26 +78,28 @@ WHERE
        `network_id`=%s
 ORDER BY
        `network_type_handle` ASC",
-               array(getRequestElement('network')), __FILE__, __LINE__);
+               array(getRequestParameter('network')), __FILE__, __LINE__);
 
        // Do we have entries?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // List all entries
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($row = SQL_FETCHARRAY($result)) {
                        // Add/translate some data
-                       $row['sw'] = $SW;
+                       $row['network_type_banner_url'] = fixNullEmptyToDashes($row['network_type_banner_url'], 3);
+
+                       // Set disabled entry
+                       $GLOBALS['network_types_disabled'][$row['network_type_handle']] = true;
 
                        // Add row template and switch color
                        $OUT .= loadTemplate('admin_list_network_types_row', true, $row);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Load main template
                loadTemplate('admin_list_network_types', false, $OUT);
        } else {
                // No entries found
-               loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_NETWORK_TYPES_404', $networkData['network_title']));
+               displayMessage(getMaskedMessage('ADMIN_NETWORK_TYPES_404', $networkData['network_title']));
        }
 
        // Free result