_auth) { $this->_auth = App_User_Auth::getInstance(); } return $this->_auth; } public function getAuthAdapter() { if (null === $this->_authAdapter) { $this->_authAdapter = new App_User_AuthAdapter(); } return $this->_authAdapter; } protected function _beforeDisplay() { $this->_trackUser(); return parent::_beforeDisplay(); } protected function _trackUser() { // todo: check if we need custom events on samnllc return $this; if (!$this->hasAuth() || !($auth = $this->getAuth()) || !$auth->isLoggedIn() || !($data = $auth->getData())) { return $this; } if (defined('SITE_LIVE') && SITE_LIVE) { $_page = addslashes($this->getTitle()); $_user = addslashes($data['name']); $_school = addslashes(App_School_Obj::getById($data['idSchool'], 'name')); $this->addInitFunction("(function (){ window._gaq && _gaq.push(['_trackEvent', 'Page: {$_page}', 'View', '{$_school} - {$_user}']); })"); } return $this; } }