You are here

function content_theme_get_content_node_options in Content Theme 7

Same name and namespace in other branches
  1. 6 content_theme.module \content_theme_get_content_node_options()
  2. 7.2 content_theme.module \content_theme_get_content_node_options()
2 calls to content_theme_get_content_node_options()
content_theme_admin_content_node in ./content_theme.admin.inc
Menu callback; configures content node themes.
content_theme_form_node_form_alter in ./content_theme.module
Implements hook_form_BASE_FORM_ID_alter().

File

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

Code

function content_theme_get_content_node_options() {
  static $options = array();
  if (!$options) {
    $themes = content_theme_get_themes();
    $list = variable_get('content_theme_content_node_list', 'enabled');
    $options['0'] = '- ' . t('System default theme') . ' -';
    $options['-content_wide-'] = '- ' . t('Content wide theme') . ' -';
    $options['-content_type-'] = '- ' . t('Content type theme') . ' -';
    foreach ($themes as $theme => $theme_name) {
      $status = content_theme_get_theme_status($theme);
      if ($list == 'enabled' && $status || $list == 'all') {
        $options[$theme] = $status ? $theme_name : t('!theme (disabled)', array(
          '!theme' => $theme_name,
        ));
      }
    }
  }
  return $options;
}