Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Yuchen Wang 2011-11-14 17:53:37 -05:00
commit 709582b47d
9 changed files with 65 additions and 27 deletions

View file

@ -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());
}
}
/**

View file

@ -448,14 +448,24 @@ class Application_Model_StoredFile {
/**
* Get the URL to access this file using the server name/address that
* is specified in the airtime.conf config file.
* is specified in the airtime.conf config file. If either of these is
* not specified, then use values provided by the $_SERVER global variable.
*/
public function getFileUrlUsingConfigAddress(){
global $CC_CONFIG;
$serverName = $CC_CONFIG['baseUrl'];
$serverPort = $CC_CONFIG['basePort'];
if (isset($CC_CONFIG['baseUrl'])){
$serverName = $CC_CONFIG['baseUrl'];
} else {
$serverName = $_SERVER['SERVER_NAME'];
}
if (isset($CC_CONFIG['basePort'])){
$serverPort = $CC_CONFIG['basePort'];
} else {
$serverPort = $_SERVER['SERVER_PORT'];
}
return $this->constructGetFileUrl($serverName, $serverPort);
}