Added an option for tagging items in sub albums.
This commit is contained in:
parent
10231b5718
commit
5052bfd97a
@ -24,11 +24,23 @@ class BatchTag_Controller extends Controller {
|
||||
// Prevent Cross Site Request Forgery
|
||||
access::verify_csrf();
|
||||
|
||||
// Figure out if the contents of sub-albums should also be tagged
|
||||
$str_tag_subitems = Input::instance()->post("tag_subitems");
|
||||
|
||||
$children = "";
|
||||
if ($str_tag_subitems == false) {
|
||||
// Generate an array of all non-album items in the current album.
|
||||
$children = ORM::factory("item")
|
||||
->where("parent_id", $this->input->post("item_id"))
|
||||
->where("type !=", "album")
|
||||
->find_all();
|
||||
} else {
|
||||
// Generate an array of all non-album items in the current album
|
||||
// and any sub albums.
|
||||
$children = ORM::factory("item", $this->input->post("item_id"))
|
||||
->where("type !=", "album")
|
||||
->descendants();
|
||||
}
|
||||
|
||||
// Loop through each item in the album and make sure the user has
|
||||
// access to view and edit it.
|
||||
|
@ -43,6 +43,11 @@ class batchtag_theme_Core {
|
||||
$label = t("Tag everything in this album:");
|
||||
$group = $form->group("add_tag")->label("Add Tag");
|
||||
$group->input("name")->label($label)->rules("required|length[1,64]");
|
||||
$group->checkbox("tag_subitems")
|
||||
->label(t("Include sub-albums?"))
|
||||
->value(true)
|
||||
->checked(false);
|
||||
|
||||
$group->hidden("item_id")->value($item->id);
|
||||
$group->submit("")->value(t("Add Tag"));
|
||||
$block->content->form = $form;
|
||||
|
Reference in New Issue
Block a user