You are here

public static function Frx::Controls in Forena Reports 7.5

Same name and namespace in other branches
  1. 7.3 Frx.inc \Frx::Controls()
  2. 7.4 Frx.inc \Frx::Controls()

Retreive the classes from other modules.

Parameters

string $class:

Return value

Ambigous <string, unknown>

6 calls to Frx::Controls()
Frx::formatter in ./Frx.inc
Load the formatters for all initialized repositories.
Frx::supportedFormats in ./Frx.inc
Frx::Template in ./Frx.inc
Returns an object of the template class that has a method named templates.
RendererBase::renderDomNode in src/Renderer/RendererBase.php
Recursive report renderer Walks the nodes rendering the report.
Report::render in src/Report.php
Render the report

... See full list

File

./Frx.inc, line 172
Frx.incL General Forena Reporting Class

Class

Frx

Code

public static function Controls($class = '') {
  static $instances = '';
  if (!$instances) {
    foreach (module_list() as $module) {
      $function = $module . '_forena_controls';
      if (function_exists($function)) {
        $returned_controls = $function();
        if ($returned_controls) {
          foreach ((array) $returned_controls as $k => $c) {
            $c['module'] = $module;
            if (isset($c['file'])) {
              $c['file'] = drupal_get_path('module', $c['module']) . '/' . trim($c['file'], '/');
              include_once $c['file'];
            }
            if (class_exists($c['class'])) {
              $instances[$k] = new $c['class']();
            }
          }
        }
      }
    }
  }

  // Return class if we asked for one.
  if ($class) {
    return @$instances[$class];
  }
  return $instances;
}