Merge branch '2.5.x-saas' into cc-5709-airtime-analyzer-saas

This commit is contained in:
Albert Santoni 2014-05-05 12:42:42 -04:00
commit f89c66922b
2 changed files with 23 additions and 3 deletions

View File

@ -139,9 +139,11 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
&& strpos($_SERVER['REQUEST_URI'], $baseUrl.'audiopreview/audio-preview') === false
&& strpos($_SERVER['REQUEST_URI'], $baseUrl.'audiopreview/playlist-preview') === false
&& strpos($_SERVER['REQUEST_URI'], $baseUrl.'audiopreview/block-preview') === false) {
$client_id = Application_Model_Preference::GetClientId();
$view->headScript()->appendScript("var livechat_client_id = '$client_id';");
$view->headScript()->appendFile($baseUrl . 'js/airtime/common/livechat.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
if (Application_Model_Preference::GetLiveChatEnabled()) {
$client_id = Application_Model_Preference::GetClientId();
$view->headScript()->appendScript("var livechat_client_id = '$client_id';");
$view->headScript()->appendFile($baseUrl . 'js/airtime/common/livechat.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
}
}
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) {

View File

@ -1013,6 +1013,24 @@ class Application_Model_Preference
Logging::warn("Attempting to set client_id to invalid value: $id");
}
}
public static function GetLiveChatEnabled()
{
$liveChat = self::getValue("live_chat", false);
if (is_null($liveChat) || $liveChat == "" || $liveChat == "1") { //Defaults to on
return true;
}
return false;
}
public static function SetLiveChatEnabled($toggle)
{
if (is_bool($toggle)) {
self::setValue("live_chat", $toggle ? "1" : "0");
} else {
Logging::warn("Attempting to set live_chat to invalid value: $toggle. Must be a bool.");
}
}
/* User specific preferences start */