You are here

public function FrxBean::view in Forena Reports 7.4

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

Return the block content.

Parameters

$bean: The bean object being viewed.

$content: The default content array created by Entity API. This will include any fields attached to the entity.

$view_mode: The view mode passed into $entity->view().

Return value

Return a renderable content array.

Overrides BeanPlugin::view

File

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

Class

FrxBean
@file bean plugin for with a forena report

Code

public function view($bean, $content, $view_mode = 'default', $langcode = NULL) {
  $parms = array();
  parse_str($bean->settings['parms'], $parms);
  if (!$parms) {
    $parms = array();
  }
  $report = $bean->settings['selected_report'];
  if ('reports/' . str_replace('/', '.', $report) == $_GET['q']) {
    return array();
  }
  if ($bean->settings['include_url_parameters']) {
    $query = $_GET;
    unset($query['q']);
    $parms = array_merge($parms, $query);
    if (Frx::Data()
      ->contextExists('parm')) {
      $parms = array_merge($parms, Frx::Data()
        ->getContext('parm'));
    }
  }
  $content = forena_report($report, $parms, 'block');
  return $content;
}