Location: PHPKode > projects > chillyCMS > chillyCMS/modules/menu/backend.php
<?php
defined('DOIT') or die('Restricted access');

//settings are passed to this file in the variable $modsettings formatted as a string
//in the menu module, the settings contain the id of the menu to display

$editform .= "<p>$mod_menu[lbl_settings]</p><br><br>";
//read settings from database
$modsettings=explode(",",$modsettings);
if (isset($modsettings[0])) { $whichmenu = $modsettings[0]; } else { $whichmenu = false; }
if (isset($modsettings[1])) { $displayname = $modsettings[1]; } else { $displayname = false; }
if (isset($modsettings[2])) { $showsubitems = $modsettings[2]; } else { $showsubitems = false; }
if (isset($modsettings[3])) { $extensible = $modsettings[3]; } else { $extensible = false; }

//read all possible menus from database
$page->query("select id,name from site_content where depth=0 and parentid=0");
$result = $page->db->getdata_array();

//choose menu to display
$editform .= "<p>$mod_menu[lbl_whichmenu]</p>
<select name='whichmenu' size='1'>";
foreach ($result as $row) {
	if ($row["id"]==$whichmenu) {
		$editform .= "<option value='$row[id]' selected='selected'>$row[name]</option>";
	} else {
		$editform .= "<option value='$row[id]'>$row[name]</option>";
	}
}
$editform .= "</select><br /><br />".
//display menu name?
"<p>$mod_menu[lbl_displayname]</p><select size='1' name='displayname'>";
if ($displayname==1) {
	$editform .= "<option value='1' selected='selected'>$l_gen[lbl_yes]</option>".
	"<option value='0'>$l_gen[lbl_no]</option>";
} else {
	$editform .= "<option value='1'>$l_gen[lbl_yes]</option>".
	"<option value='0' selected='selected'>$l_gen[lbl_no]</option>";
}
$editform .= "</select><br /><br />".
//show subitems?
"<p>$mod_menu[lbl_showsubitems]</p><select size='1' name='showsubitems'>";
if ($showsubitems==1) {
	$editform .= "<option value='1' selected='selected'>$l_gen[lbl_yes]</option>".
	"<option value='0'>$l_gen[lbl_no]</option>";
} else {
	$editform .= "<option value='1'>$l_gen[lbl_yes]</option>".
	"<option value='0' selected='selected'>$l_gen[lbl_no]</option>";
}
$editform .= "</select><br /><br />".
//make extensible?
"<p>$mod_menu[lbl_extensible]</p><select size='1' name='extensible'>";
if ($extensible==1) {
	$editform .= "<option value='1' selected='selected'>$l_gen[lbl_yes]</option>".
	"<option value='0'>$l_gen[lbl_no]</option>";
} else {
	$editform .= "<option value='1'>$l_gen[lbl_yes]</option>".
	"<option value='0' selected='selected'>$l_gen[lbl_no]</option>";
}
$editform .= "</select><br /><br />";

//since the data is to be saved in an array, the order is important!
$specialsettings = "whichmenu,displayname,showsubitems,extensible";
?>
Return current item: chillyCMS