You are here

function forena_query_create_block_form in Forena Reports 8

Same name and namespace in other branches
  1. 7.5 forena_query.inc \forena_query_create_block_form()
  2. 7.4 forena_query.inc \forena_query_create_block_form()

Create new sql data form hook

Parameters

array $form:

\Drupal\Core\Form\FormStateInterface $form_state:

Return value

array

1 string reference to 'forena_query_create_block_form'
forena_query_menu in forena_query/forena_query.module
Implementation of hook_menu

File

forena_query/forena_query.inc, line 13
forena.datablock.inc Data block building and testing forms.

Code

function forena_query_create_block_form($form, &$form_state, $provider = '') {
  $providers = \Drupal\forena\Frx::instance()
    ->dataManager()->repositories;
  $form['provider'] = array(
    '#required' => TRUE,
    '#title' => t('Data Source'),
    '#type' => 'select',
    '#options' => \Drupal\forena\DataManager::instance()
      ->listRepos(),
    '#default_value' => $provider,
  );
  $form['block_name'] = array(
    '#type' => 'forena_machine_name',
    '#required' => TRUE,
    '#title' => t('Block to create'),
  );
  $form['add'] = array(
    '#type' => 'submit',
    '#value' => t('Create'),
  );
  return $form;
}