You are here

function page_theme_get_themes in Page Theme 6

Same name and namespace in other branches
  1. 7.2 page_theme.module \page_theme_get_themes()
  2. 7 page_theme.module \page_theme_get_themes()
4 calls to page_theme_get_themes()
page_theme_admin_delete in ./page_theme.admin.inc
Menu callback; deletes a theme.
page_theme_get_theme_name in ./page_theme.module
page_theme_get_theme_options in ./page_theme.module
Helper functions.
_page_theme_debugger_block_view in page_theme_debugger/page_theme_debugger.module

File

./page_theme.module, line 164
This module allows to use different themes than the site default on specific pages.

Code

function page_theme_get_themes($theme = NULL) {
  static $themes = array();
  if (!$themes) {
    foreach (system_theme_data() as $theme_data) {
      $compatible_core = isset($theme_data->info['core']) && $theme_data->info['core'] == DRUPAL_CORE_COMPATIBILITY;
      $compatible_php = version_compare(phpversion(), $theme_data->info['php'], '>=');
      if ($compatible_core && $compatible_php) {
        $themes[$theme_data->name] = $theme_data->info['name'];
      }
    }
    asort($themes);
  }
  return !is_null($theme) ? isset($themes[$theme]) ? $themes[$theme] : $theme : $themes;
}