Merge branch 'master' of dev.sourcefabric.org:campcaster
This commit is contained in:
commit
3615bfbf59
|
@ -28,7 +28,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
private function getPlaylist()
|
||||
{
|
||||
$pl_sess = $this->pl_sess;
|
||||
|
||||
|
||||
if(isset($pl_sess->id)) {
|
||||
|
||||
$pl = Playlist::Recall($pl_sess->id);
|
||||
|
@ -43,7 +43,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
private function changePlaylist($pl_id)
|
||||
{
|
||||
$pl_sess = $this->pl_sess;
|
||||
|
||||
|
||||
if(isset($pl_sess->id)) {
|
||||
|
||||
$pl = Playlist::Recall($pl_sess->id);
|
||||
|
@ -51,13 +51,13 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$this->closePlaylist($pl);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
|
||||
$pl = Playlist::Recall($pl_id);
|
||||
if($pl === FALSE) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
$pl->lock($userInfo->id);
|
||||
$pl_sess->id = $pl_id;
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$this->view->headScript()->appendFile('/js/airtime/library/spl.js','text/javascript');
|
||||
$this->view->headLink()->appendStylesheet('/css/playlist_builder.css');
|
||||
|
||||
$this->_helper->viewRenderer->setResponseSegment('spl');
|
||||
$this->_helper->viewRenderer->setResponseSegment('spl');
|
||||
$this->view->pl = $this->getPlaylist();
|
||||
}
|
||||
|
||||
|
@ -88,10 +88,10 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
|
||||
$pl = new Playlist();
|
||||
$pl_id = $pl->create("Untitled Playlist");
|
||||
$pl->create("Untitled Playlist");
|
||||
$pl->setPLMetaData('dc:creator', $userInfo->login);
|
||||
|
||||
$this->changePlaylist($pl_id);
|
||||
$this->changePlaylist($pl->getId());
|
||||
$form = new Application_Form_PlaylistMetadata();
|
||||
$this->view->fieldset = $form;
|
||||
$this->view->form = $this->view->render('playlist/new.phtml');
|
||||
|
@ -105,25 +105,25 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$pl_id = $this->_getParam('id', null);
|
||||
//not a new playlist
|
||||
if(!is_null($pl_id)) {
|
||||
$this->changePlaylist($pl_id);
|
||||
|
||||
$this->changePlaylist($pl_id);
|
||||
|
||||
$pl = $this->getPlaylist();
|
||||
$title = $pl->getPLMetaData(UI_MDATA_KEY_TITLE);
|
||||
$desc = $pl->getPLMetaData(UI_MDATA_KEY_DESCRIPTION);
|
||||
|
||||
$data = array( 'title' => $title, 'description' => $desc);
|
||||
$form->populate($data);
|
||||
$data = array( 'title' => $title, 'description' => $desc);
|
||||
$form->populate($data);
|
||||
}
|
||||
|
||||
|
||||
if ($request->isPost()) {
|
||||
$title = $this->_getParam('title', null);
|
||||
$description = $this->_getParam('description', null);
|
||||
|
||||
$pl = $this->getPlaylist();
|
||||
|
||||
|
||||
if($title)
|
||||
$pl->setName($title);
|
||||
|
||||
|
||||
if(isset($description)) {
|
||||
$pl->setPLMetaData(UI_MDATA_KEY_DESCRIPTION, $description);
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$this->view->html = $this->view->render('playlist/index.phtml');
|
||||
unset($this->view->pl);
|
||||
}
|
||||
|
||||
|
||||
$this->view->fieldset = $form;
|
||||
$this->view->form = $this->view->render('playlist/new.phtml');
|
||||
}
|
||||
|
@ -140,13 +140,13 @@ class PlaylistController extends Zend_Controller_Action
|
|||
public function editAction()
|
||||
{
|
||||
$pl_id = $this->_getParam('id', null);
|
||||
|
||||
|
||||
if(!is_null($pl_id)) {
|
||||
$this->changePlaylist($pl_id);
|
||||
$this->changePlaylist($pl_id);
|
||||
}
|
||||
|
||||
|
||||
$pl = $this->getPlaylist();
|
||||
|
||||
|
||||
$this->view->pl = $pl;
|
||||
$this->view->html = $this->view->render('playlist/index.phtml');
|
||||
unset($this->view->pl);
|
||||
|
@ -158,7 +158,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$pos = $this->_getParam('pos', null);
|
||||
|
||||
if (!is_null($id)) {
|
||||
|
||||
|
||||
$pl = $this->getPlaylist();
|
||||
$res = $pl->addAudioClip($id, $pos);
|
||||
|
||||
|
@ -181,7 +181,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
{
|
||||
$oldPos = $this->_getParam('oldPos');
|
||||
$newPos = $this->_getParam('newPos');
|
||||
|
||||
|
||||
$pl = $this->getPlaylist();
|
||||
|
||||
$pl->moveAudioClip($oldPos, $newPos);
|
||||
|
@ -197,7 +197,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
public function deleteItemAction()
|
||||
{
|
||||
$positions = $this->_getParam('pos', array());
|
||||
|
||||
|
||||
if (!is_array($positions))
|
||||
$positions = array($positions);
|
||||
|
||||
|
@ -208,7 +208,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$pl = $this->getPlaylist();
|
||||
|
||||
foreach ($positions as $pos) {
|
||||
$pl->delAudioClip($pos);
|
||||
$pl->delAudioClip($pos);
|
||||
}
|
||||
|
||||
$this->view->pl = $pl;
|
||||
|
@ -274,7 +274,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
{
|
||||
$id = $this->_getParam('id', null);
|
||||
$pl = Playlist::Recall($id);
|
||||
|
||||
|
||||
if ($pl !== FALSE) {
|
||||
|
||||
Playlist::Delete($id);
|
||||
|
@ -291,7 +291,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
public function deleteActiveAction()
|
||||
{
|
||||
$pl = $this->getPlaylist();
|
||||
$pl = $this->getPlaylist();
|
||||
Playlist::Delete($pl->getId());
|
||||
|
||||
$pl_sess = $this->pl_sess;
|
||||
|
@ -304,7 +304,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
{
|
||||
$pl = $this->getPlaylist();
|
||||
$this->closePlaylist($pl);
|
||||
|
||||
|
||||
$this->view->html = $this->view->render('playlist/index.phtml');
|
||||
}
|
||||
|
||||
|
|
|
@ -176,11 +176,11 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
|
||||
if (strtotime($show->getShowStart()) <= strtotime($today_timestamp) &&
|
||||
strtotime($today_timestamp) < strtotime($show->getShowEnd())) {
|
||||
strtotime($today_timestamp) < strtotime($show->getShowEnd()) &&
|
||||
$user->isAdmin()) {
|
||||
$menu[] = array('action' => array('type' => 'fn',
|
||||
//'url' => '/Schedule/cancel-current-show'.$params,
|
||||
'callback' => "window['confirmCancelShow']($id)"),
|
||||
'title' => 'Cancel Current Show');
|
||||
'callback' => "window['confirmCancelShow']($id)"),
|
||||
'title' => 'Cancel Current Show');
|
||||
}
|
||||
|
||||
if (strtotime($today_timestamp) < strtotime($show->getShowStart())) {
|
||||
|
@ -319,6 +319,17 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$showInstanceId = $this->_getParam('id');
|
||||
$show = new ShowInstance($showInstanceId);
|
||||
|
||||
$originalShowId = $show->isRebroadcast();
|
||||
if (!is_null($originalShowId)){
|
||||
$originalShow = new ShowInstance($originalShowId);
|
||||
$originalShowName = $originalShow->getName();
|
||||
$originalShowStart = $originalShow->getShowStart();
|
||||
|
||||
$timestamp = strtotime($originalShowStart);
|
||||
$this->view->additionalShowInfo =
|
||||
"Rebroadcast of show \"$originalShowName\" from "
|
||||
.date("l, F jS", $timestamp)." at ".date("G:i", $timestamp);
|
||||
}
|
||||
$this->view->showContent = $show->getShowListContent();
|
||||
$this->view->dialog = $this->view->render('schedule/show-content-dialog.phtml');
|
||||
unset($this->view->showContent);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div id="schedule-add-show" class="tabs ui-widget ui-widget-content block-shadow alpha-block padded">
|
||||
<div class="button-bar">
|
||||
<a href="#" id="add-show-close" class="icon-link"><span class="ui-icon ui-icon-circle-close"></span>Close</a>
|
||||
<button aria-disabled="false" role="button" id="add-show-submit" class="right-floated ui-button ui-widget ui-state-default ui-button-text-icon-primary">
|
||||
<button aria-disabled="false" role="button" class="add-show-submit right-floated ui-button ui-widget ui-state-default ui-button-text-icon-primary">
|
||||
<span class="ui-icon ui-icon-plusthick"></span>
|
||||
<span class="ui-button-text">Add this show</span>
|
||||
</button>
|
||||
|
@ -30,5 +30,11 @@
|
|||
<div id="schedule-show-style" class="collapsible-content">
|
||||
<?php echo $this->style; ?>
|
||||
</div>
|
||||
<div class="button-bar">
|
||||
<button aria-disabled="false" role="button" class="add-show-submit right-floated ui-button ui-widget ui-state-default ui-button-text-icon-primary">
|
||||
<span class="ui-icon ui-icon-plusthick"></span>
|
||||
<span class="ui-button-text">Add this show</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<div id="show_content_dialog">
|
||||
<div><?php echo $this->additionalShowInfo; ?></div>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="datatable">
|
||||
<tr>
|
||||
<th>Start</th>
|
||||
|
|
|
@ -1085,7 +1085,7 @@ button.ui-button-icons-only {
|
|||
padding-right: 2.1em;
|
||||
}
|
||||
/* no icon support for input elements, provide padding by default */
|
||||
input.ui-button, button.ui-button {
|
||||
input.ui-button {
|
||||
padding: .4em 1em;
|
||||
}
|
||||
/*button icon element(s) */
|
||||
|
|
|
@ -181,8 +181,15 @@ function setAddShowEvents() {
|
|||
makeAddShowButton();
|
||||
});
|
||||
|
||||
form.find("#add-show-submit")
|
||||
form.find(".add-show-submit")
|
||||
.click(function(event){
|
||||
var addShowButton = $(this);
|
||||
if (!addShowButton.hasClass("disabled")){
|
||||
addShowButton.addClass("disabled");
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
var data = $("form").serializeArray();
|
||||
|
@ -203,6 +210,7 @@ function setAddShowEvents() {
|
|||
var end_date = $("#add_show_end_date").val();
|
||||
|
||||
$.post("/Schedule/add-show", {format: "json", data: data, hosts: hosts, days: days}, function(json){
|
||||
addShowButton.removeClass("disabled");
|
||||
if(json.form) {
|
||||
$("#add-show-form")
|
||||
.empty()
|
||||
|
|
Loading…
Reference in New Issue