/** * Constructor * @param string $name the name of the filter instance * @param string $label the label of the filter instance * @param boolean $advanced advanced form element flag * @param string $field user table filed name * @param array $options select options */ function generalized_filter_selectany($uniqueid, $alias, $name, $label, $advanced, $field, $options = array()) { $new_options = $options; $new_options['choices'] = array(); if (empty($options['noany'])) { $new_options['choices'][0] = empty($options['anyvalue']) ? get_string('report_filter_all', 'local_eliscore') : $options['anyvalue']; $new_options['noany'] = true; } if (!empty($options['choices'])) { $new_options['choices'] += $options['choices']; } parent::__construct($uniqueid, $alias, $name, $label, $advanced, $field, $new_options); }
/** * Constructor * @param string $name the name of the filter instance * @param string $label the label of the filter instance * @param boolean $advanced advanced form element flag * @param string $field user table filed name * @param array $options select options */ function generalized_filter_selectany($uniqueid, $alias, $name, $label, $advanced, $field, $options = array()) { $new_options = array(); if (!empty($options)) { foreach ($options as $id => $value) { $new_options[$id] = $value; } } if (empty($new_options['choices'])) { $new_options['choices'] = array(0 => get_string('report_filter_all', 'block_curr_admin')); } else { $new_options['choices'] = array(0 => get_string('report_filter_all', 'block_curr_admin')) + $options['choices']; } parent::__construct($uniqueid, $alias, $name, $label, $advanced, $field, $new_options); }