+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 06/01/2010 *
+ * =================== Last change: 06/01/2010 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : what-list_network_translations.php *
+ * -------------------------------------------------------------------- *
+ * Short description : List/manage network array translations *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Verwaltet API-Abfrageparameter *
+ * -------------------------------------------------------------------- *
+ * $Revision:: 1794 $ *
+ * $Date:: 2010-05-28 19:55:19 +0200 (Fri, 28 May 2010) $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: quix0r $ *
+ * 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, 2010 by Mailer Developer Team *
+ * For more information visit: http://www.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
+addMenuDescription('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
+
+// Do we have a network selected?
+if (isGetRequestParameterSet('network_type')) {
+ // Get network data from given type-id
+ $networkData = getNetworkDataByTypeId(getRequestParameter('network_type'));
+
+ // Init disabled list
+ $GLOBALS['network_translations_disabled'] = array();
+
+ // Load all advert codes for given network
+ $result = SQL_QUERY("SELECT
+ `network_translate_id`, `network_type_id`, `network_translation`
+FROM
+ `{?_MYSQL_PREFIX?}_network_translations`
+ORDER BY
+ `network_translate_id` ASC", __FILE__, __LINE__);
+
+ // Remember the rows
+ $rows = SQL_NUMROWS($result);
+
+ // Do we have entries?
+ if ($rows > 0) {
+ // List all entries
+ $OUT = ''; $SW = 2;
+ while ($row = SQL_FETCHARRAY($result)) {
+ // Add/translate some data
+ $row['sw'] = $SW;
+
+ // Add it to network if the type matches selected
+ if ($row['network_type_id'] == getRequestParameter('network_type_id')) {
+ // Matches, then add it for disabling this entry
+ $GLOBALS['network_translations_disabled'][$row['network_array_index']] = true;
+ } // END - if
+
+ // Add row template and switch color
+ $OUT .= loadTemplate('admin_list_network_translations_row', true, $row);
+ $SW = 3 - $SW;
+ } // END - while
+
+ // Prepare data for template
+ $content = array(
+ 'rows' => $OUT,
+ );
+
+ // Load main template
+ loadTemplate('admin_list_network_translations', false, $content);
+ } else {
+ // No entries found
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_NETWORK_TRANSLATIONS_404', $networkData['network_type_handle']));
+ }
+
+ // Free result
+ SQL_FREERESULT($result);
+
+ // Add form for adding new translations pair
+ loadTemplate('admin_add_network_translations');
+} else {
+ // Generate type-selection box
+ outputHtml(generateAdminDistinctNetworkTypeList());
+}
+
+// [EOF]
+?>