public function __construct($view, $title_page)
 {
     parent::__construct($view);
     $lang = LangLoader::get('common', 'calendar');
     $this->set_title($lang['module_title']);
     $this->add_link(LangLoader::get_message('categories.management', 'categories-common'), CalendarUrlBuilder::manage_categories());
     $this->add_link(LangLoader::get_message('category.add', 'categories-common'), CalendarUrlBuilder::add_category());
     $this->add_link($lang['calendar.config.events.management'], CalendarUrlBuilder::manage_events());
     $this->add_link($lang['calendar.titles.add_event'], CalendarUrlBuilder::add_event());
     $this->add_link(LangLoader::get_message('configuration', 'admin-common'), CalendarUrlBuilder::configuration());
     $env = $this->get_graphical_environment();
     $env->set_page_title($title_page, $lang['module_title']);
 }
 public function get_actions_tree_links()
 {
     $request = AppContext::get_request();
     $year = $request->get_getint('year', date('Y'));
     $month = $request->get_getint('month', date('n'));
     $day = $request->get_getint('day', date('j'));
     $lang = LangLoader::get('common', 'calendar');
     $tree = new ModuleTreeLinks();
     $manage_categories_link = new AdminModuleLink(LangLoader::get_message('categories.manage', 'categories-common'), CalendarUrlBuilder::manage_categories());
     $manage_categories_link->add_sub_link(new AdminModuleLink(LangLoader::get_message('categories.manage', 'categories-common'), CalendarUrlBuilder::manage_categories()));
     $manage_categories_link->add_sub_link(new AdminModuleLink(LangLoader::get_message('category.add', 'categories-common'), CalendarUrlBuilder::add_category()));
     $tree->add_link($manage_categories_link);
     $manage_events_link = new AdminModuleLink($lang['calendar.manage'], CalendarUrlBuilder::manage_events());
     $manage_events_link->add_sub_link(new AdminModuleLink($lang['calendar.manage'], CalendarUrlBuilder::manage_events()));
     $manage_events_link->add_sub_link(new AdminModuleLink($lang['calendar.titles.add_event'], CalendarUrlBuilder::add_event($year, $month, $day)));
     $tree->add_link($manage_events_link);
     $tree->add_link(new AdminModuleLink(LangLoader::get_message('configuration', 'admin-common'), CalendarUrlBuilder::configuration()));
     if (!AppContext::get_current_user()->check_level(User::ADMIN_LEVEL)) {
         $tree->add_link(new ModuleLink($lang['calendar.titles.add_event'], CalendarUrlBuilder::add_event($year, $month, $day), CalendarAuthorizationsService::check_authorizations()->write() || CalendarAuthorizationsService::check_authorizations()->contribution()));
     }
     $tree->add_link(new ModuleLink($lang['calendar.events_list'], CalendarUrlBuilder::events_list($year, $month, $day), CalendarAuthorizationsService::check_authorizations()->read()));
     $tree->add_link(new ModuleLink($lang['calendar.pending'], CalendarUrlBuilder::display_pending_events(), CalendarAuthorizationsService::check_authorizations()->write() || CalendarAuthorizationsService::check_authorizations()->contribution() || CalendarAuthorizationsService::check_authorizations()->moderation()));
     return $tree;
 }
 protected function get_categories_management_url()
 {
     return CalendarUrlBuilder::manage_categories();
 }