2010-12-07 20:19:27 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Application_Form_EditAudioMD extends Zend_Form
|
|
|
|
{
|
|
|
|
public function init()
|
|
|
|
{
|
2010-12-30 23:26:44 +01:00
|
|
|
// Set the method for the display form to POST
|
|
|
|
$this->setMethod('post');
|
|
|
|
|
|
|
|
// 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'),
|
|
|
|
));
|
|
|
|
|
|
|
|
// 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'),
|
|
|
|
));
|
|
|
|
|
|
|
|
// 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',
|
2011-05-26 17:11:12 +02:00
|
|
|
'filters' => array('StringTrim'),
|
|
|
|
'validators' => array('Int')
|
2011-05-05 16:55:14 +02:00
|
|
|
));
|
|
|
|
|
2010-12-30 23:26:44 +01:00
|
|
|
// Add genre field
|
|
|
|
$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')
|
|
|
|
));
|
|
|
|
|
|
|
|
// 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(
|
|
|
|
array('date', false, array('YYYY-MM-DD')),
|
2011-02-12 20:44:55 +01:00
|
|
|
array('date', false, array('YYYY-MM')),
|
2010-12-30 23:26:44 +01:00
|
|
|
array('date', false, array('YYYY'))
|
2011-05-26 17:11:12 +02:00
|
|
|
)
|
2010-12-30 23:26:44 +01: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')
|
|
|
|
));
|
|
|
|
|
|
|
|
// 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-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
|
|
|
|
|
|
|
// 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
|
2011-05-05 16:55:14 +02:00
|
|
|
$this->addElement('text', 'bpm', array(
|
|
|
|
'label' => 'BPM:',
|
|
|
|
'class' => 'input_text',
|
2012-04-09 16:50:32 +02:00
|
|
|
'filters' => array('StringTrim'),
|
|
|
|
'validators' => array(array('StringLength', false, array(0, 8)))
|
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')
|
|
|
|
));
|
|
|
|
|
|
|
|
// Add the submit button
|
|
|
|
$this->addElement('submit', 'submit', array(
|
|
|
|
'ignore' => true,
|
2011-02-12 20:44:55 +01:00
|
|
|
'class' => 'ui-button ui-state-default',
|
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
|
|
|
|
|
|
|
// Add the submit button
|
|
|
|
$this->addElement('button', 'cancel', array(
|
|
|
|
'ignore' => true,
|
2011-04-04 19:55:39 +02:00
|
|
|
'class' => 'ui-button ui-state-default ui-button-text-only md-cancel',
|
2011-03-31 04:18:05 +02:00
|
|
|
'label' => 'Cancel',
|
2012-04-05 10:56:06 +02:00
|
|
|
'onclick' => 'javascript:document.location = document.referrer',
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|