You are here

function forena_load_block in Forena Reports 6

Same name and namespace in other branches
  1. 7 forena.common.inc \forena_load_block()

Returns an array of information about the data block

Parameters

$data_block:

Return value

unknown_type

4 calls to forena_load_block()
forena_data_block_add in ./forena.admin.inc
submit handler for forena_data_block_form. This adds the datablock to an existing report.
forena_data_block_form in ./forena.admin.inc
A form to preview and add data blocks to an existing report
forena_data_block_form_submit in ./forena.admin.inc
The Preview submit handler for forena_add_block_form Renders datablock into a report
forena_data_block_form_validate in ./forena.admin.inc
Validates the forena_data_block_form's data_block field.

File

./forena.common.inc, line 299
Common functions used throughout the project but loaded in this file to keep the module file lean.

Code

function forena_load_block($data_block, $clause = '') {
  list($provider, $block) = explode('/', $data_block, 2);

  // Get the data
  $repos = forena_repository($provider);
  if ($repos['data']) {
    $provider = $repos['data'];
    if (method_exists($provider, 'load_block')) {
      $block_info = $provider
        ->load_block($block, $clause);
    }
    return $block_info;
  }
}