You are here

function yandex_metrics_reports_filter_form in Yandex.Metrics 8.3

Same name and namespace in other branches
  1. 6.2 yandex_metrics_reports/yandex_metrics_reports.module \yandex_metrics_reports_filter_form()
  2. 7.3 yandex_metrics_reports/yandex_metrics_reports.module \yandex_metrics_reports_filter_form()
  3. 7.2 yandex_metrics_reports/yandex_metrics_reports.module \yandex_metrics_reports_filter_form()

It is quick filter form for report page.

1 string reference to 'yandex_metrics_reports_filter_form'
yandex_metrics_reports_report in yandex_metrics_reports/yandex_metrics_reports.module
Menu callback; displays a Summary page containing reports and charts.

File

yandex_metrics_reports/yandex_metrics_reports.module, line 105
The main code of Yandex.Metrics Reports module.

Code

function yandex_metrics_reports_filter_form() {
  $form = array();
  $current_filter = arg(3) ? arg(3) : 'week';
  $options = array(
    'day' => t('Today'),
    'yesterday' => t('Yesterday'),
    'week' => t('Week'),
    'month' => t('Month'),
  );
  $form['filter'] = array(
    '#type' => 'select',
    '#title' => t('Quick filter'),
    '#default_value' => $current_filter,
    '#options' => $options,
    '#attributes' => array(
      'onchange' => 'this.form.submit();',
    ),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
    '#attributes' => array(
      'style' => 'display:none;',
    ),
  );
  return $form;
}