You are here

function opigno_statistics_app_group_filter_form in Opigno Statistics App 7

Implements hook_form().

2 string references to 'opigno_statistics_app_group_filter_form'
class.tpl.php in templates/group/class/class.tpl.php
course template file
course.tpl.php in templates/group/course/course.tpl.php
course template file

File

includes/group/filter_form.inc, line 6

Code

function opigno_statistics_app_group_filter_form(array $form, array &$form_state) {
  $form['#attributes'] = array(
    'class' => 'clearfix',
  );
  $years = range(opigno_statistics_app_install_year(), opigno_statistics_app_current_year());
  $default = variable_get('opigno_statistics_app_group_filter_form_values');
  $form['year'] = array(
    '#title' => t('Year'),
    '#type' => 'select',
    '#options' => array_combine($years, $years),
    '#ajax' => array(
      'callback' => 'opigno_statistics_app_group_filter_form_ajax_submit',
      'wrapper' => 'opigno-statistics-app-group',
      'method' => 'append',
    ),
    '#default_value' => $default[request_uri()]['year'],
  );
  $months = date_month_names();
  $form['month'] = array(
    '#title' => t('Month'),
    '#type' => 'select',
    '#options' => $months,
    '#ajax' => array(
      'callback' => 'opigno_statistics_app_group_filter_form_ajax_submit',
      'wrapper' => 'opigno-statistics-app-group',
      'method' => 'append',
    ),
    '#default_value' => $default[request_uri()]['month'],
  );
  return $form;
}