diff --git a/htdocs/admin/editeur.php b/htdocs/admin/editeur.php new file mode 100644 index 00000000000..8a10061c5ea --- /dev/null +++ b/htdocs/admin/editeur.php @@ -0,0 +1,118 @@ + + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + */ + +/** + \file htdocs/admin/adherent.php + \ingroup editeur + \brief Page d'administration/configuration du module Editeur + \version $Revision$ +*/ + +require("./pre.inc.php"); + +$langs->load("admin"); + +if (!$user->admin) + accessforbidden(); + +// Action activation d'un sous module du module adhérent +if ($_POST["action"] == 'set') +{ + $name = "EDITEUR_LIVRE_FORMAT_".time(); + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."const(name,value,visible) values ('".$name."','".addslashes($_POST["format"])."', 0);"; + + $result=$db->query($sql); + if ($result) + { + Header("Location: editeur.php"); + exit; + } + else + { + dolibarr_print_error($db); + exit; + } +} + +// Action désactivation d'un sous module du module adhérent +if ($_GET["action"] == 'unset') +{ + $sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name LIKE 'EDITEUR_LIVRE_FORMAT_%'"; + $sql .= " AND rowid='".$_GET["id"]."';"; + + if ($db->query($sql)) + { + Header("Location: editeur.php"); + exit; + } +} + +llxHeader(); + +/* + * Interface de configuration de certaines variables de la partie editeur + */ + +print_fiche_titre($langs->trans("Configuration du module Editeur"),'','setup'); + +print '
'; +print ''; + +print ''; +print "\n"; + +print '
".$langs->trans("Nouveau format").''; +print ''; +print ''; +print ''; +print "
'; +print '
'; +print '
'; + +print ''; +print ''; +print ''; +print ''; +print "\n"; +$var=true; + + +$sql = "SELECT rowid,value FROM ".MAIN_DB_PREFIX."const WHERE name LIKE 'EDITEUR_LIVRE_FORMAT_%'"; +$result = $db->query($sql); + +while ($obj = $db->fetch_object($result) ) +{ + $var=!$var; + + print "\n"; + + print '\n"; +} + +print '
Formats définits'.$langs->trans("Action").'
".nl2br($obj->value)."'; + print ''.$langs->trans('Delete').''; + print "
'; + +$db->close(); + +llxFooter('$Date$ - $Revision$'); +?>