SAAS-1208, SAAS-1209 - fix preferences and my podcast settings pages
This commit is contained in:
parent
28d378abfa
commit
38d08a5661
4 changed files with 51 additions and 18 deletions
|
@ -51,20 +51,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
Application_Model_Preference::SetWeekStartDay($values["weekStartDay"]);
|
||||
Application_Model_Preference::setRadioPageDisplayLoginButton($values["radioPageLoginButton"]);
|
||||
|
||||
if (!Application_Model_Preference::getStationPodcastPrivacy() && $values["stationPodcastPrivacy"] == 1) {
|
||||
// Refresh the download key when enabling privacy
|
||||
Application_Model_Preference::setStationPodcastDownloadKey();
|
||||
}
|
||||
|
||||
// Append sharing token (download key) to Station podcast URL
|
||||
$stationPodcast = PodcastQuery::create()->findOneByDbId(Application_Model_Preference::getStationPodcastId());
|
||||
$key = Application_Model_Preference::getStationPodcastDownloadKey();
|
||||
$url = Application_Common_HTTPHelper::getStationUrl() .
|
||||
(((int) $values["stationPodcastPrivacy"]) ? "feeds/station-rss?sharing_token=$key" : "feeds/station-rss");
|
||||
$stationPodcast->setDbUrl($url)->save();
|
||||
Application_Model_Preference::setStationPodcastPrivacy($values["stationPodcastPrivacy"]);
|
||||
|
||||
|
||||
$logoUploadElement = $form->getSubForm('preferences_general')->getElement('stationLogo');
|
||||
$logoUploadElement->receive();
|
||||
$imagePath = $logoUploadElement->getFileName();
|
||||
|
@ -97,6 +83,28 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$this->view->form = $form;
|
||||
}
|
||||
|
||||
public function stationPodcastSettingsAction() {
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$values = json_decode($this->getRequest()->getRawBody());
|
||||
|
||||
if (!Application_Model_Preference::getStationPodcastPrivacy() && $values->stationPodcastPrivacy == 1) {
|
||||
// Refresh the download key when enabling privacy
|
||||
Application_Model_Preference::setStationPodcastDownloadKey();
|
||||
}
|
||||
|
||||
// Append sharing token (download key) to Station podcast URL
|
||||
$stationPodcast = PodcastQuery::create()->findOneByDbId(Application_Model_Preference::getStationPodcastId());
|
||||
$key = Application_Model_Preference::getStationPodcastDownloadKey();
|
||||
$url = Application_Common_HTTPHelper::getStationUrl() .
|
||||
(((int) $values->stationPodcastPrivacy) ? "feeds/station-rss?sharing_token=$key" : "feeds/station-rss");
|
||||
$stationPodcast->setDbUrl($url)->save();
|
||||
Application_Model_Preference::setStationPodcastPrivacy($values->stationPodcastPrivacy);
|
||||
|
||||
$this->_helper->json->sendJson(array("url" => $url));
|
||||
}
|
||||
|
||||
public function supportSettingAction()
|
||||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
|
|
@ -5,9 +5,13 @@
|
|||
<h2>
|
||||
<span class="title_obj_name"><?php echo _("My Podcast") ?></span>
|
||||
</h2>
|
||||
<button ng-click="savePodcast()" class="btn" title='<?php echo _("Save station podcast") ?>' type="button">
|
||||
<?php echo _("Save") ?>
|
||||
</button>
|
||||
<a href="{{podcast.url}}" target="_blank">
|
||||
<button class="btn"><?php echo _("View Feed") ?></button>
|
||||
</a>
|
||||
<div class='success' style='display:none'></div>
|
||||
</div>
|
||||
<form class="podcast-metadata">
|
||||
<?php echo $this->form->getElement('csrf') ?>
|
||||
|
@ -87,7 +91,7 @@
|
|||
<?php echo _("Save") ?>
|
||||
</button>
|
||||
</div>
|
||||
<div class='success' style='display:none'></span></div>
|
||||
<div class='success' style='display:none'></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue