You are here

function content_theme_update_7000 in Content Theme 7

Same name and namespace in other branches
  1. 7.2 content_theme.install \content_theme_update_7000()

Check if all defined themes are available otherwise display a notice.

File

./content_theme.install, line 119
Install, update and uninstall functions for the content_theme module.

Code

function content_theme_update_7000() {
  $themes = content_theme_get_themes();
  $result = db_query('SELECT DISTINCT theme FROM {content_theme_node}');
  foreach ($result as $content_theme_node) {
    if (!isset($themes[$content_theme_node->theme])) {
      return t('Not all defined themes are available, please check your configuration.');
    }
  }
  foreach (node_type_get_types() as $type => $value) {
    $type_theme = variable_get('content_theme_content_type_edit_' . $type, '-content_wide-');
    if ($type_theme != '-content_wide-' && !isset($themes[$type_theme])) {
      return t('Not all defined themes are available, please check your configuration.');
    }
    $type_theme = variable_get('content_theme_content_type_view_' . $type, '-content_wide-');
    if ($type_theme != '-content_wide-' && !isset($themes[$type_theme])) {
      return t('Not all defined themes are available, please check your configuration.');
    }
  }
  $type_theme = variable_get('content_theme_content_wide_edit', '0');
  if ($type_theme != '0' && !isset($themes[$type_theme])) {
    return t('Not all defined themes are available, please check your configuration.');
  }
  $type_theme = variable_get('content_theme_content_wide_view', '0');
  if ($type_theme != '0' && !isset($themes[$type_theme])) {
    return t('Not all defined themes are available, please check your configuration.');
  }
}