当前位置: 首页>>代码示例>>Python>>正文


Python DrupyPHP.defined方法代码示例

本文整理汇总了Python中lib.drupy.DrupyPHP.defined方法的典型用法代码示例。如果您正苦于以下问题:Python DrupyPHP.defined方法的具体用法?Python DrupyPHP.defined怎么用?Python DrupyPHP.defined使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lib.drupy.DrupyPHP的用法示例。


在下文中一共展示了DrupyPHP.defined方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _drupal_maintenance_theme

# 需要导入模块: from lib.drupy import DrupyPHP [as 别名]
# 或者: from lib.drupy.DrupyPHP import defined [as 别名]
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')
开发者ID:brendoncrawford,项目名称:drupy,代码行数:43,代码来源:theme_maintenance.py


注:本文中的lib.drupy.DrupyPHP.defined方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。