%title item", array("title" => html::purify($item->title))); $this->_check_hide_permissions($item); hide::hide($item); message::success($msg); json::reply(array("result" => "success", "reload" => 1)); } /** * Allows the given item to be displayed again. * * @param int $id the item id */ public function show($id) { $item = model_cache::get("item", $id); $msg = t("Displayed %title item", array("title" => html::purify($item->title))); $this->_check_hide_permissions($item); hide::show($item); message::success($msg); json::reply(array("result" => "success", "reload" => 1)); } /** * Checks whether the given object can be hidden by the active user. * * @param Item_Model $item the item */ private function _check_hide_permissions(Item_Model $item) { access::verify_csrf(); access::required("view", $item); access::required("edit", $item); if (!hide::can_hide()) { access::forbidden(); } } }