private function IndexTeams() { $this->SearchIndexer()->DeleteFromIndexByType("team"); require_once 'stoolball/team-manager.class.php'; require_once 'search/team-search-adapter.class.php'; $manager = new TeamManager($this->GetSettings(), $this->GetDataConnection()); $manager->FilterByActive(true); $manager->ReadAll(); $teams = $manager->GetItems(); unset($manager); foreach ($teams as $team) { $adapter = new TeamSearchAdapter($team); $this->SearchIndexer()->Index($adapter->GetSearchableItem()); } $this->SearchIndexer()->CommitChanges(); }
function OnPrePageLoad() { $this->SetOpenGraphType("sports_team"); $this->SetPageTitle($this->team->GetName() . ' stoolball team'); require_once "search/team-search-adapter.class.php"; $adapter = new TeamSearchAdapter($this->team); $this->SetPageDescription($adapter->GetSearchDescription()); $this->SetContentConstraint(StoolballPage::ConstrainColumns()); if (!$this->is_one_time_team) { $this->LoadClientScript("/scripts/lib/chart.min.js"); $this->LoadClientScript("/scripts/chart.js?v=2"); $this->LoadClientScript("team.js", true); ?> <!--[if lte IE 8]><script src="/scripts/lib/excanvas.compiled.js"></script><![endif]--><?php } }