X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_network_params.php;h=12fc5b7cff2c74cdee5ee790cdd47facfc9900d2;hb=8ce32e702f3caa76b8d446902948e83e1e6854c8;hp=24657e39c224c8ac8eb4edbdf7b551fced580eaa;hpb=09f5758c42a33a56bdd461c946ffe759a59c54aa;p=mailer.git diff --git a/inc/modules/admin/what-list_network_params.php b/inc/modules/admin/what-list_network_params.php index 24657e39c2..12fc5b7cff 100644 --- a/inc/modules/admin/what-list_network_params.php +++ b/inc/modules/admin/what-list_network_params.php @@ -14,12 +14,10 @@ * $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, 2010 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2011 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 * @@ -43,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') { @@ -64,26 +62,35 @@ if ($GLOBALS['network_display'] === false) { } // END - if // Do we have a network selected? -if (isGetRequestParameterSet('network')) { +if (isGetRequestElementSet('network_id')) { // Get its data for template - $networkData = getNetworkDataById(getRequestParameter('network')); + $networkData = getNetworkDataById(getRequestElement('network_id')); + $networkData['network_type_id'] = 0; // Init disabled list - $networkData['disabled'] = array(); + $GLOBALS['network_params_disabled'] = array(); // Only show params from given type handler if choosen $ADD = ''; - if (isPostRequestParameterSet('network_type_id')) { + 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(postRequestParameter('network_type_id'))); + $ADD = sprintf(" AND p.`network_type_id`=%s", bigintval(postRequestElement('network_type_id'))); + + // Overwrite type id + $networkData['network_type_id'] = bigintval(postRequestElement('network_type_id')); // Display message - loadTemplate('admin_settings_saved', false, getMessage('ADMIN_NETWORK_PARAMS_LIST_LIMITED_TO_TYPE')); + displayMessage('{--ADMIN_NETWORK_REQUEST_PARAMETER_LIST_LIMITED_TO_TYPE--}'); } // END - if // Load all advert types for given network $result = SQL_QUERY_ESC("SELECT - p.`network_param_id`, t.`network_type_id`, t.`network_type_handle`, p.`request_param_key`, p.`request_param_value`, p.`request_param_default` + p.`network_param_id`, + t.`network_type_id`, + t.`network_type_handle`, + p.`network_request_param_key`, + p.`network_request_param_value`, + p.`network_request_param_default` FROM `{?_MYSQL_PREFIX?}_network_request_params` AS p INNER JOIN @@ -95,100 +102,36 @@ WHERE ORDER BY t.`network_type_handle` ASC, p.`network_param_id` ASC", - array(getRequestParameter('network')), __FILE__, __LINE__); + array(getRequestElement('network_id')), __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; - // Add it to network if the type matches selected - if ($row['network_type_id'] == postRequestParameter('network_type_id')) { + if ($row['network_type_id'] == postRequestElement('network_type_id')) { // Matches, then add it for disabling this entry - $networkData['disabled'][$row['request_param_key']] = true; + $GLOBALS['network_params_disabled'][$row['network_request_param_key']] = true; } // END - if // Is default value empty or null? - if ((is_null($row['request_param_default'])) || (trim($row['request_param_default']) == '')) { - // Fix it to three dashes - $row['request_param_default'] = '---'; - } // END - if + $row['network_request_param_default'] = fixNullEmptyToDashes($row['network_request_param_default'], 3); // Add row template and switch color $OUT .= loadTemplate('admin_list_network_params_row', true, $row); - $SW = 3 - $SW; } // END - while - // Prepare data for template - $content = array( - 'rows' => $OUT, - 'network_id' => getRequestParameter('network'), - 'network_title' => $networkData['network_title'], - 'network_reflink' => $networkData['network_reflink'], - ); - // Load main template - loadTemplate('admin_list_network_params', false, $content); + loadTemplate('admin_list_network_params', false, $OUT); } else { // No entries found - loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_NETWORK_PARAMS_404', $networkData['network_title'])); + displayMessage('{%message,ADMIN_NETWORK_REQUEST_PARAMETER_404=' . $networkData['network_title'] . '%}'); } // Free result SQL_FREERESULT($result); - // Add options list for network type - $networkData['type_options'] = generateOptionList( - 'network_types', - 'network_type_id', - 'network_type_handle', - postRequestParameter('network_type_id'), - '', - sprintf("WHERE `network_id`=%s", getRequestParameter('network')) - ); - - // Add options for parameter keys - $networkData['key_options'] = generateOptionList( - '/ARRAY/', - array( - 'id', - 'sid', - 'hash', - 'password', - 'reload', - 'max_stay', - 'min_stay', - 'currency', - 'type', - 'remain', - 'reward', - 'size', - 'erotic', - 'extra' - ), - array( - '{--ADMIN_NETWORK_PARAMS_ID--}', - '{--ADMIN_NETWORK_PARAMS_SID--}', - '{--ADMIN_NETWORK_PARAMS_HASH--}', - '{--ADMIN_NETWORK_PARAMS_PASSWORD--}', - '{--ADMIN_NETWORK_PARAMS_RELOAD--}', - '{--ADMIN_NETWORK_PARAMS_MAXIMUM_STAY--}', - '{--ADMIN_NETWORK_PARAMS_MINIMUM_STAY--}', - '{--ADMIN_NETWORK_PARAMS_CURRENCY--}', - '{--ADMIN_NETWORK_PARAMS_TYPE--}', - '{--ADMIN_NETWORK_PARAMS_REMAIN--}', - '{--ADMIN_NETWORK_PARAMS_REWARD--}', - '{--ADMIN_NETWORK_PARAMS_SIZE--}', - '{--ADMIN_NETWORK_PARAMS_EROTIC--}', - '{--ADMIN_NETWORK_PARAMS_EXTRA--}' - ), - '', '', '', - $networkData['disabled'] - ); - // Add form for adding new params loadTemplate('admin_add_network_params', false, $networkData); } else {