You are here

function forena_controls in Forena Reports 7

Same name and namespace in other branches
  1. 6 forena.common.inc \forena_controls()

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

1 call to forena_controls()
forena_define_controls in ./forena.common.inc
returns a list of instances of the control classes if there wasn't a class, returns an empty string.

File

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

Code

function forena_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;
            $controls[] = $c;
          }
        }
      }
    }
  }
  return $controls;
}