• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP system_rebuild_theme_data函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中system_rebuild_theme_data函数的典型用法代码示例。如果您正苦于以下问题:PHP system_rebuild_theme_data函数的具体用法?PHP system_rebuild_theme_data怎么用?PHP system_rebuild_theme_data使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了system_rebuild_theme_data函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: rubik_form_system_theme_settings_alter

/**
 * Implements hook_form_system_theme_settings_alter() function.
 *
 * @param $form
 *   Nested array of form elements that comprise the form.
 * @param $form_state
 *   A keyed array containing the current state of the form.
 */
function rubik_form_system_theme_settings_alter(&$form, $form_state, $form_id = NULL)
{
    // Work-around for a core bug affecting admin themes. See issue #943212.
    if (isset($form_id)) {
        return;
    }
    $form['rubik'] = array('#type' => 'fieldset', '#title' => t('Rubik'));
    $form['rubik']['rubik_show_branding'] = array('#type' => 'checkbox', '#title' => t('Show branding'), '#description' => t('Display the "branding" line at the top of the page with breadcrumbs and secondary menu.'), '#default_value' => theme_get_setting('rubik_show_branding', 'rubik'));
    $form['rubik']['rubik_inline_field_descriptions'] = array('#type' => 'checkbox', '#title' => t('Display form field descriptions inline.'), '#description' => t("By default, each field's description is displayed in a pop-up, which is only visible when hovering over that field. Select this option to make all field descriptions visible at all times."), '#default_value' => theme_get_setting('rubik_inline_field_descriptions', 'rubik'));
    $form['rubik']['rubik_disable_sticky_sidebar'] = array('#type' => 'checkbox', '#title' => t('Disable sticky sidebar'), '#description' => t("By default, the sidebar will fix itself when scrolling down a form. If you have a lot of fields in the sidebar, consider disabling the sticky sidebar to view them all."), '#default_value' => theme_get_setting('rubik_disable_sticky_sidebar', 'rubik'));
    $form['rubik']['rubik_disable_sidebar_in_form'] = array('#type' => 'checkbox', '#title' => t('Disable sidebar in forms'), '#description' => t("By default, the sidebar is enabled for forms."), '#default_value' => theme_get_setting('rubik_disable_sidebar_in_form', 'rubik'));
    $form['rubik']['rubik_sidebar_field_ui'] = array('#type' => 'checkbox', '#title' => t('Display fields in the sidebar of the node edit form.'), '#description' => t("By default, each field is displayed in the main content area of the node edit form. This option allows you to move fields into the sidebar to improve user experience."), '#default_value' => theme_get_setting('rubik_sidebar_field_ui', 'rubik'), '#states' => array('invisible' => array(':input[name="rubik_disable_sidebar_in_form"]' => array('checked' => TRUE))));
    // If the sidebar is disabled, we need to disable the sidebar field ui as well.
    $rubik_disable_sidebar_in_form = theme_get_setting('rubik_disable_sidebar_in_form', 'rubik');
    if ($rubik_disable_sidebar_in_form == 1) {
        $form['rubik']['rubik_sidebar_field_ui']['#default_value'] = 0;
    }
    // Rebuild theme registry on form save.
    if (!empty($form_state)) {
        // Rebuild .info data.
        system_rebuild_theme_data();
        // Rebuild theme registry.
        drupal_theme_rebuild();
    }
}
开发者ID:ehazell,项目名称:AWPF,代码行数:33,代码来源:theme-settings.php


示例2: file_scan_directory

require_once $theme_path . '/includes/theme.inc';
require_once $theme_path . '/includes/pager.inc';
require_once $theme_path . '/includes/form.inc';
require_once $theme_path . '/includes/admin.inc';
require_once $theme_path . '/includes/menu.inc';
// Load module specific files in the modules directory.
$includes = file_scan_directory($theme_path . '/includes/modules', '/\\.inc$/');
foreach ($includes as $include) {
    if (module_exists($include->name)) {
        require_once $include->uri;
    }
}
// Auto-rebuild the theme registry during theme development.
if (theme_get_setting('bootstrap_rebuild_registry') && !defined('MAINTENANCE_MODE')) {
    // Rebuild .info data.
    system_rebuild_theme_data();
    // Rebuild theme registry.
    drupal_theme_rebuild();
}
/**
 * hook_theme() 
 */
function bootstrap_theme(&$existing, $type, $theme, $path)
{
    // If we are auto-rebuilding the theme registry, warn about the feature.
    if (function_exists('user_access') && user_access('administer site configuration') && theme_get_setting('bootstrap_rebuild_registry') && (arg(0) == 'admin' || flood_is_allowed($GLOBALS['theme'] . '_rebuild_registry_warning', 3))) {
        flood_register_event($GLOBALS['theme'] . '_rebuild_registry_warning');
        drupal_set_message(t('For easier theme development, the theme registry is being rebuilt on every page request. It is <em>extremely</em> important to <a href="!link">turn off this feature</a> on production websites.', array('!link' => url('admin/appearance/settings/' . $GLOBALS['theme']))), 'warning', FALSE);
    }
    return array('bootstrap_links' => array('variables' => array('links' => array(), 'attributes' => array(), 'heading' => NULL)), 'bootstrap_btn_dropdown' => array('variables' => array('links' => array(), 'attributes' => array(), 'type' => NULL)));
}
开发者ID:blondprod,项目名称:bibliotruc,代码行数:31,代码来源:template.php


示例3: testUpdateHiddenBaseTheme

 /**
  * Tests updates with a hidden base theme.
  */
 function testUpdateHiddenBaseTheme()
 {
     module_load_include('compare.inc', 'update');
     // Enable the subtheme.
     theme_enable(array('update_test_subtheme'));
     // Add a project and initial state for base theme and subtheme.
     $system_info = array('update_test_basetheme' => array('project' => 'update_test_basetheme', 'hidden' => TRUE), 'update_test_subtheme' => array('project' => 'update_test_subtheme', 'hidden' => FALSE));
     \Drupal::config('update_test.settings')->set('system_info', $system_info)->save();
     $projects = update_get_projects();
     $theme_data = system_rebuild_theme_data();
     $project_info = new ProjectInfo();
     $project_info->processInfoList($projects, $theme_data, 'theme', TRUE);
     $this->assertTrue(!empty($projects['update_test_basetheme']), 'Valid base theme (update_test_basetheme) was found.');
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:17,代码来源:UpdateContribTest.php


示例4: install_finished

/**
 * Installation task; perform final steps and display a 'finished' page.
 *
 * @param $install_state
 *   An array of information about the current installation state.
 * @return
 *   A message informing the user that the installation is complete.
 */
function install_finished(&$install_state)
{
    drupal_set_title(st('@drupal installation complete', array('@drupal' => drupal_install_profile_name())), PASS_THROUGH);
    $messages = drupal_set_message();
    $output = '<p>' . st('Congratulations, @drupal has been successfully installed.', array('@drupal' => drupal_install_profile_name())) . '</p>';
    $output .= '<p>' . (isset($messages['error']) ? st('Review the messages above before continuing on to <a href="@url">your new site</a>.', array('@url' => url(''))) : st('You may now visit <a href="@url">your new site</a>.', array('@url' => url('')))) . '</p>';
    if (module_exists('help')) {
        $output .= '<p>' . st('For more information on configuring Drupal, refer to the <a href="@help">help section</a>.', array('@help' => url('admin/help'))) . '</p>';
    }
    // Rebuild the module and theme data, in case any newly-installed modules
    // need to modify it via hook_system_info_alter(). We need to clear the
    // theme static cache first, to make sure that the theme data is actually
    // rebuilt.
    drupal_static_reset('_system_rebuild_theme_data');
    system_rebuild_module_data();
    system_rebuild_theme_data();
    // Rebuild menu and registry to get content type links registered by the
    // profile, and possibly any other menu items created through the tasks.
    menu_rebuild();
    // Rebuild the database cache of node types, so that any node types added
    // by newly installed modules are registered correctly and initialized with
    // the necessary fields.
    node_types_rebuild();
    // Register actions declared by any modules.
    actions_synchronize();
    // Randomize query-strings on css/js files, to hide the fact that this is a
    // new install, not upgraded yet.
    _drupal_flush_css_js();
    // Remember the profile which was used.
    variable_set('install_profile', drupal_get_profile());
    // Install profiles are always loaded last
    db_update('system')->fields(array('weight' => 1000))->condition('type', 'module')->condition('name', drupal_get_profile())->execute();
    // Cache a fully-built schema.
    drupal_get_schema(NULL, TRUE);
    // Run cron to populate update status tables (if available) so that users
    // will be warned if they've installed an out of date Drupal version.
    // Will also trigger indexing of profile-supplied content or feeds.
    drupal_cron_run();
    return $output;
}
开发者ID:blipp,项目名称:drupal,代码行数:48,代码来源:install.php


示例5: install_finished

/**
 * Installation task; perform final steps and display a 'finished' page.
 *
 * @param $install_state
 *   An array of information about the current installation state.
 * @return
 *   A message informing the user that the installation is complete.
 */
function install_finished(&$install_state)
{
    drupal_set_title(st('@drupal installation complete', array('@drupal' => drupal_install_profile_distribution_name())), PASS_THROUGH);
    $messages = drupal_set_message();
    $output = '<p>' . st('Congratulations, you installed @drupal!', array('@drupal' => drupal_install_profile_distribution_name())) . '</p>';
    $output .= '<p>' . (isset($messages['error']) ? st('Review the messages above before visiting <a href="@url">your new site</a>.', array('@url' => url(''))) : st('<a href="@url">Visit your new site</a>.', array('@url' => url('')))) . '</p>';
    // Rebuild the module and theme data, in case any newly-installed modules
    // need to modify it via hook_system_info_alter(). We need to clear the
    // theme static cache first, to make sure that the theme data is actually
    // rebuilt.
    drupal_static_reset('_system_rebuild_theme_data');
    system_rebuild_module_data();
    system_rebuild_theme_data();
    // Flush all caches to ensure that any full bootstraps during the installer
    // do not leave stale cached data, and that any content types or other items
    // registered by the install profile are registered correctly.
    drupal_flush_all_caches();
    // Register actions declared by any modules.
    actions_synchronize();
    // Remember the profile which was used.
    variable_set('install_profile', drupal_get_profile());
    // Install profiles are always loaded last
    db_update('system')->fields(array('weight' => 1000))->condition('type', 'module')->condition('name', drupal_get_profile())->execute();
    // Cache a fully-built schema.
    drupal_get_schema(NULL, TRUE);
    // Run cron to populate update status tables (if available) so that users
    // will be warned if they've installed an out of date Drupal version.
    // Will also trigger indexing of profile-supplied content or feeds.
    drupal_cron_run();
    return $output;
}
开发者ID:berkes,项目名称:sympal,代码行数:39,代码来源:install.php


示例6: testThemeMetaData

 /**
  * Tests whether the correct theme metadata is returned.
  */
 function testThemeMetaData()
 {
     // Generate the list of available themes.
     $themes = system_rebuild_theme_data();
     // Check that the mtime field exists for the bartik theme.
     $this->assertTrue(!empty($themes['bartik']->info['mtime']), 'The bartik.info.yml file modification time field is present.');
     // Use 0 if mtime isn't present, to avoid an array index notice.
     $test_mtime = !empty($themes['bartik']->info['mtime']) ? $themes['bartik']->info['mtime'] : 0;
     // Ensure the mtime field contains a number that is greater than zero.
     $this->assertTrue(is_numeric($test_mtime) && $test_mtime > 0, 'The bartik.info.yml file modification time field contains a timestamp.');
 }
开发者ID:akapivo,项目名称:www.dmi.be,代码行数:14,代码来源:ModuleHandlerTest.php


示例7: getProjects

 /**
  * {@inheritdoc}
  */
 public function getProjects()
 {
     if (empty($this->projects)) {
         // Retrieve the projects from storage, if present.
         $this->projects = $this->projectStorage('update_project_projects');
         if (empty($this->projects)) {
             // Still empty, so we have to rebuild.
             $module_data = system_rebuild_module_data();
             $theme_data = system_rebuild_theme_data();
             $project_info = new ProjectInfo();
             $project_info->processInfoList($this->projects, $module_data, 'module', TRUE);
             $project_info->processInfoList($this->projects, $theme_data, 'theme', TRUE);
             if ($this->updateSettings->get('check.disabled_extensions')) {
                 $project_info->processInfoList($this->projects, $module_data, 'module', FALSE);
                 $project_info->processInfoList($this->projects, $theme_data, 'theme', FALSE);
             }
             // Allow other modules to alter projects before fetching and comparing.
             $this->moduleHandler->alter('update_projects', $this->projects);
             // Store the site's project data for at most 1 hour.
             $this->keyValueStore->setWithExpire('update_project_projects', $this->projects, 3600);
         }
     }
     return $this->projects;
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:27,代码来源:UpdateManager.php


示例8: postInstall

 /**
  * Overrides Drupal\Core\Updater\Updater::postInstall().
  */
 public function postInstall()
 {
     // Update the theme info.
     clearstatcache();
     system_rebuild_theme_data();
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:9,代码来源:Theme.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP system_region_list函数代码示例发布时间:2022-05-23
下一篇:
PHP system_rebuild_module_data函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap