CC-1939 Ability to edit name & description of a playlist, display the description somewhere

now can edit title/description of a playlist without leaving the main playlist builder screen
This commit is contained in:
Naomi 2011-05-17 17:30:17 -04:00 committed by martin
parent a48f467de7
commit d4a4c4be2a
7 changed files with 344 additions and 96 deletions

View file

@ -20,6 +20,8 @@ class PlaylistController extends Zend_Controller_Action
->addActionContext('delete-active', 'json')
->addActionContext('delete', 'json')
->addActionContext('set-playlist-fades', 'json')
->addActionContext('set-playlist-name', 'json')
->addActionContext('set-playlist-description', 'json')
->initContext();
$this->pl_sess = new Zend_Session_Namespace(UI_PLAYLIST_SESSNAME);
@ -175,6 +177,7 @@ class PlaylistController extends Zend_Controller_Action
$this->view->html = $this->view->render('playlist/update.phtml');
$this->view->name = $pl->getName();
$this->view->length = $pl->getLength();
$this->view->description = $pl->getDescription();
unset($this->view->pl);
return;
@ -195,6 +198,7 @@ class PlaylistController extends Zend_Controller_Action
$this->view->html = $this->view->render('playlist/update.phtml');
$this->view->name = $pl->getName();
$this->view->length = $pl->getLength();
$this->view->description = $pl->getDescription();
unset($this->view->pl);
}
@ -220,9 +224,10 @@ class PlaylistController extends Zend_Controller_Action
$this->view->html = $this->view->render('playlist/update.phtml');
$this->view->name = $pl->getName();
$this->view->length = $pl->getLength();
$this->view->description = $pl->getDescription();
unset($this->view->pl);
return;
}
@ -341,6 +346,31 @@ class PlaylistController extends Zend_Controller_Action
$this->view->fadeOut = $fades[1];
}
public function setPlaylistNameAction()
{
$name = $this->_getParam('name', 'Unknown Playlist');
$pl = $this->getPlaylist();
$pl->setName($name);
$this->view->playlistName = $name;
}
public function setPlaylistDescriptionAction()
{
$description = $this->_getParam('description', false);
$pl = $this->getPlaylist();
if($description != false) {
$pl->setDescription($description);
}
else {
$description = $pl->getDescription();
}
$this->view->playlistDescription = $description;
}
}