<?php # Copyright(C) 2004-2007 INL # Written by Eric Leblond <regit@inl.fr> # Vincent Deffontaines <gryzor@inl.fr> # Jean Gillaux <jean@inl.fr> # Damien Boucard <damien.boucard AT inl.fr> # # $Id: menu.php 17927 2009-02-16 13:16:09Z haypo $ # # 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, version 3 of the License. # # 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, see <http://www.gnu.org/licenses/>. require_once ("file_function.php"); require_once ("html.php"); function select_rulesets($files, $name, $selected=null) { $data = Array(); foreach($files as $filename) { $data[$filename] = filenameWithoutXml($filename); } select_array($name, $data, $selected); } function display_openfile_menu($files=null) { global $network_desc_file; if (is_null($files)) $files=file_list(); print "<form action=\"index.php\" method=POST>\n"; print "<table class=form> <tr><td>"; select_rulesets($files, 'input_file'); print "</td><td class='submit'>"; print "<input type=\"submit\" value=\""._('Load')."\" class=\"button\"> "; print "</td></tr>"; print "</table>"; print "</form>"; } function menuJS($elt) { if ($elt) { $js = "elt = \"$elt\";"; } else { $js = "elt = \"\";"; } $js .= " initiate(elt);"; html_javascript($js, true); } ?>