Merge branch '2.4.x' of dev.sourcefabric.org:airtime into 2.4.x

This commit is contained in:
drigato 2013-06-20 15:22:00 -04:00
commit c2e9f90eb9

View file

@ -5,7 +5,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
private $stringCriteriaOptions; private $stringCriteriaOptions;
private $numericCriteriaOptions; private $numericCriteriaOptions;
private $limitOptions; private $limitOptions;
/* We need to know if the criteria value will be a string /* We need to know if the criteria value will be a string
* or numeric value in order to populate the modifier * or numeric value in order to populate the modifier
* select list * select list
@ -40,7 +40,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
"info_url" => "s", "info_url" => "s",
"year" => "n" "year" => "n"
); );
private function getCriteriaOptions($option = null) private function getCriteriaOptions($option = null)
{ {
if (!isset($this->criteriaOptions)) { if (!isset($this->criteriaOptions)) {
@ -75,7 +75,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
"year" => _("Year") "year" => _("Year")
); );
} }
if (is_null($option)) return $this->criteriaOptions; if (is_null($option)) return $this->criteriaOptions;
else return $this->criteriaOptions[$option]; else return $this->criteriaOptions[$option];
} }
@ -122,7 +122,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
} }
return $this->limitOptions; return $this->limitOptions;
} }
public function init() public function init()
{ {
@ -259,7 +259,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$repeatTracks->setChecked($storedCrit["repeat_tracks"]["value"] == 1?true:false); $repeatTracks->setChecked($storedCrit["repeat_tracks"]["value"] == 1?true:false);
} }
$this->addElement($repeatTracks); $this->addElement($repeatTracks);
$limit = new Zend_Form_Element_Select('sp_limit_options'); $limit = new Zend_Form_Element_Select('sp_limit_options');
$limit->setAttrib('class', 'sp_input_select') $limit->setAttrib('class', 'sp_input_select')
->setDecorators(array('viewHelper')) ->setDecorators(array('viewHelper'))
@ -268,7 +268,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$limit->setValue($storedCrit["limit"]["modifier"]); $limit->setValue($storedCrit["limit"]["modifier"]);
} }
$this->addElement($limit); $this->addElement($limit);
$limitValue = new Zend_Form_Element_Text('sp_limit_value'); $limitValue = new Zend_Form_Element_Text('sp_limit_value');
$limitValue->setAttrib('class', 'sp_input_text_limit') $limitValue->setAttrib('class', 'sp_input_text_limit')
->setLabel(_('Limit to')) ->setLabel(_('Limit to'))
@ -541,7 +541,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$isValid = false; $isValid = false;
} }
// length check // length check
if (intval($d['sp_criteria_value']) >= pow(2,31)) { if ($d['sp_criteria_value'] >= pow(2,31)) {
$element->addError(_("The value should be less then 2147483648")); $element->addError(_("The value should be less then 2147483648"));
$isValid = false; $isValid = false;
} }