You are here

public function FrxBean::form in Forena Reports 7.3

Same name and namespace in other branches
  1. 7.5 bean/FrxBean.inc \FrxBean::form()
  2. 7.4 bean/FrxBean.inc \FrxBean::form()

The Plugin Form

The Bean object will be either loaded from the database or filled with the defaults.

_state

Parameters

$bean:

$form:

Return value

array form array

Overrides BeanPlugin::form

File

bean/FrxBean.inc, line 17
bean plugin for with a forena report

Class

FrxBean
@file bean plugin for with a forena report

Code

public function form($bean, $form, &$form_state) {
  $form = array();
  $form['settings'] = array(
    '#type' => 'fieldset',
    '#tree' => 1,
    '#title' => t('Settings'),
  );

  // ask politely which node to show
  $form['settings']['selected_report'] = array(
    '#type' => 'textfield',
    '#title' => t('Select a report'),
    '#autocomplete_path' => 'forena/reports/autocomplete',
    '#default_value' => isset($bean->settings['selected_report']) ? $bean->settings['selected_report'] : '',
    '#required' => TRUE,
    '#multiple' => FALSE,
  );
  $form['settings']['include_url_parameters'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use menu parameters from url'),
    '#description' => t('If checked, parameters from url or in menu path will be used when rendering this report.'),
    '#default_value' => @$bean->settings['include_url_parameters'],
    '#multiple' => FALSE,
  );
  $form['settings']['parms'] = array(
    '#type' => 'textfield',
    '#title' => 'URL Parameters',
    '#description' => 'Specify parameters as they would appear on the url (e.g. state=wa&county=foo) ',
    '#default_value' => @$bean->settings['parms'],
    '#multiple' => FALSE,
  );
  return $form;
}