You are here

function content_theme_get_themes in Content Theme 7

Same name and namespace in other branches
  1. 6 content_theme.module \content_theme_get_themes()
  2. 7.2 content_theme.module \content_theme_get_themes()
5 calls to content_theme_get_themes()
content_theme_get_content_node_options in ./content_theme.module
content_theme_get_content_type_options in ./content_theme.module
content_theme_get_content_wide_options in ./content_theme.module
Helper functions.
content_theme_get_theme_name in ./content_theme.module
content_theme_update_7000 in ./content_theme.install
Check if all defined themes are available otherwise display a notice.

File

./content_theme.module, line 384
This module allows to use different themes than the site default on content creating, editing, and viewing pages.

Code

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