private function getGoals($idSite)
{
if ($this->goalsForCurrentSite === null) {
// get all goals to display info for
$allGoals = array();
// add the ecommerce goal if ecommerce is enabled for the site
if (Site::isEcommerceEnabledFor($idSite)) {
$ecommerceGoal = array('idgoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER, 'name' => Piwik::translate('Goals_EcommerceOrder'), 'quoted_name' => false);
$allGoals[$ecommerceGoal['idgoal']] = $ecommerceGoal;
}
// add the site's goals (and escape all goal names)
$siteGoals = APIGoals::getInstance()->getGoals($idSite);
foreach ($siteGoals as &$goal) {
$goal['name'] = Common::sanitizeInputValue($goal['name']);
$goal['quoted_name'] = '"' . $goal['name'] . '"';
$allGoals[$goal['idgoal']] = $goal;
}
$this->goalsForCurrentSite = $allGoals;
}
return $this->goalsForCurrentSite;
}