diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2008-11-27 06:25:21 +0000 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2008-11-27 06:25:21 +0000 |
| commit | 3992dad4861c3a1296be7e0e7d4c7a46d621c1cc (patch) | |
| tree | d67dbf4933c5b87ce2da653fecf658fef9277815 /modules/tag/controllers | |
| parent | 09b27ecf9871db0bfeb7043cf8e667b66e56185a (diff) | |
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)
Diffstat (limited to 'modules/tag/controllers')
| -rw-r--r-- | modules/tag/controllers/tags.php | 9 |
1 files changed, 2 insertions, 7 deletions
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) { |
