You are here

function forena_settings in Forena Reports 8

Same name and namespace in other branches
  1. 6.2 forena.admin.inc \forena_settings()
  2. 6 forena.admin.inc \forena_settings()
  3. 7.5 forena.admin.inc \forena_settings()
  4. 7 forena.admin.inc \forena_settings()
  5. 7.2 forena.admin.inc \forena_settings()
  6. 7.3 forena.admin.inc \forena_settings()
  7. 7.4 forena.admin.inc \forena_settings()

Forena admin settings form

File

forena_ui/forena.admin.inc, line 148

Code

function forena_settings() {
  $skins = Frx::File()
    ->skins();
  $report_path = forena_report_path();
  $form['forena_report_repos'] = array(
    '#type' => 'textfield',
    '#title' => t('Report Repository'),
    '#description' => t('Indicate the directory that you want to use for your reports.  In order for you to ' . 'to be able to save reports, this directory should be writable by the web user. Relative' . 'paths should be entered relative to the base path of your drupal installation.'),
    '#default_value' => $report_path,
  );
  $form['forena_last_report_path'] = array(
    '#type' => 'value',
    '#value' => \Drupal::config('forena.settings')
      ->get('forena_report_repos'),
  );
  if (\Drupal::moduleHandler()
    ->moduleExists('forena_query')) {
    $form['forena_query_data_path'] = array(
      '#type' => 'textfield',
      '#title' => t('Custom Data Block Repository'),
      '#description' => t('Indicate the directory that you want to use to save custom created data blocks using
            the forena query builder tool.  These will override any module delivered data blocks.  This needs to
            be a directory that is writable by the web user but should not be browsable by the web.  It defaults to
            '),
      '#default_value' => Frx::DataFile()->dir,
    );
    $form['forena_last_query_data_path'] = array(
      '#type' => 'value',
      '#value' => \Drupal::config('forena.settings')
        ->get('forena_query_data_path'),
    );
  }
  $form['forena_input_format'] = forena_filter_element(\Drupal::config('forena.settings')
    ->get('forena_input_format'), 'forena_input_format');
  $form['forena_default_form'] = array(
    '#type' => 'select',
    '#title' => t('Default report skin'),
    '#options' => $skins,
    '#description' => t('Specify the default skin to be used.   New skins can be created by creating .skin.yml files in your reports directory.' . ' Skins are basically css and javascript libraries added to your report.'),
    '#default_value' => \Drupal::config('forena.settings')
      ->get('forena_default_form'),
  );
  $form = system_settings_form($form);
  return $form;
}