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