You are here

function analytics_dashboard_admin_settings in Google Chart Tools 7

Provide admin settings form

1 string reference to 'analytics_dashboard_admin_settings'
analytics_dashboard_menu in analytics_dashboard/analytics_dashboard.module
Implements hook_menu().

File

analytics_dashboard/analytics_dashboard.admin.inc, line 10
Provides settings for analytices dashboard page.

Code

function analytics_dashboard_admin_settings($form, &$form_state) {
  $form = array();

  // Get available charts
  $options = array();
  $charts = analytics_dashboard_get_charts();
  foreach ($charts as $chart) {
    $options[$chart['id']] = $chart['title'];
  }

  // Generate default charts selection
  $default = variable_get('chart_visible', array());
  $form['display'] = array(
    '#type' => 'fieldset',
    '#title' => t('Display settings'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['display']['chart_visible'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Show analytics for the following site items'),
    '#default_value' => $default,
    '#options' => $options,
    '#description' => t('The checked charts will be shown on the analytics page.'),
  );
  return system_settings_form($form);
}