CC-1708 added x instead of input to remove items. Merging side playlist and playlist into one.

This commit is contained in:
naomiaro 2011-01-16 15:35:00 -05:00
parent da85a5ad26
commit 01df8d8d6b
15 changed files with 78 additions and 230 deletions

View file

@ -22,31 +22,6 @@ $pages = array(
'action' => 'add-user',
'resource' => 'user'
),
array(
'label' => 'Playlists',
'module' => 'default',
'controller' => 'Playlist',
'action' => 'index',
'resource' => 'playlist',
'pages' => array(
array(
'label' => 'New',
'module' => 'default',
'controller' => 'Playlist',
'action' => 'new',
'resource' => 'playlist',
'visible' => false
),
array(
'label' => 'Edit',
'module' => 'default',
'controller' => 'Playlist',
'action' => 'edit',
'resource' => 'playlist',
'visible' => false
)
)
),
array(
'label' => 'Media Library',
'module' => 'default',

View file

@ -32,6 +32,7 @@ class LibraryController extends Zend_Controller_Action
$this->view->headScript()->appendFile('/js/airtime/onready/library.js','text/javascript');
$this->view->headScript()->appendFile('/js/contextmenu/jjmenu.js','text/javascript');
$this->view->headLink()->appendStylesheet('/css/contextmenu.css');
$this->view->headLink()->appendStylesheet('/css/media_library.css');
$this->_helper->layout->setLayout('library');
@ -40,7 +41,7 @@ class LibraryController extends Zend_Controller_Action
$this->_helper->actionStack('contents', 'library');
$this->_helper->actionStack('quick-search', 'library');
$this->_helper->actionStack('index', 'sideplaylist');
$this->_helper->actionStack('index', 'playlist');
}
public function contextMenuAction()

View file

@ -80,7 +80,19 @@ class PlaylistController extends Zend_Controller_Action
public function indexAction()
{
$this->view->headScript()->appendFile('/js/airtime/library/spl.js','text/javascript');
$this->view->headLink()->appendStylesheet('/css/playlist_builder.css');
$this->_helper->viewRenderer->setResponseSegment('spl');
$pl_sess = $this->pl_sess;
if(isset($pl_sess->id)) {
$pl = $this->getPlaylist();
$this->view->pl = $pl;
}
}
public function newAction()
@ -139,7 +151,7 @@ class PlaylistController extends Zend_Controller_Action
$this->view->headScript()->appendFile('/js/airtime/playlist/playlist.js','text/javascript');
$pl_id = $this->_getParam('id', null);
$display = $this->_getParam('view', null);
if(!is_null($pl_id)) {
$this->changePlaylist($pl_id);
}
@ -147,11 +159,8 @@ class PlaylistController extends Zend_Controller_Action
$pl = $this->getPlaylist();
$this->view->pl = $pl;
if($display === 'spl') {
$this->view->html = $this->view->render('sideplaylist/index.phtml');
unset($this->view->pl);
}
$this->view->html = $this->view->render('playlist/index.phtml');
unset($this->view->pl);
}
public function addItemAction()
@ -168,7 +177,7 @@ class PlaylistController extends Zend_Controller_Action
}
$this->view->pl = $pl;
$this->view->html = $this->view->render('sideplaylist/update.phtml');
$this->view->html = $this->view->render('playlist/update.phtml');
$this->view->name = $pl->getName();
$this->view->length = $pl->getLength();
@ -182,20 +191,13 @@ class PlaylistController extends Zend_Controller_Action
{
$oldPos = $this->_getParam('oldPos');
$newPos = $this->_getParam('newPos');
$display = $this->_getParam('view');
$pl = $this->getPlaylist();
$pl->moveAudioClip($oldPos, $newPos);
$this->view->pl = $pl;
if($display === 'pl') {
$this->view->html = $this->view->render('playlist/update.phtml');
}
else {
$this->view->html = $this->view->render('sideplaylist/update.phtml');
}
$this->view->html = $this->view->render('playlist/update.phtml');
$this->view->name = $pl->getName();
$this->view->length = $pl->getLength();
@ -205,8 +207,7 @@ class PlaylistController extends Zend_Controller_Action
public function deleteItemAction()
{
$positions = $this->_getParam('pos', array());
$display = $this->_getParam('view');
if (!is_array($positions))
$positions = array($positions);
@ -221,13 +222,7 @@ class PlaylistController extends Zend_Controller_Action
}
$this->view->pl = $pl;
if($display === 'pl') {
$this->view->html = $this->view->render('playlist/update.phtml');
}
else {
$this->view->html = $this->view->render('sideplaylist/update.phtml');
}
$this->view->html = $this->view->render('playlist/update.phtml');
$this->view->name = $pl->getName();
$this->view->length = $pl->getLength();
@ -280,35 +275,21 @@ class PlaylistController extends Zend_Controller_Action
public function deleteActiveAction()
{
$display = $this->_getParam('view');
$pl = $this->getPlaylist();
Playlist::Delete($pl->getId());
$pl_sess = $this->pl_sess;
unset($pl_sess->id);
if($display === 'spl') {
$this->view->html = $this->view->render('sideplaylist/index.phtml');
return;
}
$this->_helper->redirector('index');
$this->view->html = $this->view->render('playlist/index.phtml');
}
public function closeAction()
{
$display = $this->_getParam('view');
$pl = $this->getPlaylist();
$this->closePlaylist($pl);
if($display === 'spl') {
$this->view->html = $this->view->render('sideplaylist/index.phtml');
return;
}
$this->_helper->redirector('index');
$this->view->html = $this->view->render('playlist/index.phtml');
}
}

View file

@ -51,7 +51,7 @@ class SearchController extends Zend_Controller_Action
$this->_helper->actionStack('contents', 'library');
$this->_helper->actionStack('display', 'search');
$this->_helper->actionStack('index', 'sideplaylist');
$this->_helper->actionStack('index', 'playlist');
}
public function displayAction()

View file

@ -1,40 +0,0 @@
<?php
class SideplaylistController extends Zend_Controller_Action
{
protected $pl_sess = null;
public function init()
{
if(!Zend_Auth::getInstance()->hasIdentity())
{
$this->_redirect('login/index');
}
$this->pl_sess = new Zend_Session_Namespace(UI_PLAYLIST_SESSNAME);
}
public function indexAction()
{
$this->view->headScript()->appendFile('/js/airtime/library/spl.js','text/javascript');
$this->_helper->viewRenderer->setResponseSegment('spl');
$pl_sess = $this->pl_sess;
if(isset($pl_sess->id)) {
$pl = Playlist::Recall($pl_sess->id);
if($pl === FALSE) {
unset($pl_sess->id);
return;
}
$this->view->pl = $pl;
}
}
}

View file

@ -1,19 +1,22 @@
<div><a href="<?php echo $this->url(
array(
'controller' => 'Playlist',
'action' => 'new'
),
'default',
true) ?>"> New Playlist</a></div>
<span id="spl_new">New</span>
<?php if (isset($this->pl)) : ?>
<span id="spl_delete">Delete</span>
<span id="spl_close">Close</span>
<?php endif; ?>
<div><a href="<?php echo $this->url(
array(
'controller' => 'Playlist',
'action' => 'edit'
),
'default',
true) ?>"> Edit Playlist</a></div>
<?php if (isset($this->pl)) : ?>
<?php
<div id="spl_name"><?php echo $this->pl->getName(); ?></div>
<div id="spl_length"><?php echo $this->pl->getLength(); ?></div>
echo $this->form;
<ul id="spl_sortable">
<?php if (count($this->pl->getContents())) : ?>
<?php echo $this->partialLoop('sideplaylist/sidebarcontent.phtml', $this->pl->getContents()); ?>
<?php else : ?>
<li class="spl_empty">Empty playlist</li>
<?php endif; ?>
</ul>
<?php else : ?>
<div>No open playlist</div>
<?php endif; ?>

View file

@ -0,0 +1,6 @@
<li class="spl_row" id="spl_<?php echo $this->partialCounter-1 ?>">
<span class="spl_title"><?php echo $this->CcFiles['track_title'] ?></span>
<span class="spl_playlength"><?php echo $this->cliplength ?></span>
<span class="ui-icon ui-icon-close"></span>
<span class="spl_artist"><?php echo $this->CcFiles['artist_name'] ?></span>
</li>

View file

@ -1,8 +1,7 @@
<?php
if (count($this->pl->getContents())) {
echo $this->partialLoop('playlist/playlistEditorTable.phtml', $this->pl->getContents());
}
else {
echo '<div class="pl_empty">Empty playlist</div>';
}
?>
<?php
if (count($this->pl->getContents())) {
echo $this->partialLoop('sideplaylist/sidebarcontent.phtml', $this->pl->getContents());
}
else {
echo '<li class="pl_empty">Empty playlist</li>';
}

View file

@ -1,46 +0,0 @@
<form name="SPL">
<div>
<span id="spl_new">
<a href="<?php echo $this->url(
array(
'controller' => 'Playlist',
'action' => 'new'
),
'default',
true) ?>">New</a>
</span>
<?php if (isset($this->pl)) { echo '<span id="spl_delete">Delete</span>';} ?>
<?php if (isset($this->pl)) { echo '<span id="spl_close">Close</span>';} ?>
<div>
<div id="spl_name"><?php if (isset($this->pl)) { echo $this->pl->getName(); } ?></div>
<div id="spl_length"><?php if (isset($this->pl)) { echo $this->pl->getLength(); } ?></div>
<div class="spl_main">
<?php
if (isset($this->pl)) {
echo '<div class="spl_head">';
echo '<span class="spl_input"><input type="checkbox" name="all"></span>';
echo '<span class="spl_title">Title</span>';
echo '<span class="spl_artist">Creator</span>';
echo '<span class="spl_playlength">Playlength</span>';
echo '</div>';
echo '<ul id="spl_sortable">';
if (count($this->pl->getContents())) {
echo $this->partialLoop('sideplaylist/sidebarcontent.phtml', $this->pl->getContents());
}
else {
echo '<li class="spl_empty">Empty playlist</li>';
}
echo '</ul></div>';
}
else {
echo '<div>No open playlist</div>';
}
?>
</form>
<div class="spl_footer">
<?php if (isset($this->pl)) { echo '<span id="spl_remove_selected">Remove</span>';} ?>
</div>

View file

@ -1,14 +0,0 @@
<li class="spl_row" id="spl_<?php echo $this->partialCounter-1 ?>">
<span class="spl_input">
<input type="checkbox" class="checkbox" name="<?php echo $this->partialCounter-1 ?>"/>
</span>
<span class="spl_title">
<?php echo $this->CcFiles['track_title'] ?>
</span>
<span class="spl_artist">
<?php echo $this->CcFiles['artist_name'] ?>
</span>
<span class="spl_playlength">
<?php echo $this->cliplength ?>
</span>
</li>

View file

@ -1,7 +0,0 @@
<?php
if (count($this->pl->getContents())) {
echo $this->partialLoop('sideplaylist/sidebarcontent.phtml', $this->pl->getContents());
}
else {
echo '<li class="pl_empty">Empty playlist</li>';
}