diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php index 863ae1ecc..510e591f5 100644 --- a/airtime_mvc/application/Bootstrap.php +++ b/airtime_mvc/application/Bootstrap.php @@ -29,6 +29,7 @@ require_once "GoogleAnalytics.php"; require_once "Timezone.php"; require_once "Auth.php"; require_once "interface/OAuth2.php"; +require_once "interface/OAuth2Controller.php"; require_once "TaskManager.php"; require_once "UsabilityHints.php"; require_once "MediaType.php"; @@ -180,6 +181,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap ->appendFile($baseUrl . 'js/libs/jquery-ui-1.8.24.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') ->appendFile($baseUrl . 'js/bootstrap/bootstrap.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') ->appendFile($baseUrl . 'js/libs/underscore-min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') + ->appendFile($baseUrl . 'js/libs/angular.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') // ->appendFile($baseUrl . 'js/libs/jquery.stickyPanel.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') ->appendFile($baseUrl . 'js/qtip/jquery.qtip.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') diff --git a/airtime_mvc/application/common/interface/OAuth2Controller.phtml b/airtime_mvc/application/common/interface/OAuth2Controller.phtml new file mode 100644 index 000000000..58759d01a --- /dev/null +++ b/airtime_mvc/application/common/interface/OAuth2Controller.phtml @@ -0,0 +1,27 @@ +_service = new SoundcloudService(); } + /** + * Send user to SoundCloud to authorize before being redirected + * + * @return void + */ + public function authorizeAction() { + $auth_url = $this->_service->getAuthorizeUrl(); + header('Location: ' . $auth_url); + } + + /** + * Clear the previously saved request token from preferences + * + * @return void + */ + public function deauthorizeAction() { + $function = $this->_SERVICE_TOKEN_ACCESSOR; + Application_Model_Preference::$function(""); + header('Location: ' . $this->_baseUrl . 'preference'); // Redirect back to the preference page + } + + /** + * Called when user successfully completes SoundCloud authorization + * Store the returned request token for future requests + * + * @return void + */ + public function redirectAction() { + $code = $_GET['code']; + $this->_service->requestNewAccessToken($code); + header('Location: ' . $this->_baseUrl . 'preference'); // Redirect back to the preference page + } + /** * Fetch the permalink to a file on SoundCloud and redirect to it. */ diff --git a/airtime_mvc/application/controllers/ThirdPartyController.php b/airtime_mvc/application/controllers/ThirdPartyController.php index 8e1ef869d..7189b8c35 100644 --- a/airtime_mvc/application/controllers/ThirdPartyController.php +++ b/airtime_mvc/application/controllers/ThirdPartyController.php @@ -31,39 +31,6 @@ abstract class ThirdPartyController extends Zend_Controller_Action { $this->_helper->viewRenderer->setNoRender(true); // Don't use (phtml) templates } - /** - * Send user to a third-party service to authorize before being redirected - * - * @return void - */ - public function authorizeAction() { - $auth_url = $this->_service->getAuthorizeUrl(); - header('Location: ' . $auth_url); - } - - /** - * Clear the previously saved request token from the preferences - * - * @return void - */ - public function deauthorizeAction() { - $function = $this->_SERVICE_TOKEN_ACCESSOR; - Application_Model_Preference::$function(""); - header('Location: ' . $this->_baseUrl . 'preference'); // Redirect back to the preference page - } - - /** - * Called when user successfully completes third-party authorization - * Store the returned request token for future requests - * - * @return void - */ - public function redirectAction() { - $code = $_GET['code']; - $this->_service->requestNewAccessToken($code); - header('Location: ' . $this->_baseUrl . 'preference'); // Redirect back to the preference page - } - /** * Upload the file with the given id to a third-party service * diff --git a/airtime_mvc/public/js/airtime/showbuilder/tabs.js b/airtime_mvc/public/js/airtime/showbuilder/tabs.js index 5b1d84691..6734f352d 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/tabs.js +++ b/airtime_mvc/public/js/airtime/showbuilder/tabs.js @@ -14,7 +14,7 @@ var AIRTIME = (function(AIRTIME){ Internal Functions ##################################################### */ - function buildNewTab(json) { + function _buildNewTab(json) { AIRTIME.library.selectNone(); var tabId = $openTabs[json.type + json.id]; @@ -28,13 +28,14 @@ var AIRTIME = (function(AIRTIME){ t = $("#show_builder").append(wrapper).find("#pl-tab-content-" + $tabCount), pane = $(".editor_pane_wrapper:last"), name = json.type == "md" ? // file - pane.append(json.html).find("#track_title").val() + $.i18n._(" - Metadata Editor") - : pane.append(json.html).find(".playlist_name_display").val(), + pane.append(json.html).find("#track_title").val() + $.i18n._(" - Metadata Editor") + : pane.append(json.html).find(".playlist_name_display").val(), tab = "