can edit playlist metadata
This commit is contained in:
parent
41c76e2c7d
commit
2a37140c4d
|
@ -62,9 +62,6 @@ class LibraryController extends Zend_Controller_Action
|
|||
}
|
||||
else if($type === "pl") {
|
||||
|
||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Playlist/delete'.$params, 'callback' => 'window["deletePlaylist"]'),
|
||||
'title' => 'Delete');
|
||||
|
||||
if(!isset($pl_sess->id) || $pl_sess->id !== $id) {
|
||||
$menu[] = array('action' =>
|
||||
array('type' => 'ajax',
|
||||
|
@ -80,6 +77,12 @@ class LibraryController extends Zend_Controller_Action
|
|||
'title' => 'Close');
|
||||
}
|
||||
|
||||
$menu[] = array('action' => array('type' => 'gourl', 'url' => '/Playlist/metadata'.$params),
|
||||
'title' => 'Description');
|
||||
|
||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Playlist/delete'.$params, 'callback' => 'window["deletePlaylist"]'),
|
||||
'title' => 'Delete');
|
||||
|
||||
}
|
||||
|
||||
//returns format jjmenu is looking for.
|
||||
|
|
|
@ -103,6 +103,19 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
$request = $this->getRequest();
|
||||
$form = new Application_Form_PlaylistMetadata();
|
||||
|
||||
$pl_id = $this->_getParam('id', null);
|
||||
//not a new playlist
|
||||
if(!is_null($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);
|
||||
}
|
||||
|
||||
if ($request->isPost()) {
|
||||
if ($form->isValid($request->getPost())) {
|
||||
|
@ -112,8 +125,9 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$pl = $this->getPlaylist();
|
||||
$pl->setPLMetaData(UI_MDATA_KEY_TITLE, $formdata["title"]);
|
||||
|
||||
if(isset($formdata["description"]))
|
||||
if(isset($formdata["description"])) {
|
||||
$pl->setPLMetaData(UI_MDATA_KEY_DESCRIPTION, $formdata["description"]);
|
||||
}
|
||||
|
||||
$this->_helper->redirector('edit');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue