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:',
|
|
|
|
'required' => true,
|
2011-02-12 20:44:55 +01:00
|
|
|
'class' => 'input_text',
|
2010-12-30 23:26:44 +01:00
|
|
|
'filters' => array('StringTrim'),
|
|
|
|
'validators' => array(
|
|
|
|
'NotEmpty',
|
|
|
|
)
|
|
|
|
));
|
|
|
|
|
|
|
|
// Add artist field
|
2011-02-24 17:06:19 +01:00
|
|
|
$this->addElement('text', 'artist_name', array(
|
2010-12-30 23:26:44 +01:00
|
|
|
'label' => 'Artist:',
|
|
|
|
'required' => true,
|
2011-02-12 20:44:55 +01:00
|
|
|
'class' => 'input_text',
|
2010-12-30 23:26:44 +01:00
|
|
|
'filters' => array('StringTrim'),
|
|
|
|
'validators' => array(
|
|
|
|
'NotEmpty',
|
|
|
|
)
|
|
|
|
));
|
|
|
|
|
|
|
|
// 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')
|
|
|
|
));
|
|
|
|
|
|
|
|
// 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'))
|
|
|
|
)
|
|
|
|
));
|
|
|
|
|
|
|
|
// 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')
|
|
|
|
));
|
|
|
|
|
|
|
|
// 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')
|
|
|
|
));
|
|
|
|
|
|
|
|
// Add language field
|
2011-02-24 17:06:19 +01:00
|
|
|
$this->addElement('text', 'language', array(
|
2010-12-30 23:26:44 +01:00
|
|
|
'label' => 'Language:',
|
2011-02-12 20:44:55 +01:00
|
|
|
'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',
|
2010-12-30 23:26:44 +01:00
|
|
|
'label' => 'Submit',
|
2011-03-31 04:18:05 +02:00
|
|
|
'decorators' => array(
|
|
|
|
'ViewHelper'
|
|
|
|
)
|
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,
|
|
|
|
'class' => 'ui-button ui-state-default',
|
|
|
|
'label' => 'Cancel',
|
|
|
|
'onclick' => 'javascript:document.location="/Library"',
|
|
|
|
'decorators' => array(
|
|
|
|
'ViewHelper'
|
|
|
|
)
|
|
|
|
));
|
|
|
|
|
|
|
|
$this->addDisplayGroup(array('submit', 'cancel'), 'submitButtons', array(
|
|
|
|
'decorators' => array(
|
|
|
|
'FormElements',
|
|
|
|
array('HtmlTag', array('tag' => 'dd', 'class' => 'element')),
|
|
|
|
),
|
|
|
|
));
|
2010-12-07 20:19:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|