本文整理汇总了PHP中drupal_rebuild_theme_registry函数的典型用法代码示例。如果您正苦于以下问题:PHP drupal_rebuild_theme_registry函数的具体用法?PHP drupal_rebuild_theme_registry怎么用?PHP drupal_rebuild_theme_registry使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了drupal_rebuild_theme_registry函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fusion_core_initialize_theme_settings
/**
* Initialize theme settings if needed
*/
function fusion_core_initialize_theme_settings($theme_name)
{
$theme_settings = theme_get_settings($theme_name);
if (is_null($theme_settings['theme_font_size']) || $theme_settings['rebuild_registry'] == 1) {
// Rebuild theme registry & notify user
if ($theme_settings['rebuild_registry'] == 1) {
drupal_rebuild_theme_registry();
drupal_set_message(t('Theme registry rebuild completed. <a href="!link">Turn off</a> this feature for production websites.', array('!link' => url('admin/build/themes/settings/' . $GLOBALS['theme']))), 'warning');
}
// Retrieve saved or site-wide theme settings
$theme_setting_name = str_replace('/', '_', 'theme_' . $theme_name . '_settings');
$settings = variable_get($theme_setting_name, FALSE) ? theme_get_settings($theme_name) : theme_get_settings();
// Skip toggle_node_info_ settings
if (module_exists('node')) {
foreach (node_get_types() as $type => $name) {
unset($settings['toggle_node_info_' . $type]);
}
}
// Retrieve default theme settings
$defaults = fusion_core_default_theme_settings();
// Set combined default & saved theme settings
variable_set($theme_setting_name, array_merge($defaults, $settings));
// Force theme settings refresh
theme_get_setting('', TRUE);
}
}
示例2: fusion_core_initialize_theme_settings
/**
* Initialize theme settings if needed
*/
function fusion_core_initialize_theme_settings($theme_name)
{
$theme_settings = theme_get_settings($theme_name);
if (!isset($theme_settings['primary_menu_dropdown']) || $theme_settings['rebuild_registry'] == 1) {
static $registry_rebuilt = false;
// avoid multiple rebuilds per page
// Rebuild theme registry & notify user
if (isset($theme_settings['rebuild_registry']) && $theme_settings['rebuild_registry'] == 1 && !$registry_rebuilt) {
drupal_rebuild_theme_registry();
drupal_set_message(t('Theme registry rebuild completed. <a href="!link">Turn off</a> this feature for production websites.', array('!link' => url('admin/build/themes/settings/' . $GLOBALS['theme']))), 'warning');
$registry_rebuilt = true;
}
// Retrieve saved or site-wide theme settings
$theme_setting_name = str_replace('/', '_', 'theme_' . $theme_name . '_settings');
$settings = variable_get($theme_setting_name, FALSE) ? theme_get_settings($theme_name) : theme_get_settings();
// Skip toggle_node_info_ settings
if (module_exists('node')) {
foreach (node_get_types() as $type => $name) {
unset($settings['toggle_node_info_' . $type]);
}
}
// Combine default theme settings from .info file & theme-settings.php
$theme_data = list_themes();
// get theme data for all themes
$info_theme_settings = $theme_name ? $theme_data[$theme_name]->info['settings'] : array();
$defaults = array_merge(fusion_core_default_theme_settings(), $info_theme_settings);
// Set combined default & saved theme settings
variable_set($theme_setting_name, array_merge($defaults, $settings));
// Force theme settings refresh
theme_get_setting('', TRUE);
}
}
示例3: kr2011_preprocess_views_slideshow_ddblock
function kr2011_preprocess_views_slideshow_ddblock(&$vars)
{
drupal_rebuild_theme_registry();
$settings = $vars['views_slideshow_ddblock_slider_settings'];
// for showing debug info
views_slideshow_ddblock_show_content_debug_info($vars);
if ($settings['output_type'] == 'view_fields') {
if ($settings['view_name'] == 'news_items' && $settings['view_display_id'] == 'block_1') {
if (!empty($vars['views_slideshow_ddblock_content'])) {
foreach ($vars['views_slideshow_ddblock_content'] as $key1 => $result) {
// add slide image variable
$slider_items[$key1]['slide_image'] = views_slideshow_ddblock_add_image($vars, 'slider_item_image', $result->node_data_field_pager_item_text_field_image_fid, $result->node_title, NULL, NULL, NULL);
// add slide_text variable
if (isset($result->node_data_field_pager_item_text_field_slide_text_value)) {
$slider_items[$key1]['slide_text'] = check_markup($result->node_data_field_pager_item_text_field_slide_text_value);
}
// add slide_title variable
if (isset($result->node_title)) {
$slider_items[$key1]['slide_title'] = check_plain($result->node_title);
}
// add slide_read_more variable and slide_node variable
if (isset($result->nid)) {
$slider_items[$key1]['slide_read_more'] = '<a href="' . base_path() . 'node/' . $result->nid . '">' . t('Read more') . '</a>';
$slider_items[$key1]['slide_node'] = base_path() . 'node/' . $result->nid;
}
}
}
}
$vars['views_slideshow_ddblock_slider_items'] = $slider_items;
}
}
示例4: drupalModuleDisable
/**
* Disables a drupal module in the test database.
*
* @param string $name Name of the module.
* @return boolean Success.
* @see drupalModuleEnable()
*/
function drupalModuleDisable($name)
{
if (!module_exists($name)) {
$this->pass(" [module] {$name} already disabled");
return TRUE;
}
unset($this->_modules[$key]);
$form_state['values'] = array('status' => $this->_modules, 'op' => t('Save configuration'));
drupal_execute('system_modules', $form_state);
//rebuilding all caches
drupal_rebuild_theme_registry();
node_types_rebuild();
menu_rebuild();
cache_clear_all('schema', 'cache');
module_rebuild_cache();
}
示例5: drupal_rebuild_theme_registry
<?php
/* =====================================
template.php
* ------------------------------------- */
// Auto-rebuild the theme registry during theme development.
drupal_rebuild_theme_registry();
/*TODO: add a theme setting for this*/
/**
* Implements theme_menu_item_link()
* yup original is from zen and we humbly say thanx :)
*/
function moshpit_menu_item_link($link)
{
if (empty($link['localized_options'])) {
$link['localized_options'] = array();
}
//define a class for each tab
//TODO check out the multilang hell....
$linkclass = mothership_id_safe($link['title']);
// If an item is a LOCAL TASK, render it as a tab
if ($link['type'] & MENU_IS_LOCAL_TASK) {
$link['title'] = '<span class="tab ' . $linkclass . ' ">' . check_plain($link['title']) . '</span>';
$link['localized_options']['html'] = TRUE;
$link['localized_options']['attributes'] = array('class' => $linkclass);
}
return l($link['title'], $link['href'], $link['localized_options']);
}
示例6: tearDown
/**
* tearDown implementation, setting back switched modules etc
*/
function tearDown()
{
if ($this->_modules != $this->_originalModules) {
$form_state['values'] = array('status' => $this->_originalModules, 'op' => t('Save configuration'));
drupal_execute('system_modules', $form_state);
//rebuilding all caches
drupal_rebuild_theme_registry();
node_types_rebuild();
menu_rebuild();
cache_clear_all('schema', 'cache');
module_rebuild_cache();
$this->_modules = $this->_originalModules;
}
foreach ($this->_cleanupVariables as $name => $value) {
if (is_null($value)) {
variable_del($name);
} else {
variable_set($name, $value);
}
}
$this->_cleanupVariables = array();
//delete nodes
foreach ($this->_cleanupNodes as $nid) {
node_delete($nid);
}
$this->_cleanupNodes = array();
//delete roles
while (sizeof($this->_cleanupRoles) > 0) {
$rid = array_pop($this->_cleanupRoles);
db_query("DELETE FROM {role} WHERE rid = %d", $rid);
db_query("DELETE FROM {permission} WHERE rid = %d", $rid);
}
//delete users and their content
while (sizeof($this->_cleanupUsers) > 0) {
$uid = array_pop($this->_cleanupUsers);
// cleanup nodes this user created
$result = db_query("SELECT nid FROM {node} WHERE uid = %d", $uid);
while ($node = db_fetch_array($result)) {
node_delete($node['nid']);
}
user_delete(array(), $uid);
}
//delete content types
foreach ($this->_cleanupContentTypes as $type) {
node_type_delete($type);
}
$this->_cleanupContentTypes = array();
//Output drupal warnings and messages into assert messages
$drupal_msgs = drupal_get_messages();
foreach ($drupal_msgs as $type => $msgs) {
foreach ($msgs as $msg) {
$this->assertTrue(TRUE, "{$type}: {$msg}");
}
}
parent::tearDown();
}