]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-guestedit.php
Re-added, now the right ones
[mailer.git] / inc / modules / admin / what-guestedit.php
index ad43c6961a00096d4d43299c9d1bd8de8d97eb0e..3c7f812e4fd7803cf958b336742b0fd943764f3c 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Menue fuer die Gaeste editieren                  *
  * -------------------------------------------------------------------- *
- *                                                                      *
+ * $Revision:: 856                                                    $ *
+ * $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 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
@@ -44,22 +49,22 @@ ADD_DESCR("admin", __FILE__);
 $AND = "(`what` = '' OR `what` IS NULL)"; $SUB = "";
 
 if (REQUEST_ISSET_GET(('sub'))) {
-       $AND = sprintf("action='%s' AND `what` IS NOT NULL", SQL_ESCAPE(REQUEST_GET('sub')));
-       $SUB = SQL_ESCAPE(REQUEST_GET('sub'));
+       $AND = sprintf("action='%s' AND `what` IS NOT NULL", REQUEST_GET(('sub')));
+       $SUB = REQUEST_GET(('sub'));
 } // END - if
 
 // Get count of (maybe) selected menu points
 $chk = 0;
-if (REQUEST_ISSET_POST(('sel'))) $chk = SELECTION_COUNT(REQUEST_POST('sel'));
+if (REQUEST_ISSET_POST('sel')) $chk = SELECTION_COUNT(REQUEST_POST('sel'));
 
 // List all menu points and make them editable
-if ((REQUEST_ISSET_POST(('edit'))) && ($chk > 0) && (!IS_DEMO()))
+if ((REQUEST_ISSET_POST('edit')) && ($chk > 0) && (!IS_DEMO()))
 {
        // Edit menu entries
        define('__SUB_VALUE', $SUB);
        define('__CHK_VALUE', $chk);
 
-       $cnt = 0; $SW = 2; $OUT = "";
+       $cnt = 0; $OUT = ""; $SW = 2;
        foreach (REQUEST_POST('sel') as $sel => $confirm)
        {
                if ($confirm == 1)
@@ -99,7 +104,7 @@ if ((REQUEST_ISSET_POST(('edit'))) && ($chk > 0) && (!IS_DEMO()))
 
        // Load template
        LOAD_TEMPLATE("admin_gmenu_edit_form");
-} elseif ((REQUEST_ISSET_POST(('del'))) && (!IS_DEMO())) {
+} elseif ((REQUEST_ISSET_POST('del')) && (!IS_DEMO())) {
        // Del menu entries with or without confirmation
        define('__SUB_VALUE', $SUB);
        define('__CHK_VALUE', $chk);
@@ -269,13 +274,14 @@ if ((REQUEST_ISSET_POST(('edit'))) && ($chk > 0) && (!IS_DEMO()))
        } else {
                // List sub menus
                $result = SQL_QUERY_ESC("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC",
-                array($SUB), __FILE__, __LINE__);
+                       array($SUB), __FILE__, __LINE__);
        }
 
        // Get number of menu entries
        $max = SQL_NUMROWS($result);
        if ($max > 0) {
                // Set sub value
+               // @TODO Rewrite this constant
                define('__SUB_VALUE', $SUB);
 
                // Init variables
@@ -283,28 +289,30 @@ if ((REQUEST_ISSET_POST(('edit'))) && ($chk > 0) && (!IS_DEMO()))
                $cnt = 0;
                $OUT = "";
 
-               while (list($id, $act, $wht, $title, $sort) = SQL_FETCHROW($result)) {
+               // Process all menu entries
+               while ($content = SQL_FETCHARRAY($result)) {
                        $cnt++;
-                       if (($sort == 0) || (($sort == 1) && (!empty($SUB)))) {
+                       if (($content['sort'] == 0) || (($content['sort'] == 1) && (!empty($SUB)))) {
                                // Is highest position
-                               $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&amp;what=guestedit&amp;sub={!__SUB_VALUE!}&amp;act=".$act."&amp;w=".$wht."&amp;tid=".($sort+1)."&amp;fid=".$sort."\">{--LOWER--}</a>";
+                               $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&amp;what=guestedit&amp;sub={!__SUB_VALUE!}&amp;act=".$content['action']."&amp;w=".$content['what']."&amp;tid=".($content['sort']+1)."&amp;fid=".$content['sort']."\">{--LOWER--}</a>";
                        } elseif ($cnt == $max) {
                                // Is lowest position
-                               $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&amp;what=guestedit&amp;sub={!__SUB_VALUE!}&amp;act=".$act."&amp;w=".$wht."&amp;tid=".($sort-1)."&amp;fid=".$sort."\">{--HIGHER--}</a>";
-                       } elseif ($sort > 0) {
+                               $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&amp;what=guestedit&amp;sub={!__SUB_VALUE!}&amp;act=".$content['action']."&amp;w=".$content['what']."&amp;tid=".($content['sort']-1)."&amp;fid=".$content['sort']."\">{--HIGHER--}</a>";
+                       } elseif ($content['sort'] > 0) {
                                // Anything else between highest and lowest
-                               $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&amp;what=guestedit&amp;sub={!__SUB_VALUE!}&amp;act=".$act."&amp;w=".$wht."&amp;tid=".($sort-1)."&amp;fid=".$sort."\">{--HIGHER--}</a>/<a href=\"{!URL!}/modules.php?module=admin&amp;what=guestedit&amp;sub={!__SUB_VALUE!}&amp;act=".$act."&amp;w=".$wht."&amp;tid=".($sort+1)."&amp;fid=".$sort."\">{--LOWER--}</a>";
+                               $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&amp;what=guestedit&amp;sub={!__SUB_VALUE!}&amp;act=".$content['action']."&amp;w=".$content['what']."&amp;tid=".($content['sort']-1)."&amp;fid=".$content['sort']."\">{--HIGHER--}</a>/<a href=\"{!URL!}/modules.php?module=admin&amp;what=guestedit&amp;sub={!__SUB_VALUE!}&amp;act=".$content['action']."&amp;w=".$content['what']."&amp;tid=".($content['sort']+1)."&amp;fid=".$content['sort']."\">{--LOWER--}</a>";
                        }
 
-                       if (empty($act))   $act   = "&nbsp;";
-                       if (empty($wht))   $wht   = "&nbsp;";
-                       if (empty($title)) $title = "&nbsp;";
+                       if (empty($content['action'])) $content['action'] = "&nbsp;";
+                       if (empty($content['what']))   $content['what']   = "&nbsp;";
+                       if (empty($content['title']))  $content['title']  = "&nbsp;";
+
                        $content = array(
                                'sw'     => $SW,
-                               'id'     => $id,
-                               'action' => $act,
-                               'what'   => $wht,
-                               'title'  => $title,
+                               'id'     => $content['id'],
+                               'action' => $content['action'],
+                               'what'   => $content['what'],
+                               'title'  => $content['title'],
                                'navi'   => $NAVI,
                                'mode'   => "guest"
                        );