init_theme

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

includes/theme.inc, строка 29

Версии
5 – 6
init_theme()

Инициализирует систему темизации и загружает тему.

▾ 5 функции вызывают init_theme()

block_admin_display_form in modules/block/block.admin.inc
Generate main blocks administration form.
drupal_render_form in includes/form.inc
Генерирует темизированный HTML-код из структурированного массива формы.
path_to_theme in includes/theme.inc
Возвращает путь к текущему темизируемому элементу.
theme in includes/theme.inc
Генерирует темизированный вывод.
_block_rehash in modules/block/block.module
Update the 'blocks' DB table with the blocks currently exported by modules.

Код

<?php
function init_theme() {
  global $theme, $user, $custom_theme, $theme_key;

  // If $theme is already set, assume the others are set, too, and do nothing
  if (isset($theme)) {
    return;
  }

  drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
  $themes = list_themes();

  // Only select the user selected theme if it is available in the
  // list of enabled themes.
  $theme = !empty($user->theme) && !empty($themes[$user->theme]->status) ? $user->theme : variable_get('theme_default', 'garland');

  // Allow modules to override the present theme... only select custom theme
  // if it is available in the list of installed themes.
  $theme = $custom_theme && $themes[$custom_theme] ? $custom_theme : $theme;

  // Store the identifier for retrieving theme settings with.
  $theme_key = $theme;

  // Find all our ancestor themes and put them in an array.
  $base_theme = array();
  $ancestor = $theme;
  while ($ancestor && isset($themes[$ancestor]->base_theme)) {
    $base_theme[] = $new_base_theme = $themes[$themes[$ancestor]->base_theme];
    $ancestor = $themes[$ancestor]->base_theme;
  }
  _init_theme($themes[$theme], array_reverse($base_theme));
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему