<?php

include ("config.php");

$highlight_menu = 4;
$highlight_sous_menu = 1;
$display_menu = true;

_request("id_mod");
_post("mod_nom", "edit_submit");

if (empty($edit_submit) && $info_mod = $menu->get_module($id_mod))
	$mod_nom = $info_mod["mod_nom"];

if ($edit_submit)
{
	if ($mod_nom)
	{
		if ($menu->edit_module($id_mod, $mod_nom))
			header ("Location: module.php?action=ajout");
	}
	else
		$error = 2;
}

include ("header.php");

if (!empty($error))
{
	if (is_int($error)) 
		echo "<p class=\"center error\">" . $error_list[$error] . "</p>\n";
	else
		echo "<p class=\"center error\">" . $error . "</p>\n";
}

echo "<p class=\"center\">(" . req() . ") Champs &agrave; remplir obligatoirement</p>\n";

echo "<div id=\"form-menu\">\n";
echo "<form action=\"module_edition.php\" method=\"post\">\n";
echo "<table class=\"center\">\n";

echo "<tr>\n";
echo "<th class=\"center\" colspan=\"2\">Informations concernant un module</th>\n";
echo "</tr>\n";

echo "<tr>\n";
echo "<td class=\"r\"><label for=\"mod_nom\">Nom</label> " . req() . "</td>\n";
echo "<td><input type=\"text\" class=\"int\" name=\"mod_nom\" id=\"mod_nom\" value=\"" . $mod_nom . "\" /></td>\n";
echo "</tr>\n";

echo "<tr>\n";
echo "<td class=\"center\" colspan=\"2\">";
echo "<input type=\"hidden\" name=\"id_mod\" value=\"" . $id_mod . "\" />";
echo "<input class=\"inb\" type=\"submit\" name=\"edit_submit\" value=\"Enregistrer\" />";
echo "</td>\n";
echo "</tr>\n";

echo "</table>\n";
echo "</form>\n";
echo "</div>\n";

echo "<p><a class=\"slink\" href=\"module.php\">Retour &agrave; la liste des modules</a></p>\n";

include ("footer.php");

?>