/** * @desc Adds to the site map all the kernel links. * @param int $mode USER_MODE ou SEARCH_ENGINE_MODE, it depends on if you want to show it to a user in particular or to anybody * @param int $auth_mode AUTH_GUEST or AUTH_USERS, it depends if you want to display only the public pages or also the private ones. */ private function build_kernel_map($mode = self::USER_MODE, $auth_mode = self::AUTH_PUBLIC) { global $LANG; //We consider the kernel as a module $kernel_map = new ModuleMap(new SitemapLink($LANG['home'], new Url(Environment::get_home_page()))); //The site description $kernel_map->set_description(nl2br(GeneralConfig::load()->get_site_description())); //All the links which not need to be present in the search engine results. if ($mode == self::USER_MODE) { if (AppContext::get_current_user()->check_auth(UserAccountsConfig::load()->get_auth_read_members(), UserAccountsConfig::AUTH_READ_MEMBERS_BIT)) { $kernel_map->add(new SitemapLink(LangLoader::get_message('members-list', 'user-common'), UserUrlBuilder::home())); } //Member space if ($auth_mode == self::AUTH_USER && AppContext::get_current_user()->check_level(User::MEMBER_LEVEL)) { //We create a section for that $member_space_section = new SitemapSection(new SitemapLink($LANG['my_private_profile'], UserUrlBuilder::profile(AppContext::get_current_user()->get_id()))); //Profile edition $member_space_section->add(new SitemapLink(LangLoader::get_message('profile.edit', 'user-common'), UserUrlBuilder::edit_profile(AppContext::get_current_user()->get_id()))); //Private messaging $member_space_section->add(new SitemapLink($LANG['private_messaging'], UserUrlBuilder::personnal_message(AppContext::get_current_user()->get_id()))); //Contribution panel $member_space_section->add(new SitemapLink($LANG['contribution_panel'], UserUrlBuilder::contribution_panel())); //Administration panel if (AppContext::get_current_user()->check_level(User::ADMIN_LEVEL)) { $member_space_section->add(new SitemapLink($LANG['admin_panel'], UserUrlBuilder::administration())); } //We add it to the kernel map $kernel_map->add($member_space_section); } } //The kernel map is added to the site map $this->add($kernel_map); }