You are here

function FrxDrupalApplication::controls in Forena Reports 7.3

Same name and namespace in other branches
  1. 6.2 FrxDrupalApplication.inc \FrxDrupalApplication::controls()
  2. 7.2 FrxDrupalApplication.inc \FrxDrupalApplication::controls()
  3. 7.4 FrxDrupalApplication.inc \FrxDrupalApplication::controls()

Builds a global array of available controls and returns the array.

File

./FrxDrupalApplication.inc, line 188
HostApp.inc Defines all the interface points between the host application and Forena. Each of these methods must be specified in order for Forena to function properly. The base class here is drupal, so those

Class

FrxDrupalApplication

Code

function controls() {
  static $controls = '';
  if (!$controls) {
    $controls = array();
    foreach (module_list() as $module) {
      $function = $module . '_forena_controls';
      if (function_exists($function)) {
        $returned_controls = $function();
        if ($returned_controls) {
          foreach ((array) $returned_controls as $c) {
            $c['module'] = $module;
            $c['file'] = drupal_get_path('module', $c['module']) . '/' . trim($c['file'], '/');
            $controls[] = $c;
          }
        }
      }
    }
  }
  return $controls;
}