コード例 #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_courseclassselect($uniqueid, $alias, $name, $label, $advanced, $field, $options = array())
 {
     global $USER;
     $options['numeric'] = true;
     $this->_default = '0';
     $choices_array = array('0' => get_string('selectaclass', 'block_curr_admin'));
     $contexts = get_contexts_by_capability_for_user('class', 'block/php_report:view', $USER->id);
     if ($records = cmclass_get_listing('crsname', 'ASC', 0, 0, '', '', 0, false, $contexts)) {
         foreach ($records as $record) {
             $choices_array[$record->id] = $record->idnumber;
         }
     }
     $options['choices'] = $choices_array;
     parent::generalized_filter_dependentselect($uniqueid, $alias, $name, $label, $advanced, $field, $options);
 }
コード例 #2
0
ファイル: courseclassselect.php プロジェクト: jamesmcq/elis
 /**
  * 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_courseclassselect($uniqueid, $alias, $name, $label, $advanced, $field, $options = array())
 {
     global $USER;
     $options['numeric'] = true;
     $options['default'] = '0';
     $choices_array = array('0' => get_string('selectaclass', 'local_elisprogram'));
     $contexts = get_contexts_by_capability_for_user('class', 'local/elisreports:view', $USER->id);
     $records = pmclass_get_listing('idnumber', 'ASC', 0, 0, '', '', 0, false, $contexts);
     foreach ($records as $record) {
         $choices_array[$record->id] = $record->idnumber;
     }
     unset($records);
     $options['choices'] = $choices_array;
     parent::generalized_filter_dependentselect($uniqueid, $alias, $name, $label, $advanced, $field, $options);
 }