Esempio n. 1
0
 /**
  * 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_userprofileselect($uniqueid, $alias, $name, $label, $advanced, $field, $options = array())
 {
     parent::generalized_filter_simpleselect($uniqueid, $alias, $name, $label, $advanced, $field, $options);
     $this->_tables = $options['tables'];
     $this->_fieldid = $options['fieldid'];
     //print_object($this);
 }
Esempio n. 2
0
 /**
  * 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_exists_select($uniqueid, $alias, $name, $label, $advanced, $field, $options = array())
 {
     parent::generalized_filter_simpleselect($uniqueid, $alias, $name, $label, $advanced, $field, $options);
     foreach ($this->_fields as $property => $field) {
         if (array_key_exists($field, $options)) {
             $this->{$property} = $options[$field];
         }
     }
 }
 /**
  * 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_custom_field_select($uniqueid, $alias, $name, $label, $advanced, $field, $options = array())
 {
     parent::generalized_filter_simpleselect($uniqueid, $alias, $name, $label, $advanced, $field, $options);
     if (!array_key_exists('datatype', $options)) {
         print_error('missing_datatype', 'elis_core');
     }
     if (!array_key_exists($options['datatype'], $this->_fieldtypes)) {
         print_error('unknown_datatype', 'elis_core');
     }
     if (array_key_exists('wrapper', $options)) {
         $this->_wrapper = $options['wrapper'];
     }
     if (array_key_exists('innerfield', $options)) {
         $this->_innerfield = $options['innerfield'];
     }
     $this->_datatype = $options['datatype'];
     $this->_fieldid = $options['fieldid'];
     //set up a "prefix" for the subquery, typically involving IN or EXISTS
     if (!empty($options['subqueryprefix'])) {
         //manually specified via constructor
         $this->_subqueryprefix = $options['subqueryprefix'];
     } else {
         //default to "fieldname IN ..."
         $full_fieldname = $this->get_full_fieldname();
         $this->_subqueryprefix = "{$full_fieldname} IN";
     }
     //allow for specification of extra conditions to impose on the IN/ EXISTS subquery
     $this->_extraconditions = '';
     if (!empty($options['extraconditions'])) {
         $this->_extraconditions = $options['extraconditions'];
     }
     if (!empty($options['contextlevel'])) {
         //store the context level if it's specified
         $this->_contextlevel = $options['contextlevel'];
     }
 }
Esempio n. 4
0
 /**
  * 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_custom_field_select($uniqueid, $alias, $name, $label, $advanced, $field, $options = array())
 {
     //ob_start();
     //var_dump($options);
     //$tmp = ob_get_contents();
     //ob_end_clean();
     //error_log("generalized_filter_custom_field_select($uniqueid, $alias, $name, $label, $advanced, $field, options = {$tmp}");
     parent::generalized_filter_simpleselect($uniqueid, $alias, $name, $label, $advanced, $field, $options);
     if (!array_key_exists('datatype', $options)) {
         print_error('missing_datatype', 'local_eliscore');
     }
     if (!array_key_exists($options['datatype'], $this->_fieldtypes)) {
         print_error('unknown_datatype', 'local_eliscore');
     }
     if (array_key_exists('wrapper', $options)) {
         $this->_wrapper = $options['wrapper'];
     }
     if (array_key_exists('innerfield', $options)) {
         $this->_innerfield = $options['innerfield'];
     }
     $this->_datatype = $options['datatype'];
     $this->_fieldid = $options['fieldid'];
     //set up a "prefix" for the subquery, typically involving IN or EXISTS
     if (!empty($options['subqueryprefix'])) {
         //manually specified via constructor
         $this->_subqueryprefix = $options['subqueryprefix'];
     } else {
         $this->_subqueryprefix = "{$alias}.id IN ";
     }
     //allow for specification of extra conditions to impose on the IN/ EXISTS subquery
     $this->_extraconditions = '';
     if (!empty($options['extraconditions'])) {
         $this->_extraconditions = $options['extraconditions'];
     }
     if (!empty($options['contextlevel'])) {
         //store the context level if it's specified
         $this->_contextlevel = $options['contextlevel'];
     }
 }
Esempio n. 5
0
 /**
  * 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
  */
 function generalized_filter_yesno($uniqueid, $alias, $name, $label, $advanced, $field, $options = array())
 {
     $options['choices'] = array(0 => get_string('no'), 1 => get_string('yes'));
     parent::generalized_filter_simpleselect($uniqueid, $alias, $name, $label, $advanced, $field, $options);
 }