1.20.x layout.module _layout_get_all_info($data_type, $init = array())

Load a layout-related information from modules.

File

modules/layout/layout.module, line 1397
The Layout module creates pages and wraps existing pages in layouts.

Code

function _layout_get_all_info($data_type, $init = array()) {
  $all_info = &backdrop_static(__FUNCTION__);
  if (!isset($all_info[$data_type])) {
    _layout_include_files();
    $all_info[$data_type] = $init;
    foreach (module_implements($data_type . '_info') as $module) {
      $function = $module . '_' . $data_type . '_info';
      $data = $function();
      $module_path = backdrop_get_path('module', $module);
      foreach ($data as $key => $info) {
        $info['module'] = $module;
        $info['name'] = $key;
        if (isset($info['path'])) {
          $info['path'] = $module_path . '/' . $info['path'];
        }
        else {
          $info['path'] = $module_path;
        }
        $all_info[$data_type][$key] = $info;
      }
    }
  }

  return $all_info[$data_type];
}