CC-1916 playlist metadata page looks better.
This commit is contained in:
parent
f8d3a38b2e
commit
89267748d4
6 changed files with 107 additions and 39 deletions
|
@ -93,7 +93,8 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
$this->changePlaylist($pl_id);
|
||||
$form = new Application_Form_PlaylistMetadata();
|
||||
$this->view->form = $form->__toString();
|
||||
$this->view->fieldset = $form;
|
||||
$this->view->form = $this->view->render('playlist/new.phtml');
|
||||
}
|
||||
|
||||
public function metadataAction()
|
||||
|
@ -115,26 +116,25 @@ class PlaylistController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
if ($request->isPost()) {
|
||||
if ($form->isValid($request->getPost())) {
|
||||
|
||||
$formdata = $form->getValues();
|
||||
$title = $this->_getParam('title', null);
|
||||
$description = $this->_getParam('description', null);
|
||||
|
||||
$pl = $this->getPlaylist();
|
||||
|
||||
if($formdata["title"])
|
||||
$pl->setName($formdata["title"]);
|
||||
|
||||
if(isset($formdata["description"])) {
|
||||
$pl->setPLMetaData(UI_MDATA_KEY_DESCRIPTION, $formdata["description"]);
|
||||
}
|
||||
$pl = $this->getPlaylist();
|
||||
|
||||
if($title)
|
||||
$pl->setName($title);
|
||||
|
||||
if(isset($description)) {
|
||||
$pl->setPLMetaData(UI_MDATA_KEY_DESCRIPTION, $description);
|
||||
}
|
||||
|
||||
$this->view->pl = $pl;
|
||||
$this->view->html = $this->view->render('playlist/index.phtml');
|
||||
unset($this->view->pl);
|
||||
}
|
||||
$this->view->pl = $pl;
|
||||
$this->view->html = $this->view->render('playlist/index.phtml');
|
||||
unset($this->view->pl);
|
||||
}
|
||||
|
||||
$this->view->form = $form->__toString();
|
||||
$this->view->fieldset = $form;
|
||||
$this->view->form = $this->view->render('playlist/new.phtml');
|
||||
}
|
||||
|
||||
public function editAction()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
class Application_Form_PlaylistMetadata extends Zend_Form
|
||||
class Application_Form_PlaylistMetadata extends Zend_Form_SubForm
|
||||
{
|
||||
|
||||
public function init()
|
||||
|
@ -8,6 +8,7 @@ class Application_Form_PlaylistMetadata extends Zend_Form
|
|||
// Add username element
|
||||
$this->addElement('text', 'title', array(
|
||||
'label' => 'Title:',
|
||||
'class' => 'input_text',
|
||||
'required' => false,
|
||||
'filters' => array('StringTrim'),
|
||||
'validators' => array(
|
||||
|
@ -18,10 +19,15 @@ class Application_Form_PlaylistMetadata extends Zend_Form
|
|||
// Add the comment element
|
||||
$this->addElement('textarea', 'description', array(
|
||||
'label' => 'Description:',
|
||||
'class' => 'input_text_area',
|
||||
'required' => false,
|
||||
));
|
||||
|
||||
// Add the comment element
|
||||
$this->addElement('button', 'new_playlist_submit', array(
|
||||
'label' => 'Submit',
|
||||
'ignore' => true
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
<?php echo $this->form; ?>
|
||||
<form method="post" action="" enctype="application/x-www-form-urlencoded">
|
||||
<?php echo $this->view->fieldset; ?>
|
||||
</form>
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
<br /><br /><center>View script for controller <b>Playlist</b> and script/action name <b>new</b></center>
|
||||
<h3 class="plain">Playlist Metadata</h3>
|
||||
<form method="post" action="" enctype="application/x-www-form-urlencoded">
|
||||
<?php echo $this->fieldset; ?>
|
||||
</form>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue