You are here

function yandex_metrics_reports_get_list in Yandex.Metrics 6.2

Same name and namespace in other branches
  1. 8.3 yandex_metrics_reports/yandex_metrics_reports.module \yandex_metrics_reports_get_list()
  2. 8.2 yandex_metrics_reports/yandex_metrics_reports.module \yandex_metrics_reports_get_list()
  3. 7.3 yandex_metrics_reports/yandex_metrics_reports.module \yandex_metrics_reports_get_list()
  4. 7.2 yandex_metrics_reports/yandex_metrics_reports.module \yandex_metrics_reports_get_list()

Returns list of all reports.

Parameters

$reset:

Return value

array

3 calls to yandex_metrics_reports_get_list()
yandex_metrics_reports_ajax in yandex_metrics_reports/yandex_metrics_reports.module
Menu callback; outputs content of one of the 4 reports. It is intended for AJAX calls.
yandex_metrics_reports_get_active_list in yandex_metrics_reports/yandex_metrics_reports.module
Returns list of available and enabled reports only.
yandex_metrics_reports_reports in yandex_metrics_reports/yandex_metrics_reports.module
Menu callback. Reports setting form.

File

yandex_metrics_reports/yandex_metrics_reports.module, line 1095
The main code of Yandex.Metrics Reports module.

Code

function yandex_metrics_reports_get_list($reset = FALSE) {
  static $reports;
  if (!isset($reports) || $reset) {

    // Permanent cache.
    $cache = cache_get('yandex_metrics_reports_list');
    if ($cache === FALSE || $reset) {
      $reports = array();
      foreach (module_implements('yandex_metrics_reports_list') as $module) {
        $module_report_list = module_invoke($module, 'yandex_metrics_reports_list');
        if (isset($module_report_list) && is_array($module_report_list)) {
          $reports = array_merge($reports, $module_report_list);
        }
      }

      // Allow other modules to alter reports list before caching.
      drupal_alter('yandex_metrics_reports_list', $reports);
      cache_set('yandex_metrics_reports_list', $reports);
    }
    else {
      $reports = $cache->data;
    }
  }
  return $reports;
}