diff --git a/core/modules/field/lib/Drupal/field/Plugin/Type/Formatter/FormatterPluginManager.php b/core/modules/field/lib/Drupal/field/Plugin/Type/Formatter/FormatterPluginManager.php index 70aa871..ab5f207 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/Type/Formatter/FormatterPluginManager.php +++ b/core/modules/field/lib/Drupal/field/Plugin/Type/Formatter/FormatterPluginManager.php @@ -142,7 +142,7 @@ public function prepareConfiguration($field_type, array $configuration) { * If no field type is provided, returns a nested array of all formatters, * keyed by field type. */ - public function getFormatterOptions($field_type = NULL) { + public function getOptions($field_type = NULL) { if (!isset($this->formatterOptions)) { $field_types = field_info_field_types(); $options = array(); diff --git a/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetPluginManager.php b/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetPluginManager.php index 129230c..f5807be 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetPluginManager.php +++ b/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetPluginManager.php @@ -139,7 +139,7 @@ public function prepareConfiguration($field_type, array $configuration) { * If no field type is provided, returns a nested array of all widget types, * keyed by field type human name. */ - public function getWidgetOptions($field_type = NULL) { + public function getOptions($field_type = NULL) { if (!isset($this->widgetOptions)) { $options = array(); $field_types = field_info_field_types(); diff --git a/core/modules/field_ui/field_ui.admin.inc b/core/modules/field_ui/field_ui.admin.inc index 2804657..4f429cc 100644 --- a/core/modules/field_ui/field_ui.admin.inc +++ b/core/modules/field_ui/field_ui.admin.inc @@ -70,7 +70,6 @@ function field_ui_fields_list() { function theme_field_ui_table($variables) { $elements = $variables['elements']; $table = array(); - $js_settings = array(); // Add table headers and attributes. foreach (array('header', 'attributes') as $key) { diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module index f9aefe3..3cf39ba 100644 --- a/core/modules/field_ui/field_ui.module +++ b/core/modules/field_ui/field_ui.module @@ -226,6 +226,7 @@ function field_ui_theme() { return array( 'field_ui_table' => array( 'render element' => 'elements', + 'file' => 'field_ui.admin.inc', ), ); } diff --git a/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php index cc699a6..cf3badd 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php @@ -183,7 +183,7 @@ public function buildForm(array $form, array &$form_state, $entity_type = NULL, ), ); - $formatter_options = $this->formatterManager->getFormatterOptions($field['type']); + $formatter_options = $this->formatterManager->getOptions($field['type']); $formatter_options['hidden'] = '<' . t('Hidden') . '>'; $table[$name]['format'] = array( 'type' => array( diff --git a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php index 1bef718..983917f 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php @@ -245,7 +245,7 @@ public function buildForm(array $form, array &$form_state, $entity_type = NULL, $max_weight = $entity_form_display->getHighestWeight(); // Prepare the widget types to be display as options. - $widget_options = $this->widgetManager->getWidgetOptions(); + $widget_options = $this->widgetManager->getOptions(); $widget_type_options = array(); foreach ($widget_options as $field_type => $widgets) { $widget_type_options[$field_types[$field_type]['label']] = $widgets; @@ -518,7 +518,7 @@ protected function validateAddNew(array $form, array &$form_state) { } // Wrong widget type. elseif ($field['type']) { - $widget_types = $this->widgetManager->getWidgetOptions($field['type']); + $widget_types = $this->widgetManager->getOptions($field['type']); if (!isset($widget_types[$field['widget_type']])) { form_set_error('fields][_add_new_field][widget_type', t('Add new field: invalid widget.')); } @@ -561,7 +561,7 @@ protected function validateAddExisting(array $form, array &$form_state) { } // Wrong widget type. elseif ($field['field_name'] && ($existing_field = field_info_field($field['field_name']))) { - $widget_types = $this->widgetManager->getWidgetOptions($existing_field['type']); + $widget_types = $this->widgetManager->getOptions($existing_field['type']); if (!isset($widget_types[$field['widget_type']])) { form_set_error('fields][_add_existing_field][widget_type', t('Re-use existing field: invalid widget.')); } diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldWidgetTypeForm.php b/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldWidgetTypeForm.php index 1ea5ad9..d7821f3 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldWidgetTypeForm.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldWidgetTypeForm.php @@ -49,7 +49,7 @@ public function buildForm(array $form, array &$form_state, FieldInstanceInterfac '#type' => 'select', '#title' => t('Widget type'), '#required' => TRUE, - '#options' => $this->widgetManager->getWidgetOptions($field['type']), + '#options' => $this->widgetManager->getOptions($field['type']), '#default_value' => $entity_form_display->getWidget($field_name)->getPluginId(), '#description' => t('The type of form element you would like to present to the user when creating this field in the %type type.', array('%type' => $bundle_label)), ); diff --git a/core/modules/field_ui/lib/Drupal/field_ui/OverviewBase.php b/core/modules/field_ui/lib/Drupal/field_ui/OverviewBase.php index 36048a6..e5f2cc0 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/OverviewBase.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/OverviewBase.php @@ -8,9 +8,9 @@ namespace Drupal\field_ui; use Symfony\Component\DependencyInjection\ContainerInterface; -use Drupal\Core\Form\FormInterface; -use Drupal\Core\ControllerInterface; +use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\Entity\EntityManager; +use Drupal\Core\Form\FormInterface; /** * Abstract base class for Field UI overview forms. @@ -80,7 +80,6 @@ public function buildForm(array $form, array &$form_state, $entity_type = NULL, $bundle = $entity_info['bundle_prefix'] . $bundle; } - form_load_include($form_state, 'inc', 'field_ui', 'field_ui.admin'); $this->entity_type = $entity_type; $this->bundle = $bundle; $this->adminPath = $this->entityManager->getAdminPath($this->entity_type, $this->bundle);