SAAS-57: Add LiveChat to Airtime Pro
Adding code to non-saas side
This commit is contained in:
parent
af3b75bab4
commit
201667936c
|
@ -77,6 +77,10 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||||
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/versiontooltip.js','text/javascript');
|
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/versiontooltip.js','text/javascript');
|
||||||
|
|
||||||
$view->headScript()->appendFile($baseUrl.'/js/airtime/common/common.js','text/javascript');
|
$view->headScript()->appendFile($baseUrl.'/js/airtime/common/common.js','text/javascript');
|
||||||
|
|
||||||
|
if (Application_Model_Preference::GetPlanLevel() != "disabled") {
|
||||||
|
$view->headScript()->appendFile($baseUrl.'/js/airtime/common/livechat.js','text/javascript');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function _initViewHelpers()
|
protected function _initViewHelpers()
|
||||||
|
|
|
@ -26,6 +26,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
->addActionContext('update-liquidsoap-error', 'json')
|
->addActionContext('update-liquidsoap-error', 'json')
|
||||||
->addActionContext('update-liquidsoap-connection', 'json')
|
->addActionContext('update-liquidsoap-connection', 'json')
|
||||||
->addActionContext('library-init', 'json')
|
->addActionContext('library-init', 'json')
|
||||||
|
->addActionContext('live-chat', 'json')
|
||||||
->initContext();
|
->initContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -756,6 +757,24 @@ class ApiController extends Zend_Controller_Action
|
||||||
|
|
||||||
$this->view->status = $status;
|
$this->view->status = $status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the client id assigned by WHMCS from database
|
||||||
|
*/
|
||||||
|
public function liveChatAction() {
|
||||||
|
$this->view->layout()->disableLayout();
|
||||||
|
$this->_helper->viewRenderer->setNoRender(true);
|
||||||
|
|
||||||
|
if(is_null(Zend_Auth::getInstance()->getStorage()->read())) {
|
||||||
|
header('HTTP/1.0 401 Unauthorized');
|
||||||
|
print 'You are not allowed to access this resource.';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->view->liveChat = array(
|
||||||
|
"client_id"=>Application_Model_Preference::GetClientId()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function registerComponentAction(){
|
public function registerComponentAction(){
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
|
|
Loading…
Reference in New Issue