You are here

function context_layouts_theme in Context 7.3

Implementation of hook_theme(). Declares each theme's layouts as a page template suggestion.

File

context_layouts/context_layouts.module, line 44

Code

function context_layouts_theme() {
  $info = array();
  foreach (list_themes() as $theme) {
    if (!empty($theme->status) && ($layouts = context_layouts_get_layouts($theme->name))) {
      foreach ($layouts as $layout) {
        if (!empty($layout['template'])) {
          $info["page__context_layouts_{$theme->name}_{$layout['layout']}"] = array(
            'template' => $layout['template'],
            'path' => $layout['path'],
          );
        }
      }
    }
  }
  return $info;
}