CC-84: Smart Playlists

- subforms now open and close on the click event
- fixed add and remove criteria to work with new subforms
This commit is contained in:
denise 2012-07-23 12:42:00 -04:00
parent 952a584f10
commit 64185dac95
7 changed files with 73 additions and 37 deletions

View file

@ -2,6 +2,7 @@
class Application_Form_SmartPlaylistCriteriaSubForm extends Zend_Form_SubForm
{
private $setNumber;
private $openSubset;
public function init(){
@ -131,15 +132,20 @@ class Application_Form_SmartPlaylistCriteriaSubForm extends Zend_Form_SubForm
$extra = $crit->getDbExtra();
if($criteria == "limit"){
$storedCrit["limit"] = array("value"=>$value, "modifier"=>$modifier);
$storedCrit[]["limit"] = array("value"=>$value, "modifier"=>$modifier);
}else{
$storedCrit["crit"][] = array("criteria"=>$criteria, "value"=>$value, "modifier"=>$modifier, "extra"=>$extra);
$storedCrit[]["crit"][] = array("criteria"=>$criteria, "value"=>$value, "modifier"=>$modifier, "extra"=>$extra);
}
}
$openSmartPlaylistOption = false;
if (!empty($storedCrit)) {
$openSmartPlaylistOption = true;
$this->openSubset = $openSmartPlaylistOption;
}
if(!empty($subsetOpen)){
$openSmartPlaylistOption = true;
}
$numElements = count($criteriaOptions);
@ -232,4 +238,9 @@ class Application_Form_SmartPlaylistCriteriaSubForm extends Zend_Form_SubForm
'criteriasLength' => count($criteriaOptions), 'poolCount' => $files['count'], 'setNumber' => $this->setNumber))
));
}
public function getIsOpen()
{
return $this->openSubset;
}
}