本文整理汇总了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')