From 3992dad4861c3a1296be7e0e7d4c7a46d621c1cc Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 27 Nov 2008 06:25:21 +0000 Subject: Move form generation off into tag::get_add_form(). We can't use a controller to generate the form (it's incompatible with our REST model where controllers print stuff) --- modules/tag/controllers/tags.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'modules/tag/controllers') diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php index 1bf515b6..e2ab8f87 100644 --- a/modules/tag/controllers/tags.php +++ b/modules/tag/controllers/tags.php @@ -48,12 +48,7 @@ class Tags_Controller extends REST_Controller { } public function _form_add($item_id) { - $form = new Forge(url::site("tags"), "", "post", array("id" => "gAddTag")); - $form->input("tag_name"); - $form->hidden("item_id")->value($item_id); - $form->submit(_("Add")); - $form->add_rules_from(ORM::factory("tag")); - return $form; + return tag::get_add_form($item_id); } public function _form_edit($tag) { @@ -62,7 +57,7 @@ class Tags_Controller extends REST_Controller { public function _create($tag) { // @todo: check permissions - $form = self::form_add($this->input->post('item_id')); + $form = tag::get_add_form($this->input->post('item_id')); if ($form->validate()) { $item = ORM::factory("item", $this->input->post("item_id")); if ($item->loaded) { -- cgit v1.2.3