Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Rudi Grinberg 2012-08-21 10:43:04 -04:00
commit 6d0d0eada9
6 changed files with 72 additions and 42 deletions

View File

@ -275,7 +275,6 @@ class PlaylistController extends Zend_Controller_Action
$user = new Application_Model_User($userInfo->id);
try {
Logging::log("Currently active {$type} {$this->obj_sess->id}");
if (in_array($this->obj_sess->id, $ids)) {
Logging::log("Deleting currently active {$type}");
@ -290,11 +289,9 @@ class PlaylistController extends Zend_Controller_Action
Application_Model_Block::deleteBlocks($ids, $userInfo->id);
}
$this->createFullResponse($obj);
}
catch (PlaylistNoPermissionException $e) {
} catch (PlaylistNoPermissionException $e) {
$this->playlistNoPermission($type);
}
catch (PlaylistNotFoundException $e) {
} catch (PlaylistNotFoundException $e) {
$this->playlistNotFound($type);
} catch (Exception $e) {
$this->playlistUnknownError($e);

View File

@ -8,6 +8,7 @@ class WebstreamController extends Zend_Controller_Action
$ajaxContext->addActionContext('new', 'json')
->addActionContext('save', 'json')
->addActionContext('edit', 'json')
->addActionContext('delete', 'json')
->initContext();
//TODO
//$this->pl_sess = new Zend_Session_Namespace(UI_PLAYLIST_SESSNAME);
@ -46,6 +47,15 @@ class WebstreamController extends Zend_Controller_Action
$this->view->html = $this->view->render('webstream/webstream.phtml');
}
public function deleteAction()
{
$request = $this->getRequest();
$id = $request->getParam("ids");
$webstream = CcWebstreamQuery::create()->findPK($id)->delete();
}
public function saveAction()
{
$request = $this->getRequest();

View File

@ -13,7 +13,7 @@ if (isset($this->obj)) {
<?php endif; ?>
<?php if (isset($this->obj)) : ?>
<button class="ui-button ui-state-default sp-save" type="button" id="save_button">Save</button>
<button class="ui-button ui-state-default sp-save" title='Save playlist' type="button" id="save_button">Save</button>
<input id="obj_id" type="hidden" value="<?php echo $this->obj->getId(); ?>"></input>
<input id="obj_lastMod" type="hidden" value="<?php echo $this->obj->getLastModified('U'); ?>"></input>
<input id='obj_type' type='hidden' value='playlist'></input>

View File

@ -10,7 +10,7 @@ if (isset($this->obj)) {
<a href="#" id="spl_crossfade" class="ui-button ui-button-icon-only ui-widget ui-state-default crossfade-main-button" style="display:<?php echo ($this->obj->isStatic() && $count > 0) ?"block;":"none;"?>">
<span class="ui-icon crossfade-main-icon"></span><span class="ui-button-text">Playlist crossfade</span>
</a>
<button class="ui-button ui-state-default sp-save" type="button" id="save_button">Save</button>
<button class="ui-button ui-state-default sp-save" title='Save smart block&#39s title, description, and criteria' type="button" id="save_button">Save</button>
<?php endif; ?>
<?php if (isset($this->obj)) : ?>

View File

@ -4,9 +4,11 @@
<?php endif; ?>
<?php if (isset($this->ws)) : ?>
<input id="ws_id" type="hidden" value="<?php echo $this->ws->getId(); ?>"></input>
<input id="pl_lastMod" type="hidden" value="<?php echo $this->ws->getLastModified('U'); ?>"></input>
<input id="obj_id" type="hidden" value="<?php echo $this->ws->getId(); ?>"></input>
<input id="obj_lastMod" type="hidden" value="<?php echo "1";//$this->ws->getLastModified('U'); ?>"></input>
<input id="obj_type" type="hidden" value="webstream"></input>
<div class="status" style="display:none;"></div>
<div class="playlist_title">
<div id="name-error" class="errors" style="display:none;"></div>
<h3 id="ws_name">

View File

@ -6,7 +6,7 @@ var AIRTIME = (function(AIRTIME){
if (AIRTIME.playlist === undefined) {
AIRTIME.playlist = {};
}
}
var mod = AIRTIME.playlist,
viewport,
@ -568,7 +568,7 @@ var AIRTIME = (function(AIRTIME){
//stream url
//default_length
//playlist name
var id = $pl.find("#ws_id").attr("value");
var id = $pl.find("#obj_id").attr("value");
var description = $pl.find("#description").val();
var streamurl = $pl.find("#streamurl-element input").val();
var length = $pl.find("#streamlength-element input").val();
@ -596,7 +596,7 @@ var AIRTIME = (function(AIRTIME){
$status.show();
setTimeout(function(){$status.fadeOut("slow", function(){$status.empty()})}, 5000);
var $ws_id = $("#ws_id");
var $ws_id = $("#obj_id");
$ws_id.attr("value", json.streamId);
var $ws_id = $("#ws_delete");
@ -803,6 +803,23 @@ var AIRTIME = (function(AIRTIME){
});
};
mod.fnWsDelete = function(wsid) {
var url, id, lastMod;
stopAudioPreview();
id = (wsid === undefined) ? getId() : wsid;
lastMod = getModified();
type = $('#obj_type').val();
url = '/Webstream/delete';
$.post(url,
{format: "json", ids: id, modified: lastMod, type: type},
function(json){
openPlaylist(json);
redrawLib();
});
};
mod.disableUI = function() {
$lib.block({
@ -904,6 +921,10 @@ var AIRTIME = (function(AIRTIME){
AIRTIME.playlist.fnDelete();
}});
$pl.delegate("#ws_delete", {"click": function(ev){
AIRTIME.playlist.fnWsDelete();
}});
setPlaylistEntryEvents();
setCueEvents();
setFadeEvents();