summaryrefslogtreecommitdiff
path: root/utils/modules/pages.php
diff options
context:
space:
mode:
authordeva <deva>2009-04-23 07:41:28 +0000
committerdeva <deva>2009-04-23 07:41:28 +0000
commit3f1dda1e19e1f77e908df1d49d028d0932d0f1a1 (patch)
treed44586018a0594aa53cfbe172d7a576bbe5f593c /utils/modules/pages.php
parent9fc8170f4492c3e5900156610061e59c84aa9d83 (diff)
A completely new forms class, to replace the old function based method. Also some work on a new config module, evenmtuelly to replace the old hardcoded values.
Diffstat (limited to 'utils/modules/pages.php')
-rw-r--r--utils/modules/pages.php37
1 files changed, 19 insertions, 18 deletions
diff --git a/utils/modules/pages.php b/utils/modules/pages.php
index 373db1a..a3979d3 100644
--- a/utils/modules/pages.php
+++ b/utils/modules/pages.php
@@ -76,14 +76,15 @@ class Pages {
echo "</div>\n";
echo "</div>\n";
echo "<p>Looking ok?</p>";
- beginform("add");
- hidden($vars);
- button("yes");
- endform();
- beginform("retry");
- hidden($vars);
- button("no");
- endform();
+ $form = new Form("add");
+ $form->addWidget(new Hidden($vars));
+ $form->addWidget(new Button("yes"));
+ $form->render();
+
+ $form = new Form("retry");
+ $form->addWidget(new Hidden($vars));
+ $form->addWidget(new Button("no"));
+ $form->render();
break;
case "edit":
@@ -93,23 +94,23 @@ class Pages {
echo "<p>See <a rel=\"external\" href=\"http://daringfireball.net/projects/markdown/syntax\">markdown</a> syntax.</p>";
- beginform("preview");
- hidden($vars);
- textedit("Content", "content", $content);
- button("Preview");
- endform();
+ $form = new Form("preview");
+ $form->addWidget(new Hidden($vars));
+ $form->addWidget(new TextEdit("Content", "content", $content));
+ $form->addWidget(new Button("Preview"));
+ $form->render();
break;
case "select":
default:
$pagelist = array();
foreach($this->pages as $p) {
- $pagelist[$p->title] = $p->title;
+ $pagelist[$p->title] = $p->title;
}
- beginform("edit");
- combobox("Edit this entry:", "title", "", $pagelist);
- button("Edit...");
- endform();
+ $form = new Form("edit");
+ $form->addWidget(new ComboBox("Edit this entry:", "title", "", $pagelist));
+ $form->addWidget(new Button("Edit..."));
+ $form->render();
break;
}
}