From faee0fba98123587b5ae9646cca4b93ef902c1c9 Mon Sep 17 00:00:00 2001 From: drigato Date: Thu, 2 Apr 2015 16:54:57 -0400 Subject: [PATCH] SAAS-673: Warn if public api is not enabled under Preferences --- .../controllers/EmbeddableplayerController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/controllers/EmbeddableplayerController.php b/airtime_mvc/application/controllers/EmbeddableplayerController.php index 6a00df36b..3552ee47e 100644 --- a/airtime_mvc/application/controllers/EmbeddableplayerController.php +++ b/airtime_mvc/application/controllers/EmbeddableplayerController.php @@ -17,10 +17,15 @@ class EmbeddablePlayerController extends Zend_Controller_Action $form = new Application_Form_EmbeddablePlayer(); - if ($form->getElement('player_stream_url')->getAttrib('numberOfEnabledStreams') > 0) { + $apiEnabled = Application_Model_Preference::GetAllow3rdPartyApi(); + $numEnabledStreams = $form->getElement('player_stream_url')->getAttrib('numberOfEnabledStreams'); + + if ($numEnabledStreams > 0 && $apiEnabled) { $this->view->form = $form; } else { - $this->view->errorMsg = "You need to enable at least one MP3, AAC, or OGG stream to use this feature."; + $this->view->errorMsg = "To configure and use the embeddable player you must:

+ 1. Enable at least one MP3, AAC, or OGG stream under System -> Streams
+ 2. Enable the Public Airtime API under System -> Preferences"; } }