Merge branch 'saas-dev-publishing' of github.com:sourcefabric/Airtime into saas-dev-publishing

This commit is contained in:
Albert Santoni 2015-11-17 17:34:33 -05:00
commit 4fd61cb088
9 changed files with 26 additions and 15 deletions

View file

@ -18,7 +18,14 @@ class Application_Common_HTTPHelper
); );
} }
public static function getStationUrl() /**
* Construct the base station URL
*
* @param boolean $secured whether or not to use HTTPS
*
* @return string the station URL
*/
public static function getStationUrl($secured = true)
{ {
$CC_CONFIG = Config::getConfig(); $CC_CONFIG = Config::getConfig();
$baseUrl = $CC_CONFIG['baseUrl']; $baseUrl = $CC_CONFIG['baseUrl'];
@ -32,7 +39,7 @@ class Application_Common_HTTPHelper
} }
$scheme = "http"; $scheme = "http";
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') { if ($secured && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {
$scheme = "https"; $scheme = "https";
$basePort = "443"; //Airtime Pro compatibility hack $basePort = "443"; //Airtime Pro compatibility hack
} }

View file

@ -40,7 +40,6 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
$this->addElement('image', 'SoundCloudConnect', array( $this->addElement('image', 'SoundCloudConnect', array(
'src' => 'http://connect.soundcloud.com/2/btn-connect-sc-l.png', 'src' => 'http://connect.soundcloud.com/2/btn-connect-sc-l.png',
'target' => '_blank',
'decorators' => array( 'decorators' => array(
'ViewHelper' 'ViewHelper'
) )
@ -48,7 +47,6 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
$this->addElement('image', 'SoundCloudDisconnect', array( $this->addElement('image', 'SoundCloudDisconnect', array(
'src' => 'http://connect.soundcloud.com/2/btn-disconnect-l.png', 'src' => 'http://connect.soundcloud.com/2/btn-disconnect-l.png',
'target' => '_blank',
'decorators' => array( 'decorators' => array(
'ViewHelper' 'ViewHelper'
) )

View file

@ -66,7 +66,7 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
<a href="#"><?php echo _("Webstream") ?></a> <a href="#"><?php echo _("Webstream") ?></a>
</li> </li>
</ul> </ul>
<a href="/plupload"> <a href="<?php echo Application_Common_OsPath::getBaseDir() . 'plupload' ?>">
<button id="add_media_btn" class="btn btn-small dashboard-btn btn-new"> <button id="add_media_btn" class="btn btn-small dashboard-btn btn-new">
<span><?php echo _("Upload") ?></span> <span><?php echo _("Upload") ?></span>
</button> </button>
@ -74,7 +74,7 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
</div> </div>
<div class="media_type_selector top-link" data-selection-id="<?php echo MediaType::getDefault(); ?>"> <div class="media_type_selector top-link" data-selection-id="<?php echo MediaType::getDefault(); ?>">
<a href="/showbuilder#"> <a href="<?php echo Application_Common_OsPath::getBaseDir() . 'showbuilder#' ?>">
<i class='icon-home icon-white'></i> <i class='icon-home icon-white'></i>
<?php echo _("Dashboard") ?> <?php echo _("Dashboard") ?>
</a> </a>

View file

@ -152,14 +152,14 @@ class Application_Service_PodcastService
public static function createStationPodcast() public static function createStationPodcast()
{ {
$podcast = new Podcast(); $podcast = new Podcast();
$podcast->setDbUrl(Application_Common_HTTPHelper::getStationUrl() . "feeds/station-rss"); $podcast->setDbUrl(Application_Common_HTTPHelper::getStationUrl(false) . "feeds/station-rss");
$title = Application_Model_Preference::GetStationName(); $title = Application_Model_Preference::GetStationName();
$title = empty($title) ? "My Station's Podcast" : $title; $title = empty($title) ? "My Station's Podcast" : $title;
$podcast->setDbTitle($title); $podcast->setDbTitle($title);
$podcast->setDbDescription(Application_Model_Preference::GetStationDescription()); $podcast->setDbDescription(Application_Model_Preference::GetStationDescription());
$podcast->setDbLink(Application_Common_HTTPHelper::getStationUrl()); $podcast->setDbLink(Application_Common_HTTPHelper::getStationUrl(false));
$podcast->setDbLanguage(explode('_', Application_Model_Preference::GetLocale())[0]); $podcast->setDbLanguage(explode('_', Application_Model_Preference::GetLocale())[0]);
$podcast->setDbCreator(Application_Model_Preference::GetStationName()); $podcast->setDbCreator(Application_Model_Preference::GetStationName());
$podcast->setDbOwner(self::getOwnerId()); $podcast->setDbOwner(self::getOwnerId());
@ -368,11 +368,11 @@ class Application_Service_PodcastService
self::addEscapedChild($channel, "language", $podcast->getDbLanguage()); self::addEscapedChild($channel, "language", $podcast->getDbLanguage());
self::addEscapedChild($channel, "copyright", $podcast->getDbCopyright()); self::addEscapedChild($channel, "copyright", $podcast->getDbCopyright());
$imageUrl = Application_Common_HTTPHelper::getStationUrl()."images/airtime_logo.png"; $imageUrl = Application_Common_HTTPHelper::getStationUrl(false)."images/airtime_logo.png";
$image = $channel->addChild("image"); $image = $channel->addChild("image");
$image->addChild("title", "image title"); $image->addChild("title", "image title");
self::addEscapedChild($image, "url", $imageUrl); self::addEscapedChild($image, "url", $imageUrl);
self::addEscapedChild($image, "link", Application_Common_HTTPHelper::getStationUrl()); self::addEscapedChild($image, "link", Application_Common_HTTPHelper::getStationUrl(false));
$xml->addAttribute('xmlns:xmlns:itunes', ITUNES_XML_NAMESPACE_URL); $xml->addAttribute('xmlns:xmlns:itunes', ITUNES_XML_NAMESPACE_URL);
self::addEscapedChild($channel, "xmlns:itunes:author", $podcast->getDbItunesAuthor()); self::addEscapedChild($channel, "xmlns:itunes:author", $podcast->getDbItunesAuthor());

View file

@ -21,7 +21,7 @@
<div class="publish-sources" ng-repeat="source in sources.toPublish"> <div class="publish-sources" ng-repeat="source in sources.toPublish">
<input ng-disabled="{{source.status == 2}}" ng-model="publishData[source.source]" type="checkbox" name="publish_sources" id="{{source.source}}"> <input ng-disabled="{{source.status == 2}}" ng-model="publishData[source.source]" type="checkbox" name="publish_sources" id="{{source.source}}">
<label class="source-name" for="{{source.source}}">{{source.label}}</label> <label class="source-name" for="{{source.source}}">{{source.label}}</label>
<span ng-if="source.status == 2" style="margin: auto"><a href="/preference#{{source.source}}-heading"><?php echo _("You aren't connected to this source.") ?></a></span> <span ng-if="source.status == 2" style="margin: auto"><a href="<?php echo Application_Common_OsPath::getBaseDir() . 'preference#{{source.source}}-heading' ?>"><?php echo _("You aren't connected to this source.") ?></a></span>
</div> </div>
<div ng-if="sources.toPublish.length == 0"> <div ng-if="sources.toPublish.length == 0">
<?php echo _("You have already published this track to all available sources!") . "<br/>" <?php echo _("You have already published this track to all available sources!") . "<br/>"

View file

@ -6,7 +6,7 @@
<div class="trial-box-calendar-gray"><?php echo _("days") ?></div> <div class="trial-box-calendar-gray"><?php echo _("days") ?></div>
</div> </div>
<div class="trial-box-button"> <div class="trial-box-button">
<a title="<?php echo sprintf(_pro("Purchase an %s plan!"), SAAS_PRODUCT_BRANDING_NAME)?>" href="/billing/upgrade"><?php echo _pro("My Account") ?></a> <a title="<?php echo sprintf(_pro("Purchase an %s plan!"), SAAS_PRODUCT_BRANDING_NAME)?>" href="<?php echo Application_Common_OsPath::getBaseDir() . 'billing/upgrade' ?>"><?php echo _pro("My Account") ?></a>
</div> </div>
</div> </div>
<?php }?> <?php }?>

View file

@ -13,6 +13,10 @@
margin: 0; margin: 0;
} }
#station_podcast .inner_editor_title button {
margin: 0 0 0 4px;
}
#station_podcast .collapsible-header { #station_podcast .collapsible-header {
margin: 0 0 20px; margin: 0 0 20px;
top: 20px; top: 20px;

View file

@ -1301,8 +1301,8 @@ var AIRTIME = (function(AIRTIME) {
} }
var dt = $datatables[table], var dt = $datatables[table],
wrapper = $(dt).closest(".dataTables_wrapper"); wrapper = $(dt).closest(".dataTables_wrapper");
if (oTable && typeof oTable.fnClearTable === 'function') { if (dt && typeof dt.fnClearTable === 'function') {
oTable.fnClearTable(false); dt.fnClearTable(false);
} }
// Don't redraw if we're switching to another hash for the library table // Don't redraw if we're switching to another hash for the library table
$.when(redraw ? dt.fnDraw() : function () {}).done(function () { $.when(redraw ? dt.fnDraw() : function () {}).done(function () {
@ -1386,6 +1386,7 @@ var AIRTIME = (function(AIRTIME) {
}); });
var openPodcastEpisodeTable = function (podcast) { var openPodcastEpisodeTable = function (podcast) {
$("#library_filter").append(" - " + podcast.title);
mod.podcastEpisodeTableWidget.reload(podcast.id); mod.podcastEpisodeTableWidget.reload(podcast.id);
mod.podcastTableWidget.clearSelection(); mod.podcastTableWidget.clearSelection();
mod.setCurrentTable(mod.DataTableTypeEnum.PODCAST_EPISODES); mod.setCurrentTable(mod.DataTableTypeEnum.PODCAST_EPISODES);
@ -1427,7 +1428,6 @@ var AIRTIME = (function(AIRTIME) {
// in the left-hand pane. // in the left-hand pane.
mod.podcastTableWidget.assignDblClickHandler(function () { mod.podcastTableWidget.assignDblClickHandler(function () {
var podcast = mod.podcastDataTable.fnGetData(this); var podcast = mod.podcastDataTable.fnGetData(this);
$("#library_filter").append(" - " + $(this).find(".library_title").text());
openPodcastEpisodeTable(podcast); openPodcastEpisodeTable(podcast);
}); });

View file

@ -516,6 +516,8 @@ var AIRTIME = (function (AIRTIME) {
remainingDiskSpace -= this.enclosure.length; remainingDiskSpace -= this.enclosure.length;
}); });
dt.clearSelection();
}; };
/** /**