]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-memedit.php
Even more rewrites/fixes from EL branch (please report any broken part after you...
[mailer.git] / inc / modules / admin / what-memedit.php
index 0370abeeb87714a402585aebfbda431e07ce4a88..3194832be964010a38f295f873cbbe7bb8aadee6 100644 (file)
@@ -18,6 +18,7 @@
  * 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 *
@@ -53,7 +54,7 @@ if (isGetRequestParameterSet('sub')) {
 } // END - if
 
 // List all menu points and make them editable
-if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
        // Edit menu entries
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
@@ -96,7 +97,7 @@ if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0) && (!isDem
 
        // Load template
        loadTemplate('admin_mmenu_edit', false, $content);
-} elseif ((isPostRequestParameterSet('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
        // Del menu entries with or without confirmation
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
@@ -182,8 +183,11 @@ if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0) && (!isDem
        // An act is done...
        foreach (postRequestParameter('sel') as $sel => $menu) {
                $AND = "(`what` = '' OR `what` IS NULL)";
+
                $sel = bigintval($sel);
-               if (!empty($SUB)) $AND = "`action`='".$SUB."'";
+
+               if (!empty($SUB)) $AND = "`action`='" . $SUB . "'";
+
                switch (postRequestParameter('ok')) {
                        case 'edit': // Edit menu
                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `title`='%s', `action`='%s', `what`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
@@ -199,8 +203,12 @@ if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0) && (!isDem
                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='%s', `locked`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
                                        array(postRequestParameter('visible', $sel), postRequestParameter('locked', $sel), $sel), __FILE__, __LINE__);
                                break;
+
+                       default: // Unexpected action
+                               logDebugMessage(__FILE__, __LINE__, sprintf("Unsupported action %s detected.", postRequestParameter('ok')));
+                               loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_UNKNOWN_OKAY', postRequestParameter('ok')));
+                               break;
                } // END - switch
-               break;
        } // END - foreach
 
        // Load template