Results

11.10.2020
wxt 8.x-3.011 :: modules/custom/wxt_ext/wxt_ext_workflow/wxt_ext_workflow.module
/**
 * Implements hook_theme_registry_alter().
 */
function wxt_ext_workflow_theme_registry_alter(array &$theme_registry) {
  foreach ($theme_registry as $hook => &$info) {
    if ($hook == 'field' || (isset($info['base hook']) && $info['base hook'] == 'field')) {
      // We wrap around Quick Edit's preprocess function, so it should not be
      // run directly.
      $info['preprocess functions'] = array_diff($info['preprocess functions'], ['quickedit_preprocess_field']);
    }
11.10.2020
wxt 8.x-3.011 :: modules/custom/wxt_ext/wxt_ext_media_twitter/wxt_ext_media_twitter.module
/**
 * Implements hook_theme_registry_alter().
 */
function wxt_ext_media_twitter_theme_registry_alter(array &$theme_registry) {
  /** @var \Drupal\Core\Extension\ModuleExtensionList $module_list */
  $module_list = Drupal::service('extension.list.module');

  $hook = &$theme_registry['media_entity_twitter_tweet'];
  if ($hook['path'] === $module_list->getPath('media_entity_twitter') . '/templates') {
    $hook['path'] = $module_list->getPath('wxt_ext_media_twitter') . '/templates';
22.11.2021
zurb_foundation_6_paragraphs 1.0.1-beta1 :: includes/zurb_foundation_6_paragraphs.themes.inc
/**
 * Implements hook_theme_registry_alter().
 *
 * Check for the .html.twig files in the folders of
 * - current module (zurb_foundation_6_paragraphs/templates)
 * - current theme (xxx/templates/paragraphs)
 *
 * @param type $theme_registry
 * @param type $theme_registry
 */
function zurb_foundation_6_paragraphs_theme_registry_alter(&$theme_registry){
  $fsService  = \Drupal::service('file_system');
  $extension  = '.html.twig';

  $actTheme     = \Drupal::config('system.theme')->get('default');
  $modulePath   = \Drupal::service('extension.list.module')->getPath('zurb_foundation_6_paragraphs');
  $themePath    = \Drupal::service('extension.list.theme')->getPath($actTheme);
  if(is_dir($dir)) {
    $moduleFiles  = $fsService->scanDirectory($dir, '/' . preg_quote($extension) . '$/');
    _zurb_foundation_6_paragraphs_theme_registry_alter_partial($theme_registry, $moduleFiles, $extension, $modulePath, 'module', $fsService);
  }

  $dir = $themePath . '/templates/paragraphs';
  if(is_dir($dir)) {
    $themeFiles   = $fsService->scanDirectory($dir, '/' . preg_quote($extension) . '$/');
    _zurb_foundation_6_paragraphs_theme_registry_alter_partial($theme_registry, $themeFiles, $extension, $themePath, 'theme_engine', $fsService);
  }
}

/**
 * Iterare the single .html.twig file recived and che if exist.
 * If possibile, it add them to the theme registry to use them.
 * @param $type
 */
function _zurb_foundation_6_paragraphs_theme_registry_alter_partial(&$theme_registry, $files, $extension, $myPath, $type, $fsService) {
  foreach ($files as $file){
    $template = $fsService->basename($file->filename, $extension);
    $theme    = str_replace('-', '_', $template);
    $exp      = explode('__', $theme, 2);

    if(count($exp) === 2){

Pages

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc