2010-12-07 20:19:27 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Application_Form_EditAudioMD extends Zend_Form
|
|
|
|
{
|
|
|
|
public function init()
|
|
|
|
{
|
2012-10-19 20:42:01 +02:00
|
|
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
2010-12-30 23:26:44 +01:00
|
|
|
// Set the method for the display form to POST
|
|
|
|
$this->setMethod('post');
|
|
|
|
|
2012-07-11 00:55:44 +02:00
|
|
|
// Add title field
|
2011-02-24 17:06:19 +01:00
|
|
|
$this->addElement('text', 'track_title', array(
|
2010-12-30 23:26:44 +01:00
|
|
|
'label' => 'Title:',
|
2011-02-12 20:44:55 +01:00
|
|
|
'class' => 'input_text',
|
2010-12-30 23:26:44 +01:00
|
|
|
'filters' => array('StringTrim'),
|
|
|
|
));
|
|
|
|
|
2012-07-11 00:55:44 +02:00
|
|
|
// Add artist field
|
2011-02-24 17:06:19 +01:00
|
|
|
$this->addElement('text', 'artist_name', array(
|
2012-02-08 20:15:15 +01:00
|
|
|
'label' => 'Creator:',
|
2011-02-12 20:44:55 +01:00
|
|
|
'class' => 'input_text',
|
2010-12-30 23:26:44 +01:00
|
|
|
'filters' => array('StringTrim'),
|
|
|
|
));
|
|
|
|
|
2012-07-11 00:55:44 +02:00
|
|
|
// Add album field
|
2011-02-24 17:06:19 +01:00
|
|
|
$this->addElement('text', 'album_title', array(
|
2010-12-30 23:26:44 +01:00
|
|
|
'label' => 'Album:',
|
2011-02-12 20:44:55 +01:00
|
|
|
'class' => 'input_text',
|
2010-12-30 23:26:44 +01:00
|
|
|
'filters' => array('StringTrim')
|
|
|
|
));
|
|
|
|
|
2011-05-26 17:11:12 +02:00
|
|
|
// Add track number field
|
2011-05-05 16:55:14 +02:00
|
|
|
$this->addElement('text', 'track_number', array(
|
|
|
|
'label' => 'Track:',
|
|
|
|
'class' => 'input_text',
|
2012-10-16 21:29:05 +02:00
|
|
|
'filters' => array('StringTrim')
|
2011-05-05 16:55:14 +02:00
|
|
|
));
|
|
|
|
|
2012-07-11 00:55:44 +02:00
|
|
|
// Add genre field
|
2010-12-30 23:26:44 +01:00
|
|
|
$this->addElement('text', 'genre', array(
|
|
|
|
'label' => 'Genre:',
|
2011-02-12 20:44:55 +01:00
|
|
|
'class' => 'input_text',
|
2010-12-30 23:26:44 +01:00
|
|
|
'filters' => array('StringTrim')
|
|
|
|
));
|
|
|
|
|
2012-07-11 00:55:44 +02:00
|
|
|
// Add year field
|
2011-02-24 17:06:19 +01:00
|
|
|
$this->addElement('text', 'year', array(
|
2010-12-30 23:26:44 +01:00
|
|
|
'label' => 'Year:',
|
2011-02-12 20:44:55 +01:00
|
|
|
'class' => 'input_text',
|
2010-12-30 23:26:44 +01:00
|
|
|
'filters' => array('StringTrim'),
|
|
|
|
'validators' => array(
|
2012-07-11 00:55:44 +02:00
|
|
|
array('date', false, array('YYYY-MM-DD')),
|
2011-02-12 20:44:55 +01:00
|
|
|
array('date', false, array('YYYY-MM')),
|
2012-07-11 00:55:44 +02:00
|
|
|
array('date', false, array('YYYY'))
|
|
|
|
)
|
2010-12-30 23:26:44 +01:00
|
|
|
));
|
|
|
|
|
2012-07-11 00:55:44 +02:00
|
|
|
// Add label field
|
2011-02-24 17:06:19 +01:00
|
|
|
$this->addElement('text', 'label', array(
|
2010-12-30 23:26:44 +01:00
|
|
|
'label' => 'Label:',
|
2011-02-12 20:44:55 +01:00
|
|
|
'class' => 'input_text',
|
2010-12-30 23:26:44 +01:00
|
|
|
'filters' => array('StringTrim')
|
|
|
|
));
|
|
|
|
|
2012-07-11 00:55:44 +02:00
|
|
|
// Add composer field
|
2011-02-24 17:06:19 +01:00
|
|
|
$this->addElement('text', 'composer', array(
|
2010-12-30 23:26:44 +01:00
|
|
|
'label' => 'Composer:',
|
2011-02-12 20:44:55 +01:00
|
|
|
'class' => 'input_text',
|
2010-12-30 23:26:44 +01:00
|
|
|
'filters' => array('StringTrim')
|
|
|
|
));
|
2012-07-11 00:55:44 +02:00
|
|
|
|
2012-04-04 00:09:03 +02:00
|
|
|
// Add conductor field
|
|
|
|
$this->addElement('text', 'conductor', array(
|
|
|
|
'label' => 'Conductor:',
|
|
|
|
'class' => 'input_text',
|
|
|
|
'filters' => array('StringTrim')
|
|
|
|
));
|
2010-12-30 23:26:44 +01:00
|
|
|
|
2012-07-11 00:55:44 +02:00
|
|
|
// Add mood field
|
2011-02-24 17:06:19 +01:00
|
|
|
$this->addElement('text', 'mood', array(
|
2010-12-30 23:26:44 +01:00
|
|
|
'label' => 'Mood:',
|
2011-02-12 20:44:55 +01:00
|
|
|
'class' => 'input_text',
|
2010-12-30 23:26:44 +01:00
|
|
|
'filters' => array('StringTrim')
|
|
|
|
));
|
|
|
|
|
2011-08-03 18:32:59 +02:00
|
|
|
// Add bmp field
|
2012-04-11 20:09:51 +02:00
|
|
|
$bpm = new Zend_Form_Element_Text('bpm');
|
|
|
|
$bpm->class = 'input_text';
|
|
|
|
$bpm->setLabel('BPM:')
|
|
|
|
->setFilters(array('StringTrim'))
|
|
|
|
->setValidators(array(
|
|
|
|
new Zend_Validate_StringLength(array('min'=>0,'max' => 8)),
|
|
|
|
new Zend_Validate_Digits()));
|
|
|
|
$this->addElement($bpm);
|
2011-05-05 16:55:14 +02:00
|
|
|
|
2011-08-03 18:32:59 +02:00
|
|
|
// Add copyright field
|
2011-05-05 16:55:14 +02:00
|
|
|
$this->addElement('text', 'copyright', array(
|
|
|
|
'label' => 'Copyright:',
|
|
|
|
'class' => 'input_text',
|
|
|
|
'filters' => array('StringTrim')
|
|
|
|
));
|
|
|
|
|
2011-08-03 18:32:59 +02:00
|
|
|
// Add isrc number field
|
2011-05-05 16:55:14 +02:00
|
|
|
$this->addElement('text', 'isrc_number', array(
|
|
|
|
'label' => 'ISRC Number:',
|
|
|
|
'class' => 'input_text',
|
|
|
|
'filters' => array('StringTrim')
|
|
|
|
));
|
|
|
|
|
2011-08-03 18:32:59 +02:00
|
|
|
// Add website field
|
2011-05-05 16:55:14 +02:00
|
|
|
$this->addElement('text', 'info_url', array(
|
|
|
|
'label' => 'Website:',
|
2011-02-12 20:44:55 +01:00
|
|
|
'class' => 'input_text',
|
2011-08-03 18:32:59 +02:00
|
|
|
'filters' => array('StringTrim')
|
|
|
|
));
|
|
|
|
|
|
|
|
// Add language field
|
|
|
|
$this->addElement('text', 'language', array(
|
|
|
|
'label' => 'Language:',
|
|
|
|
'class' => 'input_text',
|
2010-12-30 23:26:44 +01:00
|
|
|
'filters' => array('StringTrim')
|
|
|
|
));
|
|
|
|
|
2012-07-11 00:55:44 +02:00
|
|
|
// Add the submit button
|
2010-12-30 23:26:44 +01:00
|
|
|
$this->addElement('submit', 'submit', array(
|
|
|
|
'ignore' => true,
|
2012-10-03 17:40:40 +02:00
|
|
|
'class' => 'btn',
|
2011-11-09 22:03:32 +01:00
|
|
|
'label' => 'Save',
|
2011-05-26 17:11:12 +02:00
|
|
|
'decorators' => array(
|
2011-03-31 04:18:05 +02:00
|
|
|
'ViewHelper'
|
2011-05-26 17:11:12 +02:00
|
|
|
)
|
2010-12-30 23:26:44 +01:00
|
|
|
));
|
2011-03-31 04:18:05 +02:00
|
|
|
|
2012-07-11 00:55:44 +02:00
|
|
|
// Add the submit button
|
2011-03-31 04:18:05 +02:00
|
|
|
$this->addElement('button', 'cancel', array(
|
|
|
|
'ignore' => true,
|
2012-10-03 17:40:40 +02:00
|
|
|
'class' => 'btn md-cancel',
|
2011-03-31 04:18:05 +02:00
|
|
|
'label' => 'Cancel',
|
2012-10-19 20:42:01 +02:00
|
|
|
'onclick' => 'javascript:document.location.href="'.$baseUrl.'/Library"',
|
2011-05-26 17:11:12 +02:00
|
|
|
'decorators' => array(
|
2011-03-31 04:18:05 +02:00
|
|
|
'ViewHelper'
|
|
|
|
)
|
|
|
|
));
|
|
|
|
|
2011-05-26 17:11:12 +02:00
|
|
|
$this->addDisplayGroup(array('submit', 'cancel'), 'submitButtons', array(
|
|
|
|
'decorators' => array(
|
2011-04-02 19:48:20 +02:00
|
|
|
'FormElements',
|
|
|
|
'DtDdWrapper'
|
|
|
|
)
|
|
|
|
));
|
2010-12-07 20:19:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|