SAAS-1202 - move station podcast to top-level menu item

This commit is contained in:
Duncan Sommerville 2015-11-13 14:57:32 -05:00
parent 50c0bc2c28
commit 8e867b522c
19 changed files with 271 additions and 200 deletions

View file

@ -37,6 +37,7 @@ $ccAcl->add(new Zend_Acl_Resource('library'))
->add(new Zend_Acl_Resource('rest:show-image'))
->add(new Zend_Acl_Resource('rest:podcast'))
->add(new Zend_Acl_Resource('rest:podcast-episodes'))
->add(new Zend_Acl_Resource('podcast'))
->add(new Zend_Acl_Resource('billing'))
->add(new Zend_Acl_Resource('thank-you'))
->add(new Zend_Acl_Resource('provisioning'))
@ -76,6 +77,7 @@ $ccAcl->allow('G', 'index')
->allow('H', 'rest:media')
->allow('H', 'rest:podcast')
->allow('H', 'rest:podcast-episodes')
->allow('H', 'podcast')
->allow('H', 'preference', 'is-import-in-progress')
->allow('H', 'usersettings')
->allow('H', 'plupload')

View file

@ -8,6 +8,13 @@
* the navigation container below.
*/
$pages = array(
array(
'label' => "<i class='icon-music icon-white'></i>"._('My Podcast'),
'module' => 'default',
'controller' => 'podcast',
'action' => 'station',
'resource' => 'podcast'
),
array(
'label' => "<i class='icon-globe icon-white'></i>"._('Radio Page'),
'uri' => '/',

View file

@ -0,0 +1,35 @@
<?php
class PodcastController extends Zend_Controller_Action {
public function init() {
$CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir();
$headScript = $this->view->headScript();
AirtimeTableView::injectTableJavaScriptDependencies($headScript, $baseUrl, $CC_CONFIG['airtime_version']);
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/library.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/events/library_showbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/widgets/table.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/podcast.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColVis.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/dataTables.colReorder.min.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/station_podcast.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/dashboard.css?'.$CC_CONFIG['airtime_version']);
}
/**
* Renders the Station podcast view
*/
public function stationAction() {
$stationPodcastId = Application_Model_Preference::getStationPodcastId();
$podcast = Application_Service_PodcastService::getPodcastById($stationPodcastId);
$this->view->podcast = json_encode($podcast);
$this->view->form = new Application_Form_StationPodcast();
}
}

View file

@ -3,28 +3,26 @@
class Application_Form_PodcastPreferences extends Zend_Form_SubForm {
public function init() {
$this->setDecorators(array(
array('ViewScript', array('viewScript' => 'form/preferences_podcast.phtml'))
));
$isPrivate = Application_Model_Preference::getStationPodcastPrivacy();
$stationPodcastPrivacy = new Zend_Form_Element_Radio('stationPodcastPrivacy');
$stationPodcastPrivacy->setLabel(_('My Podcast Feed Privacy'));
$stationPodcastPrivacy = new Zend_Form_Element_Radio("stationPodcastPrivacy");
$stationPodcastPrivacy->setLabel(_('Feed Privacy'));
$stationPodcastPrivacy->setMultiOptions(array(
_("Public"),
_("Private"),
));
$stationPodcastPrivacy->setValue($isPrivate);
$stationPodcastPrivacy->setDecorators(array('ViewHelper', 'Label'));
$this->addElement($stationPodcastPrivacy);
$stationPodcast = PodcastQuery::create()->findOneByDbId(Application_Model_Preference::getStationPodcastId());
$url = $stationPodcast->getDbUrl();
$feedUrl = new Zend_Form_Element_Text("stationPodcastFeedUrl:");
$feedUrl = new Zend_Form_Element_Text("stationPodcastFeedUrl");
$feedUrl->setAttrib('class', 'input_text')
->setAttrib('disabled', 'disabled')
->setRequired(false)
->setLabel(_("My Podcast Feed URL"))
->setLabel(_("Feed URL"))
->setValue($url);
$feedUrl->setDecorators(array('ViewHelper', 'Label'));
$this->addElement($feedUrl);
}

View file

@ -26,10 +26,6 @@ class Application_Form_Preferences extends Zend_Form
$this->addSubForm($general_pref, 'preferences_general');
// Station Podcast form
$podcastPreferences = new Application_Form_PodcastPreferences();
$this->addSubForm($podcastPreferences, 'preferences_podcast');
//tunein form
$tuneinPreferences = new Application_Form_TuneInPreferences();
$this->addSubForm($tuneinPreferences, 'preferences_tunein');

View file

@ -0,0 +1,11 @@
<?php
class Application_Form_StationPodcast extends Zend_Form {
public function init() {
// Station Podcast form
$podcastPreferences = new Application_Form_PodcastPreferences();
$this->addSubForm($podcastPreferences, 'preferences_podcast');
}
}

View file

@ -99,7 +99,7 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
$disk = $partitions[0];
$used = $disk->totalSpace-$disk->totalFreeSpace;
$total = $disk->totalSpace;
echo "var remainingDiskSpace = ".$disk->totalFreeSpace;
echo "var remainingDiskSpace = ".$disk->totalFreeSpace.";";
?>
</script>
<div id="disk_usage" style="height: 13px; position:fixed; bottom: 5px; left: 10px;">

View file

@ -188,14 +188,19 @@ class Rest_PodcastController extends Zend_Rest_Controller
$this->_helper->json->sendJson($responseBody);
}
/**
* @throws PodcastNotFoundException
*
* @deprecated
*/
public function stationAction() {
$stationPodcastId = Application_Model_Preference::getStationPodcastId();
$podcast = Application_Service_PodcastService::getPodcastById($stationPodcastId);
$path = 'podcast/station_podcast.phtml';
$path = 'podcast/station.phtml';
$this->view->podcast = $podcast;
$this->_helper->json->sendJson(array(
"podcast" => json_encode($podcast),
"html" => $this->view->render($path),
"html" => $this->view->render($path)
));
}

View file

@ -281,7 +281,7 @@ class Application_Service_PodcastService
// Check the StationPodcast table rather than checking
// the station podcast ID key in preferences for extensibility
$podcast = StationPodcastQuery::create()->findOneByDbPodcastId($podcastId);
$path = $podcast ? 'podcast/station_podcast.phtml' : 'podcast/podcast.phtml';
$path = $podcast ? 'podcast/station.phtml' : 'podcast/podcast.phtml';
$podcast = Application_Service_PodcastService::getPodcastById($podcastId);
return array(
"podcast" => json_encode($podcast),

View file

@ -3,11 +3,6 @@
<?php echo $this->element->getSubform('preferences_general') ?>
<h3 class="collapsible-header" id="podcast-heading"><span class="arrow-icon"></span><?php echo _("My Podcast Settings"); ?></h3>
<div class="collapsible-content" id="podcast-settings">
<?php echo $this->element->getSubform('preferences_podcast') ?>
</div>
<h3 class="collapsible-header" id="tunein-pref-heading"><span class="arrow-icon"></span><?php echo _("TuneIn Settings"); ?></h3>
<div class="collapsible-content" id="tunein-settings">
<?php echo $this->element->getSubform('preferences_tunein') ?>

View file

@ -1,6 +1,4 @@
<fieldset class="padded">
<dl class="zend_form">
<?php echo $this->element->getElement('stationPodcastPrivacy')->render() ?>
<?php echo $this->element->getElement('stationPodcastFeedUrl')->render() ?>
</dl>
<?php echo $this->element->getElement('stationPodcastPrivacy')->render() ?>
<?php echo $this->element->getElement('stationPodcastFeedUrl')->render() ?>
</fieldset>

View file

@ -7,11 +7,14 @@
<div class="inner_editor_wrapper">
<form class="podcast-metadata">
<input ng-value="podcast.id" class="obj_id" type="hidden"/>
<label for="podcast_name"><?php echo _("Podcast Name") ?></label>
<input disabled name="podcast_name" ng-model="podcast.title" type="text"/>
<label for="podcast_url"><?php echo _("Podcast URL") ?></label>
<input disabled name="podcast_url" ng-model="podcast.url" type="text"/>
<div>
<label for="podcast_name"><?php echo _("Podcast Name: ") ?></label>
<span class="podcast-metadata-field">{{podcast.title}}</span>
</div>
<div>
<label for="podcast_url"><?php echo _("Podcast URL: ") ?></label>
<span class="podcast-metadata-field">{{podcast.url}}</span>
</div>
<label for="podcast_auto_ingest"><?php echo _("Automatically download latest episodes?") ?></label>
<input name="podcast_auto_ingest" ng-model="podcast.auto_ingest" type="checkbox"/>

View file

@ -0,0 +1,111 @@
<div id="station_podcast">
<div class="angular_wrapper" ng-controller="StationPodcast">
<div class="station_podcast_wrapper">
<div class="inner_editor_title">
<h2>
<span class="title_obj_name"><?php echo _("My Podcast") ?></span>
</h2>
<a href="{{podcast.url}}" target="_blank">
<button class="btn"><?php echo _("View Feed") ?></button>
</a>
</div>
<form class="podcast-metadata">
<input ng-value="podcast.id" class="obj_id" type="hidden"/>
<h3 class="collapsible-header"><span class="arrow-icon"></span><?php echo _("General Fields") ?></h3>
<div class="collapsible-content">
<fieldset class="padded">
<label><?php echo _("Name") ?></label>
<input name="podcast_name" ng-model="podcast.title" type="text"/>
<label><?php echo _("Creator") ?></label>
<input name="podcast_creator" ng-model="podcast.creator" type="text"/>
<label><?php echo _("URL") ?></label>
<input disabled name="podcast_url" ng-model="podcast.url" type="text"/>
<label><?php echo _("Description") ?></label>
<textarea name="podcast_description" ng-model="podcast.description"></textarea>
<label><?php echo _("Language") ?></label>
<select name="podcast_language" ng-model="podcast.language">
<?php
foreach(Application_Common_LocaleHelper::getISO6391LanguageCodes() as $code=>$lang) {
echo "<option value='$code'>$lang</option>";
}
?>
</select>
<label><?php echo _("Copyright") ?></label>
<input name="podcast_copyright" ng-model="podcast.copyright" type="text"/>
<label><?php echo _("Link") ?></label>
<input name="podcast_link" ng-model="podcast.link" type="url"/>
</fieldset>
</div>
<h3 class="collapsible-header"><span class="arrow-icon"></span><?php echo _("iTunes Fields") ?></h3>
<div class="collapsible-content">
<fieldset class="padded">
<label><?php echo _("Author") ?></label>
<input name="podcast_itunes_author" ng-model="podcast.itunes_author" type="text"/>
<label><?php echo _("Keywords") ?></label>
<input name="podcast_itunes_keywords" ng-model="podcast.itunes_keywords" type="text"/>
<label><?php echo _("Summary") ?></label>
<textarea name="podcast_itunes_summary" ng-model="podcast.itunes_summary"></textarea>
<label><?php echo _("Subtitle") ?></label>
<textarea name="podcast_itunes_subtitle" ng-model="podcast.itunes_subtitle"></textarea>
<label><?php echo _("Category") ?></label>
<input name="podcast_itunes_category" ng-model="podcast.itunes_category" type="text"/>
<label><?php echo _("Explicit") ?></label>
<input name="podcast_itunes_explicit" ng-model="podcast.itunes_explicit" type="checkbox"/>
</fieldset>
</div>
<h3 class="collapsible-header" id="podcast-heading"><span class="arrow-icon"></span><?php echo _("Privacy Settings"); ?></h3>
<div class="collapsible-content" id="podcast-settings">
<?php echo $this->form->getSubform('preferences_podcast') ?>
</div>
<p id="station_podcast_help_text">
<?php echo(sprintf(_("For detailed information on what these metadata fields mean, please see the %sRSS specification%s
or %sApple's podcasting documentation%s."),
'<a href="http://cyber.law.harvard.edu/rss/rss.html#requiredChannelElements">', '</a>',
'<a target="_blank" href="http://www.apple.com/ca/itunes/podcasts/specs.html">', "</a>")); ?>
</p>
</form>
<div class="btn-toolbar clearfix">
<div class='btn-group pull-right'>
<button ng-click="savePodcast()" class="btn" title='<?php echo _("Save station podcast") ?>' type="button">
<?php echo _("Save") ?>
</button>
</div>
<div class='success' style='display:none'></span></div>
</div>
</div>
<table class="datatable podcast_episodes" cellpadding="0" cellspacing="0"></table>
</div>
</div>
<script>
$(document).ready(function () {
<?php echo "var podcast = " . $this->podcast . ";" ?>
AIRTIME.podcast.podcastApp.value('podcast', podcast);
AIRTIME.podcast.podcastApp.value('tab', null);
var wrapper = $(".angular_wrapper");
angular.bootstrap(wrapper.get(0), ["podcast"]);
});
$('.collapsible-header').click(function() {
$(this).next().toggle('fast');
$(this).toggleClass("closed");
return false;
});
</script>

View file

@ -1,99 +0,0 @@
<div class="angular_wrapper" ng-controller="StationPodcast">
<div class="inner_editor_title">
<h2>
<span class="title_obj_name"><?php echo _("My Podcast") ?></span>
</h2>
<a href="{{podcast.url}}" target="_blank">
<button class="btn"><?php echo _("View Feed") ?></button>
</a>
</div>
<div class="inner_editor_wrapper station_podcast_wrapper">
<form class="podcast-metadata">
<input ng-value="podcast.id" class="obj_id" type="hidden"/>
<div>
<label><?php echo _("Name") ?></label>
<input name="podcast_name" ng-model="podcast.title" type="text"/>
</div>
<div>
<label><?php echo _("Creator") ?></label>
<input name="podcast_creator" ng-model="podcast.creator" type="text"/>
</div>
<div>
<label><?php echo _("URL") ?></label>
<input disabled name="podcast_url" ng-model="podcast.url" type="text"/>
</div>
<div>
<label><?php echo _("Description") ?></label>
<textarea name="podcast_description" ng-model="podcast.description"></textarea>
</div>
<div>
<label><?php echo _("Language") ?></label>
<select name="podcast_language" ng-model="podcast.language">
<?php
foreach(Application_Common_LocaleHelper::getISO6391LanguageCodes() as $code=>$lang) {
echo "<option value='$code'>$lang</option>";
}
?>
</select>
</div>
<div>
<label><?php echo _("Copyright") ?></label>
<input name="podcast_copyright" ng-model="podcast.copyright" type="text"/>
</div>
<div>
<label><?php echo _("Link") ?></label>
<input name="podcast_link" ng-model="podcast.link" type="url"/>
</div>
<fieldset>
<legend><?php echo _("iTunes Fields") ?></legend>
<label><?php echo _("Author") ?></label>
<input name="podcast_itunes_author" ng-model="podcast.itunes_author" type="text"/>
<label><?php echo _("Keywords") ?></label>
<input name="podcast_itunes_keywords" ng-model="podcast.itunes_keywords" type="text"/>
<label><?php echo _("Summary") ?></label>
<textarea name="podcast_itunes_summary" ng-model="podcast.itunes_summary"></textarea>
<label><?php echo _("Subtitle") ?></label>
<textarea name="podcast_itunes_subtitle" ng-model="podcast.itunes_subtitle"></textarea>
<label><?php echo _("Category") ?></label>
<input name="podcast_itunes_category" ng-model="podcast.itunes_category" type="text"/>
<label><?php echo _("Explicit") ?></label>
<input name="podcast_itunes_explicit" ng-model="podcast.itunes_explicit" type="checkbox"/>
</fieldset>
<p>
<?php echo(sprintf(_("For detailed information on what these metadata fields mean, please see the %sRSS specification%s
or %sApple's podcasting documentation%s."),
'<a href="http://cyber.law.harvard.edu/rss/rss.html#requiredChannelElements">', '</a>',
'<a target="_blank" href="http://www.apple.com/ca/itunes/podcasts/specs.html">', "</a>")); ?>
</p>
</form>
</div>
<table class="datatable podcast_episodes" cellpadding="0" cellspacing="0"></table>
<div class="btn-toolbar clearfix">
<div class="btn-group pull-right">
<button ng-click="discard()" class="btn" type="button" name="cancel">
<?php echo _("Cancel") ?>
</button>
</div>
<div class='btn-group pull-right'>
<button ng-click="savePodcast()" class="btn" title='<?php echo _("Save station podcast") ?>' type="button">
<?php echo _("Save") ?>
</button>
</div>
<div class='success' style='display:none'></span></div>
</div>
</div>