t("Batch Tag")); } static function get($block_id, $theme) { $block = ""; // Only display on album pages that the user can edit. $item = $theme->item(); if (!$item || !$item->is_album() || !access::can("edit", $item)) { return; } switch ($block_id) { case "batch_tag": // Make a new sidebar block. $block = new Block(); $block->css_id = "g-batch-tag"; $block->title = t("Batch Tag"); $block->content = new View("batchtag_block.html"); // Make a new form to place in the sidebar block. $form = new Forge("batchtag/tagitems", "", "post", array("id" => "g-batch-tag-form")); $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->batch_tag_form = $form; break; } return $block; } }