From 11a38476c33a3fe666b5eda033be44d58ac8e37e Mon Sep 17 00:00:00 2001 From: James Date: Mon, 14 Nov 2011 16:05:19 -0500 Subject: [PATCH] SAAS-43: Automatically fill in customer info in the automated feedback system on signup, do not display popup on login - title needs to update with db access since airtime-saas can change title - storing it to session variable is not an option --- airtime_mvc/application/models/Preference.php | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 5c88db72c..c5ed8a891 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -92,31 +92,25 @@ class Application_Model_Preference } public static function GetHeadTitle(){ - /* Caches the title name as a session variable so we dont access - * the database on every page load. */ - $defaultNamespace = new Zend_Session_Namespace('title_name'); - if (isset($defaultNamespace->title)) { - $title = $defaultNamespace->title; - } else { - $title = self::GetValue("station_name"); - $defaultNamespace->title = $title; - } + $title = self::GetValue("station_name"); + $defaultNamespace->title = $title; if (strlen($title) > 0) $title .= " - "; return $title."Airtime"; } - public static function SetHeadTitle($title, $view){ + public static function SetHeadTitle($title, $view=null){ self::SetValue("station_name", $title); - $defaultNamespace = new Zend_Session_Namespace('title_name'); - $defaultNamespace->title = $title; Application_Model_RabbitMq::PushSchedule(); - //set session variable to new station name so that html title is updated. - //should probably do this in a view helper to keep this controller as minimal as possible. - $view->headTitle()->exchangeArray(array()); //clear headTitle ArrayObject - $view->headTitle(self::GetHeadTitle()); + // in case this is called from airtime-saas script + if($view !== null){ + //set session variable to new station name so that html title is updated. + //should probably do this in a view helper to keep this controller as minimal as possible. + $view->headTitle()->exchangeArray(array()); //clear headTitle ArrayObject + $view->headTitle(self::GetHeadTitle()); + } } /**