CC-84: Smart Playlists
-disabled non-visible form elements
This commit is contained in:
parent
5fb0364f2d
commit
7358b00c81
3 changed files with 18 additions and 6 deletions
|
@ -76,12 +76,15 @@ class Application_Form_SmartPlaylistCriteria extends Zend_Form_SubForm
|
|||
$this->addElement($spType);
|
||||
|
||||
$numElements = count($criteriaOptions);
|
||||
for($i = 1; $i <= $numElements; $i++) {
|
||||
for ($i = 1; $i <= $numElements; $i++) {
|
||||
$criteria = new Zend_Form_Element_Select('sp_criteria_'.$i);
|
||||
$criteria->setAttrib('class', 'input_select');
|
||||
$criteria->setValue(0);
|
||||
$criteria->setDecorators(array('viewHelper'));
|
||||
$criteria->setMultiOptions($criteriaOptions);
|
||||
if ($i != 1){
|
||||
$criteria->setAttrib('disabled', 'disabled');
|
||||
}
|
||||
$this->addElement($criteria);
|
||||
|
||||
$criteriaModifers = new Zend_Form_Element_Select('sp_criteria_modifier_'.$i);
|
||||
|
@ -89,11 +92,17 @@ class Application_Form_SmartPlaylistCriteria extends Zend_Form_SubForm
|
|||
$criteriaModifers->setAttrib('class', 'input_select');
|
||||
$criteriaModifers->setDecorators(array('viewHelper'));
|
||||
$criteriaModifers->setMultiOptions($stringCriteriaOptions);
|
||||
if ($i != 1){
|
||||
$criteriaModifers->setAttrib('disabled', 'disabled');
|
||||
}
|
||||
$this->addElement($criteriaModifers);
|
||||
|
||||
$criteriaValue = new Zend_Form_Element_Text('sp_criteria_value_'.$i);
|
||||
$criteriaValue->setAttrib('class', 'input_text');
|
||||
$criteriaValue->setDecorators(array('viewHelper'));
|
||||
if ($i != 1){
|
||||
$criteriaValue->setAttrib('disabled', 'disabled');
|
||||
}
|
||||
$this->addElement($criteriaValue);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,16 +17,17 @@
|
|||
</dd>
|
||||
|
||||
<dd id='sp_criteria-element'>
|
||||
<?php for($i = 1; $i <= $this->criteriasLength; $i++) {?>
|
||||
<div <?php if(($i > 1) && ($this->element->getElement('sp_criteria_'.$i)->getValue() == "0" &&
|
||||
$this->element->getElement('sp_criteria_modifier_'.$i)->getValue() == "0")) {
|
||||
<?php for ($i = 1; $i <= $this->criteriasLength; $i++) {?>
|
||||
<div <?php if (($i > 1) && ($this->element->getElement('sp_criteria_'.$i)->getAttrib('disabled') == 'disabled')) {
|
||||
echo 'style=display:none';
|
||||
} ?>>
|
||||
|
||||
<?php echo $this->element->getElement('sp_criteria_'.$i) ?>
|
||||
<?php echo $this->element->getElement('sp_criteria_modifier_'.$i) ?>
|
||||
<?php echo $this->element->getElement('sp_criteria_value_'.$i) ?>
|
||||
<a href='#' id='criteria_remove_<?php echo $i ?>'>Remove</a>
|
||||
<?php if ($i != 1) { ?>
|
||||
<a href='#' id='criteria_remove_<?php echo $i ?>'>Remove</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<a href='#' id='criteria_add'>Add</a>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue