def _drupal_maintenance_theme():
  # If theme is already set, assume the others are set too, and do nothing.
  if (lib_appglobals.theme is not None):
    return
  lib_unicode.check()
  # Install and update pages are 
  # treated differently to prevent theming overrides.
  if (php.defined('MAINTENANCE_MODE') and \
      (MAINTENANCE_MODE == 'install' or MAINTENANCE_MODE == 'update')):
    lib_appglobals.theme = 'minnelli'
  else:
    # Load plugin basics (needed for hook invokes).
    plugin_list_ = { 'system' : {}, 'filter' : {} }
    plugin_list_['system']['filename'] = 'plugins/system/system.py'
    plugin_list_['filter']['filename'] = 'plugins/filter/filter.py'
    lib_plugin.list(True, False, False, plugin_list_)
    drupal_load('plugin', 'system')
    drupal_load('plugin', 'filter')
    lib_appglobals.theme = variable_get('maintenance_theme', 'minnelli')
  themes = list_themes()
  # Store the identifier for retrieving theme settings with.
  lib_appglobals.theme_key = lib_appglobals.theme
  # Find all our ancestor themes and put them in an array.
  base_theme = []
  ancestor = lib_appglobals.theme
  while (ancestor and php.isset(themes[ancestor], base_theme)):
    new_base_theme = themes[themes[ancestor].base_theme]
    base_theme.append(new_base_theme)
    ancestor = themes[ancestor].base_theme
  _init_theme(themes[lib_appglobals.theme], php.array_reverse(base_theme), \
    '_theme_load_offline_registry')
  # These are usually added from system_init() -except maintenance.css.
  # When the database is inactive it's not called so we add it here.
  drupal_add_css(drupal_get_path('plugin', 'system') + \
    '/defaults.css', 'plugin')
  drupal_add_css(drupal_get_path('plugin', 'system') + \
    '/system.css', 'plugin')
  drupal_add_css(drupal_get_path('plugin', 'system') + \
    '/system-menus.css', 'plugin')
  drupal_add_css(drupal_get_path('plugin', 'system') + \
    '/maintenance.css', 'plugin')
Example #2
0
def _drupal_maintenance_theme():
    # If theme is already set, assume the others are set too, and do nothing.
    if (lib_appglobals.theme is not None):
        return
    lib_unicode.check()
    # Install and update pages are
    # treated differently to prevent theming overrides.
    if (php.defined('MAINTENANCE_MODE') and \
        (MAINTENANCE_MODE == 'install' or MAINTENANCE_MODE == 'update')):
        lib_appglobals.theme = 'minnelli'
    else:
        # Load plugin basics (needed for hook invokes).
        plugin_list_ = {'system': {}, 'filter': {}}
        plugin_list_['system']['filename'] = 'plugins/system/system.py'
        plugin_list_['filter']['filename'] = 'plugins/filter/filter.py'
        lib_plugin.list(True, False, False, plugin_list_)
        drupal_load('plugin', 'system')
        drupal_load('plugin', 'filter')
        lib_appglobals.theme = variable_get('maintenance_theme', 'minnelli')
    themes = list_themes()
    # Store the identifier for retrieving theme settings with.
    lib_appglobals.theme_key = lib_appglobals.theme
    # Find all our ancestor themes and put them in an array.
    base_theme = []
    ancestor = lib_appglobals.theme
    while (ancestor and php.isset(themes[ancestor], base_theme)):
        new_base_theme = themes[themes[ancestor].base_theme]
        base_theme.append(new_base_theme)
        ancestor = themes[ancestor].base_theme
    _init_theme(themes[lib_appglobals.theme], php.array_reverse(base_theme), \
      '_theme_load_offline_registry')
    # These are usually added from system_init() -except maintenance.css.
    # When the database is inactive it's not called so we add it here.
    drupal_add_css(drupal_get_path('plugin', 'system') + \
      '/defaults.css', 'plugin')
    drupal_add_css(drupal_get_path('plugin', 'system') + \
      '/system.css', 'plugin')
    drupal_add_css(drupal_get_path('plugin', 'system') + \
      '/system-menus.css', 'plugin')
    drupal_add_css(drupal_get_path('plugin', 'system') + \
      '/maintenance.css', 'plugin')