can edit playlist metadata
This commit is contained in:
parent
41c76e2c7d
commit
2a37140c4d
2 changed files with 21 additions and 4 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue