Modif ajout direct de la boite sans passer par la select box inutile
This commit is contained in:
parent
1516b60708
commit
7fe3b2d70e
@ -1,5 +1,5 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* 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);
|
$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";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes WHERE rowid=$rowid";
|
||||||
|
|
||||||
@ -98,6 +107,8 @@ if ($result)
|
|||||||
|
|
||||||
print '<tr class="pair"><td>'.$obj->name.'</td><td>' . $obj->file . '</td><td align="center">';
|
print '<tr class="pair"><td>'.$obj->name.'</td><td>' . $obj->file . '</td><td align="center">';
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
if ($rowid == $obj->rowid && $action == 'edit')
|
if ($rowid == $obj->rowid && $action == 'edit')
|
||||||
{
|
{
|
||||||
print '<form action="'.$PHP_SELF.'" method="POST">';
|
print '<form action="'.$PHP_SELF.'" method="POST">';
|
||||||
@ -105,28 +116,25 @@ if ($result)
|
|||||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||||
|
|
||||||
print '<select name="constvalue">';
|
print '<select name="constvalue">';
|
||||||
|
|
||||||
print '<option value="0">Homepage</option>';
|
print '<option value="0">Homepage</option>';
|
||||||
/*
|
|
||||||
print '<option value="1">Gauche</option>';
|
print '<option value="1">Gauche</option>';
|
||||||
print '<option value="1">Droite</option>';
|
print '<option value="1">Droite</option>';
|
||||||
*/
|
|
||||||
|
|
||||||
print '</select>';
|
print '</select>';
|
||||||
|
|
||||||
|
print '<input type="hidden" name="constvalue" value="0">';
|
||||||
print '<input type="submit" value="Ajouter">';
|
print '<input type="submit" value="Ajouter">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*/
|
||||||
|
if (! in_array($obj->rowid, $boxes))
|
||||||
|
{
|
||||||
|
print '<a href="'.$PHP_SELF.'?rowid='.$obj->rowid.'&action=add">Ajouter</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (! in_array($obj->rowid, $boxes))
|
print " ";
|
||||||
{
|
|
||||||
print '<a href="'.$PHP_SELF.'?rowid='.$obj->rowid.'&action=edit">Ajouter</a>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print " ";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user