diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2008-12-13 07:49:27 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2008-12-13 07:49:27 +0000 |
commit | fc3fd3321df5e116975bc6c447768f7d8180b87e (patch) | |
tree | cf7385c8cb4524984da940c104e14326d5620534 /modules/tag/helpers | |
parent | 80792d4fb156e8c9a06760361bbb66b5a7c1db59 (diff) |
Add a permissions check to determine if the active user has edit permission on the item in order to display the tag add form
Diffstat (limited to 'modules/tag/helpers')
-rw-r--r-- | modules/tag/helpers/tag.php | 2 | ||||
-rw-r--r-- | modules/tag/helpers/tag_block.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php index 595f4b08..104d4a30 100644 --- a/modules/tag/helpers/tag.php +++ b/modules/tag/helpers/tag.php @@ -81,7 +81,7 @@ class tag_Core { public static function get_add_form($item_id) { $form = new Forge(url::site("tags"), "", "post", array("id" => "gAddTagForm")); - $group = $form->group(_("Add Tag")); + $group = $form->group("add_tag")->label(_("Add Tag")); $group->input("tag_name"); $group->hidden("item_id")->value($item_id); $group->submit(_("Add")); diff --git a/modules/tag/helpers/tag_block.php b/modules/tag/helpers/tag_block.php index 686f7876..37f7f21e 100644 --- a/modules/tag/helpers/tag_block.php +++ b/modules/tag/helpers/tag_block.php @@ -30,7 +30,7 @@ class tag_block_Core { $block->content = new View("tag_block.html"); $block->content->cloud = tag::cloud(30); - if ($theme->page_type() != "tag") { + if ($theme->page_type() != "tag" && access::can("edit", $theme->item())) { $controller = new Tags_Controller(); $block->content->form = tag::get_add_form($theme->item()); } else { |