]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-adminedit.php
Fixes saving of settings, inconsistency fixed in config entries
[mailer.git] / inc / modules / admin / what-adminedit.php
index cf97dffe96d73f7041fb640dd5287ef580748fdf..de04b2d671ef3fb6ff4d376f34f6df33afff93cd 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 09/05/2003 *
- * ===============                              Last change: 12/13/2004 *
+ * Mailer v0.2.1-FINAL                                Start: 09/05/2003 *
+ * ===================                          Last change: 12/13/2004 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : what-adminedit.php                               *
@@ -51,16 +51,12 @@ if (isGetRequestElementSet('sub')) {
        $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) {
@@ -106,10 +102,10 @@ if ((isPostRequestElementSet('edit')) && ($chk > 0) && (!isDemoModeActive())) {
 
        // 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 = '';
@@ -161,7 +157,7 @@ if ((isPostRequestElementSet('edit')) && ($chk > 0) && (!isDemoModeActive())) {
 `action`='%s',
 `what`='%s',
 `descr`='%s'
-WHERE ".$AND." AND id=%s LIMIT 1",
+WHERE ".$AND." AND `id`=%s LIMIT 1",
                                array(
                                $menu,
                                postRequestElement('sel_action', $sel),
@@ -217,9 +213,9 @@ WHERE ".$AND." AND id=%s LIMIT 1",
 
                if ((!empty($tid)) && (!empty($fid))) {
                        // Sort menu
-                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `sort`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `sort`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
                                array(bigintval(getRequestElement('tid')), bigintval($fid)), __FILE__, __LINE__);
-                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `sort`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `sort`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
                                array(bigintval(getRequestElement('fid')), bigintval($tid)), __FILE__, __LINE__);
                }
        }
@@ -251,13 +247,13 @@ WHERE ".$AND." AND id=%s LIMIT 1",
                        $data['navi'] = '';
                        if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($SUB)))) {
                                // Is highest position
-                               $data['navi'] = "<a href=\"{?URL?}/modules.php?module=admin&amp;what=adminedit&amp;sub=".$content['sub']."&amp;act=".$data['action']."&amp;w=".$data['what']."&amp;tid=".($data['sort']+1)."&amp;fid=".$data['sort']."\">{--LOWER--}</a>";
+                               $data['navi'] = '<a href="{%url=modules.php?module=admin&amp;what=adminedit&amp;sub=' . $content['sub'] . '&amp;act=' . $data['action'] . '&amp;w=' . $data['what'] . '&amp;tid=' . ($data['sort']+1) . '&amp;fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
                        } elseif ($cnt == $max) {
                                // Is lowest position
-                               $data['navi'] = "<a href=\"{?URL?}/modules.php?module=admin&amp;what=adminedit&amp;sub=".$content['sub']."&amp;act=".$data['action']."&amp;w=".$data['what']."&amp;tid=".($data['sort']-1)."&amp;fid=".$data['sort']."\">{--HIGHER--}</a>";
+                               $data['navi'] = '<a href="{%url=modules.php?module=admin&amp;what=adminedit&amp;sub=' . $content['sub'] . '&amp;act=' . $data['action'] . '&amp;w=' . $data['what'] . '&amp;tid=' . ($data['sort']-1) . '&amp;fid=' . $data['sort'] . '%}">{--HIGHER--}</a>';
                        } elseif ($data['sort'] > 0) {
                                // Anything else between highest and lowest
-                               $data['navi'] = "<a href=\"{?URL?}/modules.php?module=admin&amp;what=adminedit&amp;sub=".$content['sub']."&amp;act=".$data['action']."&amp;w=".$data['what']."&amp;tid=".($data['sort']-1)."&amp;fid=".$data['sort']."\">{--HIGHER--}</a>/<a href=\"{?URL?}/modules.php?module=admin&amp;what=adminedit&amp;sub=".$content['sub']."&amp;act=".$data['action']."&amp;w=".$data['what']."&amp;tid=".($data['sort']+1)."&amp;fid=".$data['sort']."\">{--LOWER--}</a>";
+                               $data['navi'] = '<a href="{%url=modules.php?module=admin&amp;what=adminedit&amp;sub=' . $content['sub'] . '&amp;act=' . $data['action'] . '&amp;w=' . $data['what'] . '&amp;tid=' . ($data['sort']-1) . '&amp;fid=' . $data['sort'] . '%}">{--HIGHER--}</a>/<a href="{%url=modules.php?module=admin&amp;what=adminedit&amp;sub=' . $content['sub'] . '&amp;act=' . $data['action'] . '&amp;w=' . $data['what'] . '&amp;tid=' . ($data['sort']+1) . '&amp;fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
                        }
 
                        // Fix empty elements for constant (fixes display bugs in Firefox)