From 7fe3b2d70e22897e6a93375adfc7618d87a957da Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Fri, 13 Feb 2004 08:45:43 +0000 Subject: [PATCH] Modif ajout direct de la boite sans passer par la select box inutile --- htdocs/admin/boxes.php | 46 +++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 2cc3267493c..7567e721910 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2003-2004 Rodolphe Quiedeville * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,7 +32,16 @@ if ($HTTP_POST_VARS["action"] == 'add') $result = $db->query($sql); } -if ($action == 'delete') +if ($_GET["action"] == 'add') +{ + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (box_id, position) values (".$_GET["rowid"].",0);"; + + $result = $db->query($sql); +} + + +if ($_GET["action"] == 'delete') { $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes WHERE rowid=$rowid"; @@ -98,37 +107,36 @@ if ($result) print ''.$obj->name.'' . $obj->file . ''; + /* + if ($rowid == $obj->rowid && $action == 'edit') { print '
'; print ''; print ''; - - print ''; print ''; - /* print ''; print ''; - */ - print ''; - + + print ''; print ''; print '
'; - } - else + } + else + { + */ + if (! in_array($obj->rowid, $boxes)) { - if (! in_array($obj->rowid, $boxes)) - { - print 'Ajouter'; - } - else - { - print " "; - } + print 'Ajouter'; } - + else + { + print " "; + } + print ''; $i++;