]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_network_array_translation.php
Rewrote 'we' word a little, rewrote mail order to use SQL_INSERTID() instead of anoth...
[mailer.git] / inc / modules / admin / what-list_network_array_translation.php
index f551ef47b7591c74e7b59193e56a1fa6505a87ab..1857f48a2edbc7c61273467ea10c79a4be4ddc54 100644 (file)
@@ -1,3 +1,144 @@
 <?php
-// @DEPRECATED
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 04/22/2010 *
+ * ===================                          Last change: 04/22/2010 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_network_array_translation.php          *
+ * -------------------------------------------------------------------- *
+ * Short description : List/manage network array index translations     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Verwaltet API-Abfrageparameter                   *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+       die();
+} // END - if
+
+// Add description as navigation point
+addYouAreHereLink('admin', __FILE__);
+
+// These are expert settings!
+if (doVerifyExpertSettings() != 'agreed') {
+       // Abort here
+       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
+
+// Is there a network selected?
+if (isGetRequestElementSet('network_id')) {
+       // Get its data for template
+       $networkData = getNetworkDataById(getRequestElement('network_id'));
+
+       // Init type
+       $networkData['network_type_id'] = 0;
+
+       // Init disabled list
+       $GLOBALS['network_translation_disabled'] = array();
+
+       // Only show params from given type handler if choosen
+       $ADD = '';
+       if ((isPostRequestElementSet('network_type_id')) && (!is_array(postRequestElement('network_type_id')))) {
+               // Only show from current type handler
+               $ADD = sprintf(" AND p.`network_type_id`=%s", bigintval(postRequestElement('network_type_id')));
+
+               // Overwrite type
+               $networkData['network_type_id'] = bigintval(postRequestElement('network_type_id'));
+
+               // Display message
+               displayMessage('{--ADMIN_LIST_NETWORK_ARRAY_TRANSLATION_LIMITED_TO_TYPE--}');
+       } // END - if
+
+       // Load all advert codes for given network
+       $result = SQL_QUERY_ESC("SELECT
+       p.`network_array_id`,
+       t.`network_type_id`,
+       t.`network_type_handler`,
+       p.`network_array_index`,
+       p.`sort`
+FROM
+       `{?_MYSQL_PREFIX?}_network_array_translation` AS p
+INNER JOIN
+       `{?_MYSQL_PREFIX?}_network_types` AS t
+ON
+       p.`network_type_id`=t.`network_type_id`
+WHERE
+       p.`network_id`=%s
+       ".$ADD."
+ORDER BY
+       t.`network_type_handler` ASC,
+       p.`network_array_id` ASC",
+               array(
+                       bigintval(getRequestElement('network_id'))
+               ), __FILE__, __LINE__);
+
+       // Are there entries?
+       if (!SQL_HASZERONUMS($result)) {
+               // List all entries
+               $OUT = '';
+               while ($row = SQL_FETCHARRAY($result)) {
+                       // Add it to network if the type matches selected
+                       if ($row['network_type_id'] == postRequestElement('network_type_id')) {
+                               // Matches, then add it for disabling this entry
+                               $GLOBALS['network_translation_disabled'][$row['network_array_index']] = true;
+                       } // END - if
+
+                       // Add row template and switch color
+                       $OUT .= loadTemplate('admin_list_network_array_translation_row', true, $row);
+               } // END - while
+
+               // Load main template
+               loadTemplate('admin_list_network_array_translation', false, $OUT);
+       } else {
+               // No entries found
+               displayMessage('{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_404=' . $networkData['network_title'] . '%}');
+       }
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Add form for adding new array_translation pair
+       loadTemplate('admin_add_network_array_translation', false, $networkData);
+} else {
+       // Generate network list for this script
+       outputHtml(generateAdminNetworkList());
+}
+
+// [EOF]
 ?>