2011-01-21 00:30:53 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Application_Form_AddShowStyle extends Zend_Form_SubForm
|
|
|
|
{
|
|
|
|
|
|
|
|
public function init()
|
|
|
|
{
|
|
|
|
// Add show background-color input
|
2011-01-21 19:25:12 +01:00
|
|
|
$this->addElement('text', 'add_show_background_color', array(
|
2011-01-21 00:30:53 +01:00
|
|
|
'label' => 'Background Colour:',
|
2011-01-28 23:37:31 +01:00
|
|
|
'class' => 'input_text',
|
2011-01-21 20:58:23 +01:00
|
|
|
'filters' => array('StringTrim')
|
2011-01-21 00:30:53 +01:00
|
|
|
));
|
|
|
|
|
2011-01-31 03:42:53 +01:00
|
|
|
$bg = $this->getElement('add_show_background_color');
|
|
|
|
|
|
|
|
$bg->setDecorators(array(array('ViewScript', array(
|
|
|
|
'viewScript' => 'form/add-show-style.phtml',
|
|
|
|
'class' => 'big'
|
|
|
|
))));
|
2012-05-07 14:48:33 +02:00
|
|
|
|
|
|
|
$bg->setValidators(array(
|
|
|
|
'Hex',
|
|
|
|
array('stringLength', false, array(6, 6))
|
|
|
|
));
|
|
|
|
|
2011-01-31 03:42:53 +01:00
|
|
|
|
2011-01-21 00:30:53 +01:00
|
|
|
// Add show color input
|
2011-01-21 19:25:12 +01:00
|
|
|
$this->addElement('text', 'add_show_color', array(
|
2011-04-04 19:50:51 +02:00
|
|
|
'label' => 'Text Colour:',
|
2011-01-28 23:37:31 +01:00
|
|
|
'class' => 'input_text',
|
2011-01-21 20:58:23 +01:00
|
|
|
'filters' => array('StringTrim')
|
2011-01-21 00:30:53 +01:00
|
|
|
));
|
2011-01-31 03:42:53 +01:00
|
|
|
|
|
|
|
$c = $this->getElement('add_show_color');
|
|
|
|
|
|
|
|
$c->setDecorators(array(array('ViewScript', array(
|
|
|
|
'viewScript' => 'form/add-show-style.phtml',
|
|
|
|
'class' => 'big'
|
|
|
|
))));
|
2012-05-07 14:48:33 +02:00
|
|
|
|
|
|
|
$c->setValidators(array(
|
|
|
|
'Hex',
|
|
|
|
array('stringLength', false, array(6, 6))
|
|
|
|
));
|
2011-01-21 00:30:53 +01:00
|
|
|
}
|
|
|
|
|
2012-03-30 21:11:24 +02:00
|
|
|
public function disable(){
|
|
|
|
$elements = $this->getElements();
|
|
|
|
foreach ($elements as $element)
|
|
|
|
{
|
|
|
|
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
|
|
|
{
|
2012-04-05 22:01:27 +02:00
|
|
|
$element->setAttrib('disabled','disabled');
|
2012-03-30 21:11:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-01-21 00:30:53 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|