* $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 *
// Get its data for template
$networkData = getNetworkDataById(getRequestParameter('network'));
- // Is a network type selected?
- if (!isGetRequestParameterSet('network_type')) {
- // Then present a new selection form
- outputHtml(generateAdminNetworkTypeList(getRequestParameter('network'), getRequestParameter('network_type')));
-
- // Abort any other processing
- return;
- } // END - if
+ // Init type
+ $networkData['network_type_id'] = 0;
// Init disabled list
- $GLOBALS['network_api_translation_disabled'] = array();
+ $GLOBALS['network_translation_disabled'] = array();
+
+ // Only show params from given type handler if choosen
+ $ADD = '';
+ if ((isPostRequestParameterSet('network_type_id')) && (!is_array(postRequestParameter('network_type_id')))) {
+ // Only show from current type handler
+ $ADD = sprintf(" AND p.`network_type_id`=%s", bigintval(postRequestParameter('network_type_id')));
+
+ // Overwrite type
+ $networkData['network_type_id'] = bigintval(postRequestParameter('network_type_id'));
+
+ // Display message
+ loadTemplate('admin_settings_saved', false, '{--ADMIN_NETWORK_API_TRANSLATION_LIST_LIMITED_TO_TYPE--}');
+ } // END - if
// Load all advert codes for given network
$result = SQL_QUERY_ESC("SELECT
- p.`network_api_id`, t.`network_type_id`, t.`network_type_handle`, p.`network_api_index`, p.`network_index_translation`
+ p.`network_api_id`, t.`network_type_id`, t.`network_type_handle`, p.`network_api_index`, p.`sort`
FROM
`{?_MYSQL_PREFIX?}_network_api_translation` AS p
INNER JOIN
ON
p.`network_type_id`=t.`network_type_id`
WHERE
- p.`network_id`=%s AND
- p.`network_type_id`=%s
+ p.`network_id`=%s
+ ".$ADD."
ORDER BY
t.`network_type_handle` ASC,
p.`network_api_id` ASC",
array(
- bigintval(getRequestParameter('network')),
- bigintval(getRequestParameter('network_type'))
+ bigintval(getRequestParameter('network'))
), __FILE__, __LINE__);
// Do we have entries?
$OUT = '';
while ($row = SQL_FETCHARRAY($result)) {
// Add it to network if the type matches selected
- if ($row['network_type_id'] == getRequestParameter('network_type_id')) {
+ if ($row['network_type_id'] == postRequestParameter('network_type_id')) {
// Matches, then add it for disabling this entry
- $GLOBALS['network_api_translation_disabled'][$row['network_api_index']] = true;
+ $GLOBALS['network_translation_disabled'][$row['network_api_index']] = true;
} // END - if
// Add row template and switch color
$OUT .= loadTemplate('admin_list_network_api_translation_row', true, $row);
} // END - while
- // Prepare data for template
- $content = array(
- 'rows' => $OUT,
- 'network_id' => bigintval(getRequestParameter('network')),
- 'network_title' => $networkData['network_title'],
- 'network_reflink' => $networkData['network_reflink'],
- );
-
// Load main template
- loadTemplate('admin_list_network_api_translation', false, $content);
+ loadTemplate('admin_list_network_api_translation', false, $OUT);
} else {
// No entries found
- loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_NETWORK_ARRAY_TRANSLATION_404', $networkData['network_title']));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_NETWORK_API_TRANSLATION_404', $networkData['network_title']));
}
- // Add options list for network type
- $networkData['translation_index'] = (SQL_NUMROWS($result) + 1);
- $networkData['type_options'] = generateNetworkTypeOptions(getRequestParameter('network_type_id'));
-
// Free result
SQL_FREERESULT($result);