pluginreference-2.0.0/pluginreference.module

pluginreference.module
<?php

/**
 * @file
 * Provides a field that stores a soft reference to a plugin.
 */

use Drupal\Core\Routing\RouteMatchInterface;

/**
 * Implements hook_help().
 */
function pluginreference_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    // Main module help for the pluginreference module.
    case 'help.page.pluginreference':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('This module simply provides a "Plugin reference" field that allows to create soft references to plugins.') . '</p>';
      return $output;
  }
}

/**
 * Implements hook_form_FORM_ID_alter() for 'field_ui_field_storage_add_form'.
 */
function pluginreference_form_field_ui_field_storage_add_form_alter(array &$form) {
  unset($form['add']['new_storage_type']['#options']['plugin_reference']['plugin_reference']);
  $form['add']['new_storage_type']['#options']['plugin_reference']['plugin_reference'] = t('Other…');
}

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

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