/**
  * Executes the actions to display the Home Page
  */
 public function executeHome()
 {
     $timer = new sfTimer('executeHome');
     $mobile_version = c2cTools::mobileVersion();
     // user filters:
     $perso = c2cPersonalization::getInstance();
     if ($perso->isMainFilterSwitchOn()) {
         $langs = $perso->getLanguagesFilter();
         $ranges = $perso->getPlacesFilter();
         $activities = $perso->getActivitiesFilter();
     } else {
         $langs = $ranges = $activities = array();
     }
     // some of the latest documents published on the site
     $latest_outings = Outing::listLatest($mobile_version ? sfConfig::get('app_recent_documents_outings_mobile_limit') : sfConfig::get('app_recent_documents_outings_limit'), $langs, $ranges, $activities);
     // choose best language for outings and regions names
     $latest_outings = Language::getTheBest($latest_outings, 'Outing');
     $this->latest_outings = Language::getTheBestForAssociatedAreas($latest_outings);
     $this->latest_articles = Article::listLatest($mobile_version ? sfConfig::get('app_recent_documents_articles_mobile_limit') : sfConfig::get('app_recent_documents_articles_limit'), $langs, $activities);
     $latest_images = Image::listLatest($mobile_version ? sfConfig::get('app_recent_documents_images_mobile_limit') : sfConfig::get('app_recent_documents_images_limit'), $langs, $ranges, $activities);
     $this->latest_images = Language::getTheBest($latest_images, 'Image');
     // outings from metaengine:
     $region_ids = c2cTools::convertC2cRangeIdsToMetaIds($ranges);
     $activity_ids = c2cTools::convertC2cActivityIdsToMetaIds($activities);
     $this->meta_feed_url = str_replace('http:', '', sfConfig::get('app_meta_engine_base_url')) . 'outings?system_id=2,3,4' . '&orderby=outing_date' . '&outing_lang=' . implode(',', $langs) . '&activity_ids=' . implode(',', $activity_ids) . '&region_id=' . implode(',', $region_ids);
     // forum 'mountain news' latest active threads
     $news_filter_ids = PunbbTopics::getForumIds('app_forum_mountain_news', $langs, $activities);
     $this->latest_mountain_news = PunbbTopics::listLatestById($mobile_version ? sfConfig::get('app_recent_documents_mountain_news_mobile_limit') : sfConfig::get('app_recent_documents_mountain_news_limit'), $news_filter_ids);
     $this->news_filter_ids = implode('-', $news_filter_ids);
     // forum latest active threads
     $forum_filter_ids = PunbbTopics::getForumIds('app_forum_public_ids', $langs, $activities);
     $this->latest_threads = PunbbTopics::listLatestById($mobile_version ? sfConfig::get('app_recent_documents_threads_mobile_limit') : sfConfig::get('app_recent_documents_threads_limit'), $forum_filter_ids);
     $this->forum_filter_ids = implode('-', array_merge($news_filter_ids, $forum_filter_ids));
     // Custom welcome message:
     $prefered_langs = $this->getUser()->getCulturesForDocuments();
     $this->message = Message::find($prefered_langs[0]);
     if (!$mobile_version) {
         // c2c news
         $this->latest_c2c_news = PunbbTopics::listLatestC2cNews(sfConfig::get('app_recent_documents_c2c_news_limit'), $langs);
         $this->figures = sfConfig::get('app_figures_list');
     }
     // mobile version
     $this->getResponse()->addMeta('robots', 'index, follow');
     c2cActions::statsdTiming('document.executeHome', $timer->getElapsedTime('executeHome'));
 }