static function context_menu($menu, $theme, $item, $thumb_css_selector)
 {
     if (star::can_be_starred($item) && star::can_star($item)) {
         $csrf = access::csrf_token();
         $link = self::_get_star_link_data($item);
         $menu->get("options_menu")->append(Menu::factory("ajax_link")->label($link["text"])->ajax_handler("function(data) { window.location.reload() }")->url(url::site("display/" . $link["action"] . "/{$item->id}?csrf={$csrf}")));
     }
 }
Example #2
0
 /**
  * Checks whether the given object can be starred by the active user.
  *
  * @param Item_Model $item  the item
  */
 private function _check_star_permissions(Item_Model $item)
 {
     access::verify_csrf();
     access::required("view", $item);
     access::required("edit", $item);
     if (!star::can_star()) {
         access::forbidden();
     }
 }