/**
 * Return array of options $logged_user can do to $user account
 *
 * @param User $user
 * @param NamedList $options
 * @param User $logged_user
 * @return null
 */
function calendar_handle_on_user_options(&$user, &$options, &$logged_user)
{
    if (can_access_profile_calendar($logged_user, $user)) {
        $options->add('calendar', array('text' => lang('Schedule'), 'icon' => get_image_url('gray-calendar.gif'), 'url' => Calendar::getProfileCalendarUrl($user)));
    }
    // if
}
 /**
  * Constructor
  *
  * @param Request $request
  * @return UsersCalendarController
  */
 function __construct($request)
 {
     parent::__construct($request);
     if (!can_access_profile_calendar($this->logged_user, $this->active_user)) {
         $this->httpError(HTTP_ERR_FORBIDDEN);
     }
     // if
     if ($this->active_user->isNew()) {
         $this->httpError(HTTP_ERR_NOT_FOUND);
     }
     // if
     $this->wireframe->addBreadCrumb(lang('Calendar'), Calendar::getProfileCalendarUrl($this->active_user));
 }