summaryrefslogtreecommitdiff
path: root/utils/modules
diff options
context:
space:
mode:
authordeva <deva>2009-04-23 18:39:15 +0000
committerdeva <deva>2009-04-23 18:39:15 +0000
commit9854238d0d44ea269d97509d6d35f49d3b46e834 (patch)
treec0b71348b8b67e3bcec4e47649dd56b0707b04d4 /utils/modules
parent9ecc7372ae70b397f5546adb60b0e4542a6bbb78 (diff)
Crafted very ugly but slightly usable menu editor.
Diffstat (limited to 'utils/modules')
-rw-r--r--utils/modules/config.php24
-rw-r--r--utils/modules/pages.php2
2 files changed, 14 insertions, 12 deletions
diff --git a/utils/modules/config.php b/utils/modules/config.php
index a7068ef..4afb264 100644
--- a/utils/modules/config.php
+++ b/utils/modules/config.php
@@ -35,22 +35,24 @@ class Config {
{
switch($action) {
case "update":
- $this->setValue("menu", array("news" => "News",
- "shop" => "Shop",
- "downloads" => "Downloads",
- "biography" => "Biography",
- "live" => "Concerts",
- "discography" => "Discography",
- "guestbook" => "Guestbook",
- "members" => "Members",
- "gallery" => "Gallery",
- "contact" => "Contact"));
+ global $menulist;
+ $menu = ListEditor::splitValues($menulist);
+ $this->setValue("menu", $menu);
$this->write();
break;
default:
+ global $config;
+ global $pages;
+ $pagetitles = array();
+ foreach($pages->pages as $page) {
+ $pagetitles[$page->title] = $page->title;
+ }
$form = new Form("update");
- echo "Coming soon!";
+ $form->addWidget(new ListEditor("Menu items", "menulist",
+ new LineEdit("Title", "title"),
+ new ComboBox("Page", "page", "", $pagetitles),
+ $config->value("menu")));
$form->addWidget(new Button("Update"));
$form->render();
break;
diff --git a/utils/modules/pages.php b/utils/modules/pages.php
index a3979d3..d69b9e9 100644
--- a/utils/modules/pages.php
+++ b/utils/modules/pages.php
@@ -53,7 +53,7 @@ class Page {
class Pages {
private $file;
- private $pages = array();
+ public $pages = array();
// Admin config
public $admin_title = "Pages";