You are here

views_charts.module in Views Charts 6

Same filename and directory in other branches
  1. 7 views_charts.module

File

views_charts.module
View source
<?php

function views_charts_views_api() {
  return array(
    'api' => 2,
  );
}
function views_charts_init() {
  $mpath = drupal_get_path('module', 'views_charts');
  drupal_add_js($mpath . '/views_charts.js', 'module', 'header', FALSE, TRUE, FALSE);
  drupal_add_css($mpath . '/views_charts.css');
}

/**
 * module_invoke_all() substitute that works with referenced parameters.
 *
 * @param string $hook
 * @param array $args
 * @return array
 */
function views_charts_invoke_all($hook, $args) {
  $return = array();
  foreach (module_implements($hook) as $module) {
    $function = $module . '_' . $hook;
    $result = call_user_func_array($function, $args);
    if (isset($result) && is_array($result)) {
      $return = array_merge_recursive($return, $result);
    }
    else {
      if (isset($result)) {
        $return[] = $result;
      }
    }
  }
  return $return;
}

Functions

Namesort descending Description
views_charts_init
views_charts_invoke_all module_invoke_all() substitute that works with referenced parameters.
views_charts_views_api