You are here

function page_theme_get_themes in Page Theme 7.2

Same name and namespace in other branches
  1. 6 page_theme.module \page_theme_get_themes()
  2. 7 page_theme.module \page_theme_get_themes()

Helper functions for themes.

3 calls to page_theme_get_themes()
page_theme_get_themes_list in ./page_theme.module
page_theme_get_theme_name in ./page_theme.module
page_theme_update_7001 in ./page_theme.install
Check if all defined themes are available otherwise display a notice.

File

./page_theme.module, line 134
Allows to use different themes than the site default on specific pages.

Code

function page_theme_get_themes() {
  static $themes = array();
  if (!$themes) {
    $result = db_query('SELECT name, status, info FROM {system} WHERE type = :type', array(
      ':type' => 'theme',
    ));
    foreach ($result as $theme) {
      $theme->info = unserialize($theme->info);
      if (empty($theme->info['hidden']) || !$theme->info['hidden']) {
        $themes[$theme->name] = array(
          'theme' => $theme->name,
          'name' => $theme->info['name'],
          'status' => $theme->status,
        );
      }
    }
  }
  return $themes;
}