fix for file metadata form.
This commit is contained in:
parent
6b615b4e70
commit
860c70b21e
|
@ -134,12 +134,10 @@ class LibraryController extends Zend_Controller_Action
|
|||
public function editFileMdAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$form = new Application_Form_EditAudioMD();
|
||||
|
||||
$file_id = $this->_getParam('id', null);
|
||||
$form = new Application_Form_EditAudioMD();
|
||||
|
||||
$file_id = $this->_getParam('id', null);
|
||||
$file = StoredFile::Recall($file_id);
|
||||
$form->populate($file->md);
|
||||
|
||||
if ($request->isPost()) {
|
||||
if ($form->isValid($request->getPost())) {
|
||||
|
@ -150,7 +148,8 @@ class LibraryController extends Zend_Controller_Action
|
|||
$this->_helper->redirector('index');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$form->populate($file->md);
|
||||
$this->view->form = $form;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
$this->setMethod('post');
|
||||
|
||||
// Add title field
|
||||
$this->addElement('text', 'dc:title', array(
|
||||
$this->addElement('text', 'track_title', array(
|
||||
'label' => 'Title:',
|
||||
'required' => true,
|
||||
'class' => 'input_text',
|
||||
|
@ -20,7 +20,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
));
|
||||
|
||||
// Add artist field
|
||||
$this->addElement('text', 'dc:creator', array(
|
||||
$this->addElement('text', 'artist_name', array(
|
||||
'label' => 'Artist:',
|
||||
'required' => true,
|
||||
'class' => 'input_text',
|
||||
|
@ -31,7 +31,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
));
|
||||
|
||||
// Add album field
|
||||
$this->addElement('text', 'dc:source', array(
|
||||
$this->addElement('text', 'album_title', array(
|
||||
'label' => 'Album:',
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim')
|
||||
|
@ -45,7 +45,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
));
|
||||
|
||||
// Add year field
|
||||
$this->addElement('text', 'ls:year', array(
|
||||
$this->addElement('text', 'year', array(
|
||||
'label' => 'Year:',
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim'),
|
||||
|
@ -57,28 +57,28 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
));
|
||||
|
||||
// Add label field
|
||||
$this->addElement('text', 'dc:publisher', array(
|
||||
$this->addElement('text', 'label', array(
|
||||
'label' => 'Label:',
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim')
|
||||
));
|
||||
|
||||
// Add composer field
|
||||
$this->addElement('text', 'ls:composer', array(
|
||||
$this->addElement('text', 'composer', array(
|
||||
'label' => 'Composer:',
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim')
|
||||
));
|
||||
|
||||
// Add mood field
|
||||
$this->addElement('text', 'ls:mood', array(
|
||||
$this->addElement('text', 'mood', array(
|
||||
'label' => 'Mood:',
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim')
|
||||
));
|
||||
|
||||
// Add language field
|
||||
$this->addElement('text', 'dc:language', array(
|
||||
$this->addElement('text', 'language', array(
|
||||
'label' => 'Language:',
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim')
|
||||
|
|
|
@ -512,8 +512,8 @@ class StoredFile {
|
|||
}
|
||||
}
|
||||
|
||||
//$this->md = array_merge($this->md, $compatibilityData);
|
||||
$this->md = $compatibilityData;
|
||||
$this->md = array_merge($this->md, $compatibilityData);
|
||||
//$this->md = $compatibilityData;
|
||||
}
|
||||
|
||||
public function setFormat($p_value)
|
||||
|
|
Loading…
Reference in New Issue