2002-12-19 05:11:25 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Functions to display and edit project-specific prefs go here
|
|
|
|
|
|
|
|
// The code here is a sample. Projects must supply their own.
|
|
|
|
|
|
|
|
function option($name, $val) {
|
|
|
|
if ($name == $val) {
|
|
|
|
$x = "selected";
|
|
|
|
} else {
|
|
|
|
$x = "";
|
|
|
|
}
|
2003-03-03 19:13:16 +00:00
|
|
|
return "<option name='$name' $x>$name\n";
|
2002-12-19 05:11:25 +00:00
|
|
|
}
|
|
|
|
|
2003-02-24 21:25:16 +00:00
|
|
|
function project_specific_prefs_default() {
|
|
|
|
return "<color_scheme>Tahiti Sunset</color_scheme>\n";
|
|
|
|
}
|
|
|
|
|
2002-12-19 05:11:25 +00:00
|
|
|
// given struct, show form for editing
|
|
|
|
//
|
|
|
|
function project_specific_prefs_edit($prefs) {
|
|
|
|
$x = $prefs->color_scheme;
|
2003-03-03 19:13:16 +00:00
|
|
|
$y = "<select name=color_scheme>
|
|
|
|
".option("Tahiti Sunset", $x)
|
|
|
|
.option("Desert Sands", $x)."
|
|
|
|
</select>
|
|
|
|
";
|
|
|
|
row2("Color scheme", $y);
|
2002-12-19 05:11:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Return XML version of project-specific prefs
|
|
|
|
//
|
|
|
|
function project_specific_prefs_parse_form() {
|
2003-02-27 22:30:31 +00:00
|
|
|
$color_scheme = $_GET["color_scheme"];
|
2003-03-05 06:21:24 +00:00
|
|
|
return "<color_scheme>$color_scheme</color_scheme>\n";
|
2002-12-19 05:11:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// show non-editable version of prefs
|
|
|
|
//
|
|
|
|
function project_specific_prefs_show($prefs) {
|
2003-02-18 23:07:48 +00:00
|
|
|
if ($prefs->color_scheme) {
|
2003-03-03 19:13:16 +00:00
|
|
|
$x = $prefs->color_scheme;
|
2003-02-18 23:07:48 +00:00
|
|
|
} else {
|
2003-03-03 19:13:16 +00:00
|
|
|
$x = "None selected";
|
2003-02-18 23:07:48 +00:00
|
|
|
}
|
2003-03-03 19:13:16 +00:00
|
|
|
row2("Color scheme", $x);
|
2002-12-19 05:11:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// parse XML, fill in struct
|
|
|
|
//
|
2003-02-07 09:00:35 +00:00
|
|
|
function project_specific_prefs_parse($prefs_xml) {
|
|
|
|
$prefs->color_scheme = parse_element($prefs_xml, "<color_scheme>");
|
2002-12-19 05:11:25 +00:00
|
|
|
return $prefs;
|
|
|
|
}
|