$SUB = getRequestElement('sub');
} // END - if
-// Get count of (maybe) selected menu points
-$chk = '0';
-if (isPostRequestElementSet('sel')) $chk = countPostSelection();
-
// List all menu points and make them editable
-if ((isPostRequestElementSet('edit')) && ($chk > 0) && (!isDemoModeActive())) {
+if ((isPostRequestElementSet('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
// Edit menu entries
// @TODO Kill all constants in this file
$content['sub'] = $SUB;
- $content['chk'] = $chk;
+ $content['chk'] = countPostSelection();
$cnt = '0'; $SW = 2;
foreach (postRequestElement('sel') as $sel => $confirm) {
if ($confirm == 1) {
// Load template
loadTemplate('admin_amenu_edit_form', false, $content);
-} elseif ((isPostRequestElementSet('del')) && (!isDemoModeActive())) {
+} elseif ((isPostRequestElementSet('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
// Prepare misc content
$content['sub'] = $SUB;
- $content['chk'] = $chk;
+ $content['chk'] = countPostSelection();
// Del menu entries with or without confirmation
$SW = 2; $cnt = '0'; $OUT = '';
// Add description as navigation point
addMenuDescription('admin', __FILE__);
-// Check for selected holidays
-$SUM = '0';
-if (isPostRequestElementSet('sel')) $SUM = countPostSelection();
-
// Shall I delete selected holidays???
-if ($SUM > 0) {
+if (countPostSelection() > 0) {
// Delete multiple holiday requests (for list_holiday)
$cnt = '0';
foreach (postRequestElement('sel') as $id => $sel) {
$SUB = getRequestElement('sub');
} // END - if
-// Get count of (maybe) selected menu points
-$chk = '0';
-if (isPostRequestElementSet('sel')) $chk = countPostSelection();
-
// List all menu points and make them editable
-if ((isPostRequestElementSet('edit')) && ($chk > 0) && (!isDemoModeActive())) {
+if ((isPostRequestElementSet('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
// Edit menu entries
$content['sub'] = $SUB;
- $content['chk'] = $chk;
+ $content['chk'] = countPostSelection();
$cnt = '0'; $OUT = ''; $SW = 2;
foreach (postRequestElement('sel') as $sel => $confirm) {
// Load template
loadTemplate('admin_gmenu_edit_form', false, $content);
-} elseif ((isPostRequestElementSet('del')) && (!isDemoModeActive())) {
+} elseif ((isPostRequestElementSet('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
// Del menu entries with or without confirmation
$content['sub'] = $SUB;
- $content['chk'] = $chk;
+ $content['chk'] = countPostSelection();
$cnt = '0';
$OUT = '';
loadTemplate('admin_menu_unknown_okay', false, postRequestElement('ok'));
break;
} // END - switch
-} elseif ((isPostRequestElementSet('status')) && ($chk > 0) && (!isDemoModeActive())) {
+} elseif ((isPostRequestElementSet('status')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
// Change status (visible / locked)
$content['sub'] = $SUB;
- $content['chk'] = $chk;
+ $content['chk'] = countPostSelection();
// Load template
$SW = 2; $cnt = '0'; $OUT = '';
$SUB = getRequestElement('sub');
} // END - if
-// Get count of (maybe) selected menu points
-$chk = '0';
-if (isPostRequestElementSet('sel')) $chk = countPostSelection();
-
// List all menu points and make them editable
-if ((isPostRequestElementSet('edit')) && ($chk > 0) && (!isDemoModeActive())) {
+if ((isPostRequestElementSet('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
// Edit menu entries
$content['sub'] = $SUB;
- $content['chk'] = $chk;
+ $content['chk'] = countPostSelection();
$SW = 2; $cnt = '0'; $OUT = '';
foreach (postRequestElement('sel') as $sel => $confirm) {
if ($confirm == 1) {
// Load template
loadTemplate('admin_mmenu_edit', false, $content);
-} elseif ((isPostRequestElementSet('del')) && ($chk > 0) && (!isDemoModeActive())) {
+} elseif ((isPostRequestElementSet('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
// Del menu entries with or without confirmation
$content['sub'] = $SUB;
- $content['chk'] = $chk;
+ $content['chk'] = countPostSelection();
$SW = 2; $cnt = '0'; $OUT = '';
foreach (postRequestElement('sel') as $sel => $confirm) {
if ($confirm == 1) {
// Load template
loadTemplate('admin_mmenu_delete', false, $content);
-} elseif ((isPostRequestElementSet('status')) && ($chk > 0) && (!isDemoModeActive())) {
+} elseif ((isPostRequestElementSet('status')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
// Change status (visible / locked)
$content['sub'] = $SUB;
- $content['chk'] = $chk;
+ $content['chk'] = countPostSelection();
$SW = 2; $cnt = '0'; $OUT = '';
foreach (postRequestElement('sel') as $sel => $confirm) {
if ($confirm == 1) {
}
// Wrapper for $_POST['sel']
-function countPostSelection () {
- return countSelection(postRequestElement('sel'));
+function countPostSelection ($element = 'sel') {
+ // Is it set?
+ if (isPostRequestElementSet($element)) {
+ // Return counted elements
+ return countSelection(postRequestElement($element));
+ } else {
+ // Return zero if not found
+ return 0;
+ }
}
// Checks wether the config-local.php is loaded