CC-4735: Library: Edit metadata selection should be a popup instead of going to a new page
-done
This commit is contained in:
parent
1846f17bbc
commit
062740ef81
4 changed files with 60 additions and 7 deletions
|
@ -18,6 +18,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
->addActionContext('upload-file-soundcloud', 'json')
|
||||
->addActionContext('get-upload-to-soundcloud-status', 'json')
|
||||
->addActionContext('set-num-entries', 'json')
|
||||
->addActionContext('edit-file-md', 'json')
|
||||
->initContext();
|
||||
}
|
||||
|
||||
|
@ -382,14 +383,19 @@ class LibraryController extends Zend_Controller_Action
|
|||
if (!$isAdminOrPM && $file->getFileOwnerId() != $user->getId()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$form = new Application_Form_EditAudioMD();
|
||||
$form->startForm($file_id);
|
||||
$form->populate($file->getDbColMetadata());
|
||||
|
||||
if ($request->isPost()) {
|
||||
if ($form->isValid($request->getPost())) {
|
||||
|
||||
$formdata = $form->getValues();
|
||||
$formValues = $this->_getParam('data', null);
|
||||
$formdata = array();
|
||||
foreach ($formValues as $val) {
|
||||
$formdata[$val["name"]] = $val["value"];
|
||||
}
|
||||
$file->setDbColMetadata($formdata);
|
||||
|
||||
$data = $file->getMetadata();
|
||||
|
@ -404,6 +410,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
$this->view->form = $form;
|
||||
$this->view->dialog = $this->view->render('library/edit-file-md.phtml');
|
||||
}
|
||||
|
||||
public function getFileMetadataAction()
|
||||
|
|
|
@ -2,12 +2,18 @@
|
|||
|
||||
class Application_Form_EditAudioMD extends Zend_Form
|
||||
{
|
||||
public function init()
|
||||
|
||||
public function init() {}
|
||||
|
||||
public function startForm($p_id)
|
||||
{
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
// Set the method for the display form to POST
|
||||
$this->setMethod('post');
|
||||
|
||||
$this->addElement('hidden', 'file_id', array(
|
||||
'value' => $p_id
|
||||
));
|
||||
// Add title field
|
||||
$this->addElement('text', 'track_title', array(
|
||||
'label' => _('Title:'),
|
||||
|
@ -122,7 +128,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
));
|
||||
|
||||
// Add the submit button
|
||||
$this->addElement('submit', 'submit', array(
|
||||
$this->addElement('button', 'editmdsave', array(
|
||||
'ignore' => true,
|
||||
'class' => 'btn',
|
||||
'label' => _('Save'),
|
||||
|
@ -142,7 +148,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
)
|
||||
));
|
||||
|
||||
$this->addDisplayGroup(array('submit', 'cancel'), 'submitButtons', array(
|
||||
$this->addDisplayGroup(array('editmdsave', 'cancel'), 'submitButtons', array(
|
||||
'decorators' => array(
|
||||
'FormElements',
|
||||
'DtDdWrapper'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong">
|
||||
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong" id="edit-md-dialog">
|
||||
<h2><? echo _("Edit Metadata") ?></h2>
|
||||
|
||||
<?php //$this->form->setAction($this->url());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue