diff --git a/airtime_mvc/application/controllers/SoundcloudController.php b/airtime_mvc/application/controllers/SoundcloudController.php index e3c31d72c..73ce365db 100644 --- a/airtime_mvc/application/controllers/SoundcloudController.php +++ b/airtime_mvc/application/controllers/SoundcloudController.php @@ -23,6 +23,45 @@ class SoundcloudController extends ThirdPartyController implements OAuth2Control $this->_service = new Application_Service_SoundcloudService(); } + /** + * Upload the file with the given id to a third-party service + * + * @return void + * + * @throws Zend_Controller_Response_Exception thrown if upload fails for any reason + */ + public function uploadAction() { + $request = $this->getRequest(); + $id = $request->getParam('id'); + $this->_service->upload($id); + } + + /** + * Download the file with the given id from a third-party service + * + * @return void + * + * @throws Zend_Controller_Response_Exception thrown if download fails for any reason + */ + public function downloadAction() { + $request = $this->getRequest(); + $id = $request->getParam('id'); + $this->_service->download($id); + } + + /** + * Delete the file with the given id from a third-party service + * + * @return void + * + * @throws Zend_Controller_Response_Exception thrown if deletion fails for any reason + */ + public function deleteAction() { + $request = $this->getRequest(); + $id = $request->getParam('id'); + $this->_service->delete($id); + } + /** * Send user to SoundCloud to authorize before being redirected * diff --git a/airtime_mvc/application/controllers/ThirdPartyController.php b/airtime_mvc/application/controllers/ThirdPartyController.php index 384235038..1794a3251 100644 --- a/airtime_mvc/application/controllers/ThirdPartyController.php +++ b/airtime_mvc/application/controllers/ThirdPartyController.php @@ -24,50 +24,10 @@ abstract class ThirdPartyController extends Zend_Controller_Action { * Disable controller rendering and initialize */ public function init() { - $CC_CONFIG = Config::getConfig(); - $this->_baseUrl = 'http://' . $CC_CONFIG['baseUrl'] . ":" . $CC_CONFIG['basePort'] . "/"; + $this->_baseUrl = Application_Common_HTTPHelper::getStationUrl(); $this->view->layout()->disableLayout(); // Don't inject the standard Now Playing header. $this->_helper->viewRenderer->setNoRender(true); // Don't use (phtml) templates } - /** - * Upload the file with the given id to a third-party service - * - * @return void - * - * @throws Zend_Controller_Response_Exception thrown if upload fails for any reason - */ - public function uploadAction() { - $request = $this->getRequest(); - $id = $request->getParam('id'); - $this->_service->upload($id); - } - - /** - * Download the file with the given id from a third-party service - * - * @return void - * - * @throws Zend_Controller_Response_Exception thrown if download fails for any reason - */ - public function downloadAction() { - $request = $this->getRequest(); - $id = $request->getParam('id'); - $this->_service->download($id); - } - - /** - * Delete the file with the given id from a third-party service - * - * @return void - * - * @throws Zend_Controller_Response_Exception thrown if deletion fails for any reason - */ - public function deleteAction() { - $request = $this->getRequest(); - $id = $request->getParam('id'); - $this->_service->delete($id); - } - } \ No newline at end of file