* -------------------------------------------------------------------- *
* Kurzbeschreibung : Das Admin-Menue editieren *
* -------------------------------------------------------------------- *
- * *
+ * $Revision:: $ *
+ * $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 *
$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'));
}
// 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);
// Load template
LOAD_TEMPLATE("admin_amenu_edit_form");
}
- elseif ((REQUEST_ISSET_POST(('del'))) && (!IS_DEMO()))
+ elseif ((REQUEST_ISSET_POST('del')) && (!IS_DEMO()))
{
define('__SUB_VALUE', $SUB);
define('__CHK_VALUE', $chk);
$max = SQL_NUMROWS($result);
if ($max > 0) {
+ // @TODO Rewrite this constant
define('__SUB_VALUE', $SUB);
- $SW = 2;
- $cnt = 0;
- $OUT = "";
- while (list($id, $act, $wht, $title, $sort) = SQL_FETCHROW($result)) {
+
+ // Init variables
+ $OUT = ""; $SW = 2; $cnt = 0;
+
+ // Process all entries
+ while ($content = SQL_FETCHARRAY($result)) {
+ // Count this entry
$cnt++;
- if (($sort == 0) || (($sort == 1) && (!empty($SUB)))) {
+
+ // Init navigation variable
+ $content['navi'] = "";
+ if (($content['sort'] == 0) || (($content['sort'] == 1) && (!empty($SUB)))) {
// Is highest position
- $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&what=adminedit&sub={!__SUB_VALUE!}&act=".$act."&w=".$wht."&tid=".($sort+1)."&fid=".$sort."\">{--LOWER--}</a>";
+ $content['navi'] = "<a href=\"{!URL!}/modules.php?module=admin&what=adminedit&sub={!__SUB_VALUE!}&act=".$content['action']."&w=".$content['what']."&tid=".($content['sort']+1)."&fid=".$content['sort']."\">{--LOWER--}</a>";
} elseif ($cnt == $max) {
// Is lowest position
- $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&what=adminedit&sub={!__SUB_VALUE!}&act=".$act."&w=".$wht."&tid=".($sort-1)."&fid=".$sort."\">{--HIGHER--}</a>";
- } elseif ($sort > 0) {
+ $content['navi'] = "<a href=\"{!URL!}/modules.php?module=admin&what=adminedit&sub={!__SUB_VALUE!}&act=".$content['action']."&w=".$content['what']."&tid=".($content['sort']-1)."&fid=".$content['sort']."\">{--HIGHER--}</a>";
+ } elseif ($content['sort'] > 0) {
// Anything else between highest and lowest
- $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&what=adminedit&sub={!__SUB_VALUE!}&act=".$act."&w=".$wht."&tid=".($sort-1)."&fid=".$sort."\">{--HIGHER--}</a>/<a href=\"{!URL!}/modules.php?module=admin&what=adminedit&sub={!__SUB_VALUE!}&act=".$act."&w=".$wht."&tid=".($sort+1)."&fid=".$sort."\">{--LOWER--}</a>";
+ $content['navi'] = "<a href=\"{!URL!}/modules.php?module=admin&what=adminedit&sub={!__SUB_VALUE!}&act=".$content['action']."&w=".$content['what']."&tid=".($content['sort']-1)."&fid=".$content['sort']."\">{--HIGHER--}</a>/<a href=\"{!URL!}/modules.php?module=admin&what=adminedit&sub={!__SUB_VALUE!}&act=".$content['action']."&w=".$content['what']."&tid=".($content['sort']+1)."&fid=".$content['sort']."\">{--LOWER--}</a>";
}
- if (empty($act)) $act = " ";
- if (empty($wht)) $wht = " ";
- if (empty($title)) $title = " ";
+ // Fix empty elements for constant (fixes display bugs in Firefox)
+ if (empty($content['action'])) $content['action'] = " ";
+ if (empty($content['what'])) $content['what'] = " ";
+ if (empty($content['title'])) $content['title'] = " ";
- $content = array(
- 'sw' => $SW,
- 'id' => $id,
- 'action' => $act,
- 'what' => $wht,
- 'title' => $title,
- 'navi' => $NAVI,
- 'mode' => "admin",
- );
+ // Add more data to $content
+ $content['sw'] = $SW;
+ $content['mode'] = "admin";
+ // Load row template and switch colors
$OUT .= LOAD_TEMPLATE("admin_menu_overview_row", true, $content);
$SW = 3 - $SW;
- }
+ } // END - switch
// Free memory
SQL_FREERESULT($result);
+
+ // Rewrite this constant
define('__MENU_ROWS', $OUT);
// Load template