Skip to content
Snippets Groups Projects
Commit bcfc45f7 authored by Patrick Lafrance's avatar Patrick Lafrance
Browse files

Rendu l'option défaut facultative dans menu_lang

parent 95970dfc
Branches
No related tags found
No related merge requests found
......@@ -2,10 +2,14 @@
require_once('modele.php');
function menu_lang($langid=1){
return "
<select id='langid' name='langid' >
<option value=-1 ".(is_null($langid)?"selected":"") . ">défaut</option>
function menu_lang($langid=1, $defaut=false){
$ret= "<select id='langid' name='langid' > ";
if($defaut){
$ret=$ret . "<option value=-1 ".(is_null($langid)?"selected":"") . ">défaut</option>";
}
$ret=$ret . "
<option value=11 ".($langid==11?"selected":"") . ">Bash</option>
<option value=9 ".($langid==9?"selected":"") . ">C</option>
<option value=8 ".($langid==8?"selected":"") . ">C++</option>
......@@ -18,6 +22,8 @@ function menu_lang($langid=1){
<option value=2 ".($langid==2?"selected":"") . ">Ruby</option>
</select>
";
return $ret;
}
session_start();
......
......@@ -162,7 +162,7 @@ Description<br>
<table>
<tr>
<td>
Langage<br>".menu_lang($question->lang)."
Langage<br>".menu_lang($question->lang, true)."
</td>
</tr>
......
......@@ -66,7 +66,7 @@ echo"
";
echo " <tr>
<td>Langage : ".menu_lang($_POST['langid'])."
<td>Langage : ".menu_lang($_POST['langid'], false)."
</td>
</tr><tr>
<td colspan=2>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment