Adding select instead of input + fixing a PHP warning

skala
Julio Montoya 13 years ago
parent f2446be4e1
commit 45e296539e
  1. 2
      main/inc/lib/formvalidator/Rule/CompareFields.php
  2. 3
      main/inc/lib/grade_model.lib.php

@ -12,7 +12,7 @@ class HTML_QuickForm_Compare_Fields extends HTML_QuickForm_Rule_Compare
* @param string the value to compare
* @return boolean True if date is valid
*/
function validate($values, $operator_and_max_value) {
function validate($values, $operator_and_max_value = null) {
if (is_array($values) && !empty($values) && !empty($operator_and_max_value)) {
$final_value = 0;
foreach ($values as $value) {

@ -108,7 +108,8 @@ class GradeModel extends Model {
$form->addElement('text', 'components['.$i.'][prefix]', null, array('class' => 'span2'));
$form->addElement('text', 'components['.$i.'][exclusions]', null, array('class' => 'span2'));
$form->addElement('text', 'components['.$i.'][count_elements]', null, array('class' => 'span2'));
$options = array(0=>0, 1 => 1, 2 => 2, 3=>3, 4=> 4, 5=> 5);
$form->addElement('select', 'components['.$i.'][count_elements]', null, $options);
$form->addElement('text', 'components['.$i.'][title]', null, array('class' => 'span2'));

Loading…
Cancel
Save