SAAS-673: Warn if public api is not enabled under Preferences

This commit is contained in:
drigato 2015-04-02 16:54:57 -04:00
parent e8c8fde8bd
commit faee0fba98
1 changed files with 7 additions and 2 deletions

View File

@ -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:<br><br>
1. Enable at least one MP3, AAC, or OGG stream under System -> Streams<br>
2. Enable the Public Airtime API under System -> Preferences";
}
}