Advanced setup page
git-svn-id: file:///home/shish/svn/shimmie2/trunk@768 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
73ba66fbc8
commit
129c8f0d69
@ -152,6 +152,10 @@ class Setup extends Extension {
|
|||||||
$page->set_mode("redirect");
|
$page->set_mode("redirect");
|
||||||
$page->set_redirect(make_link("setup"));
|
$page->set_redirect(make_link("setup"));
|
||||||
}
|
}
|
||||||
|
else if($event->get_arg(0) == "advanced") {
|
||||||
|
global $config;
|
||||||
|
$this->theme->display_advanced($event->page, $config->values);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$panel = new SetupPanel();
|
$panel = new SetupPanel();
|
||||||
send_event(new SetupBuildingEvent($panel));
|
send_event(new SetupBuildingEvent($panel));
|
||||||
|
@ -52,10 +52,41 @@ class SetupTheme extends Themelet {
|
|||||||
$page->add_block(new Block("Setup", $table));
|
$page->add_block(new Block("Setup", $table));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function display_advanced($page, $options) {
|
||||||
|
$rows = "";
|
||||||
|
foreach($options as $name => $value) {
|
||||||
|
$h_value = html_escape($value);
|
||||||
|
$len = strlen($h_value);
|
||||||
|
$box = "";
|
||||||
|
if($len < 50) {
|
||||||
|
$box .= "<input type='text' name='_config_$name' value='$h_value'>";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$box .= "<textarea cols='50' rows='4' name='_config_$name'>$h_value</textarea>";
|
||||||
|
}
|
||||||
|
$box .= "<input type='hidden' name='_type_$name' value='string'>";
|
||||||
|
$rows .= "<tr><td>$name</td><td>$box</td></tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$table = "
|
||||||
|
<form action='".make_link("setup/save")."' method='POST'><table>
|
||||||
|
<tr><th width='25%'>Name</th><th>Value</th></tr>
|
||||||
|
$rows
|
||||||
|
<tr><td colspan='2'><input type='submit' value='Save Settings'></td></tr>
|
||||||
|
</table></form>
|
||||||
|
";
|
||||||
|
|
||||||
|
$page->set_title("Shimmie Setup");
|
||||||
|
$page->set_heading("Shimmie Setup");
|
||||||
|
$page->add_block(new Block("Navigation", $this->build_navigation(), "left", 0));
|
||||||
|
$page->add_block(new Block("Setup", $table));
|
||||||
|
}
|
||||||
|
|
||||||
protected function build_navigation() {
|
protected function build_navigation() {
|
||||||
return "
|
return "
|
||||||
<a href='".make_link()."'>Index</a>
|
<a href='".make_link()."'>Index</a>
|
||||||
<br><a href='http://trac.shishnet.org/shimmie2/wiki/Settings'>Help</a>
|
<br><a href='http://trac.shishnet.org/shimmie2/wiki/Settings'>Help</a>
|
||||||
|
<br><a href='".make_link("setup/advanced")."'>Advanced</a>
|
||||||
";
|
";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user