diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2009-01-04 08:44:06 +0000 | 
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2009-01-04 08:44:06 +0000 | 
| commit | 92ceef27dafbc0e217a8ec7f5e2ee9694d4118a3 (patch) | |
| tree | 24ce7c4aef358651f92b3361fded9d30cbac7434 /modules/tag/helpers | |
| parent | 625d0785572af319b22a523550145b4dacbd6100 (diff) | |
Allow renaming of tags using a modal dialog.  Put up a confirmation
dialog for deleting tags.  Remove the 4 character restriction on tags
(it was getting ignored by the add form anyway since it was mistakenly
referred to as tag_name there).
Diffstat (limited to 'modules/tag/helpers')
| -rw-r--r-- | modules/tag/helpers/tag.php | 19 | 
1 files changed, 18 insertions, 1 deletions
| diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php index b1505b3d..fac2ab70 100644 --- a/modules/tag/helpers/tag.php +++ b/modules/tag/helpers/tag.php @@ -78,10 +78,27 @@ class tag_Core {    public static function get_add_form($item) {      $form = new Forge("tags", "", "post", array("id" => "gAddTagForm"));      $group = $form->group("add_tag")->label(_("Add Tag")); -    $group->input("tag_name")->label(_("Add tag")); +    $group->input("name")->label(_("Add tag"));      $group->hidden("item_id")->value($item->id);      $group->submit(_("Add"));      $form->add_rules_from(ORM::factory("tag"));      return $form;    } + +  public static function get_rename_form($tag) { +    $form = new Forge("admin/tags/rename/$tag->id", "", "post", array("id" => "gRenameTagForm")); +    $group = $form->group("rename_tag")->label(_("Rename Tag")); +    $group->input("name")->label(_("Tag name"))->value($tag->name); +    $group->submit(_("Rename")); +    $form->add_rules_from(ORM::factory("tag")); +    return $form; +  } + +  public static function get_delete_form($tag) { +    $form = new Forge("admin/tags/delete/$tag->id", "", "post", array("id" => "gDeleteTagForm")); +    $group = $form->group("delete_tag")->label(_("Delete Tag")); +    $group->submit(_("Delete")); +    $form->add_rules_from(ORM::factory("tag")); +    return $form; +  }  } | 
