* 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 *
} // END - if
// List all menu points and make them editable
-if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Edit menu entries
// @TODO Kill all constants in this file
$content['sub'] = $SUB;
$content['chk'] = countPostSelection();
- $cnt = '0'; $SW = 2;
+ $cnt = '0';
foreach (postRequestParameter('sel') as $sel => $confirm) {
if ($confirm == 1) {
$cnt++;
$data = array(
'action' => adminAddMenuSelectionBox('admin', 'action', 'sel_action[' . $sel . ']', $data['action']),
'what' => adminAddMenuSelectionBox('admin', 'what' , 'sel_what[' . $sel . ']', $data['what']),
- 'sw' => $SW,
'sel' => $sel,
'menu' => $data['title'],
'descr' => $data['descr'],
} else {
// Entry not found?
$data = array(
- 'sw' => $SW,
'sel' => $sel
);
// Free result and switch color
SQL_FREERESULT($result);
- $SW = 3 - $SW;
} // END - if
} // END - foreach
// Load template
loadTemplate('admin_amenu_edit_form', false, $content);
-} elseif ((isPostRequestParameterSet('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Prepare misc content
$content['sub'] = $SUB;
$content['chk'] = countPostSelection();
// Del menu entries with or without confirmation
- $SW = 2; $cnt = '0'; $OUT = '';
+ $cnt = '0'; $OUT = '';
foreach (postRequestParameter('sel') as $sel => $confirm) {
if ($confirm == 1) {
$cnt++;
'menu' => $data['title'],
'cnt' => $cnt,
'sel' => $sel,
- 'sw' => $SW
);
$OUT .= loadTemplate('admin_amenu_delete_row', true, $data);
} else {
// Entry not found?
$data = array(
- 'sw' => $SW,
'sel' => $sel
);
$OUT .= loadTemplate('admin_menu_404_row', true, $data);
}
SQL_FREERESULT($result);
- $SW = 3 - $SW;
- }
- }
+ } // END - if
+ } // END - switch
$content['rows'] = $OUT;
$content['cnt'] = $cnt;
}
// Load template
- loadTemplate('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
+ loadTemplate('admin_settings_saved', false, '{--SETTINGS_SAVED--}');
break;
case 'del': // Delete menu
} // END - foreach
// Load template
- loadTemplate('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
+ loadTemplate('admin_settings_saved', false, '{--SETTINGS_SAVED--}');
break;
default: // Unexpected action
$content['sub'] = $SUB;
// Init variables
- $OUT = ''; $SW = 2; $cnt = '0';
+ $OUT = ''; $cnt = '0';
// Process all entries
while ($data = SQL_FETCHARRAY($result)) {
$data['navi'] = '<a href="{%url=modules.php?module=admin&what=adminedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']-1) . '&fid=' . $data['sort'] . '%}">{--HIGHER--}</a>/<a href="{%url=modules.php?module=admin&what=adminedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']+1) . '&fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
}
- // Fix empty elements for constant (fixes display bugs in Firefox)
- if (empty($data['action'])) $data['action'] = ' ';
- if (empty($data['what'])) $data['what'] = ' ';
- if (empty($data['title'])) $data['title'] = ' ';
-
// Add more data to $data
- $data['sw'] = $SW;
$data['mode'] = 'admin';
// Load row template and switch colors
$OUT .= loadTemplate('admin_menu_overview_row', true, $data);
- $SW = 3 - $SW;
} // END - switch
// Remember all rows
loadTemplate('admin_amenu_edit', false, $content);
} else {
// Menu entries are missing... (???)
- loadTemplate('admin_settings_saved', false, getMessage('ADMIN_NO_MENUS_FOUND'));
+ loadTemplate('admin_settings_saved', false, '{--ADMIN_NO_MENUS_FOUND--}');
}
}