You are here

function forena_data_select_block_validate in Forena Reports 7.3

Same name and namespace in other branches
  1. 6.2 forena.admin.inc \forena_data_select_block_validate()
  2. 7.2 forena.admin.inc \forena_data_select_block_validate()

Validates the forena_data_block_form's data_block field.

_state

Parameters

$form:

Return value

unknown_type

1 string reference to 'forena_data_select_block_validate'
forena_add_data_block_form in ./forena.admin.inc

File

./forena.admin.inc, line 1701

Code

function forena_data_select_block_validate($form, &$form_state) {
  $values = $form_state['values'];
  $block_info = array();
  $data_block = $values['data_block'];

  //validate the data block only if delete block was not chosen
  if ($data_block) {
    $block_info = Frx::RepoMan()
      ->loadBlock($data_block);
  }
  if (!$block_info) {
    form_set_error('data_block', t('Invalid data block.'));
  }
}