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
This commit is contained in:
James 2011-11-14 16:05:19 -05:00
parent becaf7a152
commit 11a38476c3
1 changed files with 10 additions and 16 deletions

View File

@ -92,32 +92,26 @@ class Application_Model_Preference
} }
public static function GetHeadTitle(){ 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"); $title = self::GetValue("station_name");
$defaultNamespace->title = $title; $defaultNamespace->title = $title;
}
if (strlen($title) > 0) if (strlen($title) > 0)
$title .= " - "; $title .= " - ";
return $title."Airtime"; return $title."Airtime";
} }
public static function SetHeadTitle($title, $view){ public static function SetHeadTitle($title, $view=null){
self::SetValue("station_name", $title); self::SetValue("station_name", $title);
$defaultNamespace = new Zend_Session_Namespace('title_name');
$defaultNamespace->title = $title;
Application_Model_RabbitMq::PushSchedule(); Application_Model_RabbitMq::PushSchedule();
// 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. //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. //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()->exchangeArray(array()); //clear headTitle ArrayObject
$view->headTitle(self::GetHeadTitle()); $view->headTitle(self::GetHeadTitle());
} }
}
/** /**
* Set the furthest date that a never-ending show * Set the furthest date that a never-ending show