edit.module | 2 +- edit.routing.yml | 4 ++-- .../edit_aloha/Plugin/edit/processed_text_editor/Aloha.php | 6 +++--- lib/Drupal/edit/Access/EditEntityFieldAccessCheck.php | 2 +- .../edit/Access/EditEntityFieldAccessCheckInterface.php | 2 +- lib/Drupal/edit/EditBundle.php | 2 +- lib/Drupal/edit/EditController.php | 4 ++-- lib/Drupal/edit/EditorAttacher.php | 2 +- lib/Drupal/edit/EditorAttacherInterface.php | 4 ++-- lib/Drupal/edit/EditorSelector.php | 6 +++--- lib/Drupal/edit/EditorSelectorInterface.php | 2 +- lib/Drupal/edit/Form/EditFieldForm.php | 11 +---------- lib/Drupal/edit/Plugin/ProcessedTextEditorBase.php | 9 ++++++++- lib/Drupal/edit/Plugin/ProcessedTextEditorInterface.php | 2 +- lib/Drupal/edit/Plugin/ProcessedTextEditorManager.php | 4 ++-- 15 files changed, 30 insertions(+), 32 deletions(-) diff --git a/edit.module b/edit.module index fab21d0..423450b 100644 --- a/edit.module +++ b/edit.module @@ -137,7 +137,7 @@ function edit_library_info() { // Basic settings. array( 'data' => array('edit' => array( - 'fieldFormURL' => url('edit/field/!entity_type/!id/!field_name/!langcode/!view_mode'), + 'fieldFormURL' => url('edit/form/!entity_type/!id/!field_name/!langcode/!view_mode'), 'rerenderProcessedTextURL' => url('edit/text/!entity_type/!id/!field_name/!langcode/!view_mode'), 'context' => 'body', )), diff --git a/edit.routing.yml b/edit.routing.yml index c49662a..23011e6 100644 --- a/edit.routing.yml +++ b/edit.routing.yml @@ -1,5 +1,5 @@ edit_field_form: - pattern: '/edit/field/{entity_type}/{entity}/{field_name}/{langcode}/{view_mode}' + pattern: '/edit/form/{entity_type}/{entity}/{field_name}/{langcode}/{view_mode}' defaults: _controller: '\Drupal\edit\EditController::fieldForm' requirements: @@ -8,6 +8,6 @@ edit_field_form: edit_text: pattern: '/edit/text/{entity_type}/{entity}/{field_name}/{langcode}/{view_mode}' defaults: - _controller: '\Drupal\edit\EditController::getEditableText' + _controller: '\Drupal\edit\EditController::getUntransformedText' requirements: _access_edit_entity_field: 'TRUE' diff --git a/edit_aloha/lib/Drupal/edit_aloha/Plugin/edit/processed_text_editor/Aloha.php b/edit_aloha/lib/Drupal/edit_aloha/Plugin/edit/processed_text_editor/Aloha.php index 41474c1..8af151e 100644 --- a/edit_aloha/lib/Drupal/edit_aloha/Plugin/edit/processed_text_editor/Aloha.php +++ b/edit_aloha/lib/Drupal/edit_aloha/Plugin/edit/processed_text_editor/Aloha.php @@ -2,7 +2,7 @@ /** * @file - * Definition of Drupal\edit_aloha\Plugin\edit\processed_text_editor\Aloha. + * Definition of \Drupal\edit_aloha\Plugin\edit\processed_text_editor\Aloha. */ namespace Drupal\edit_aloha\Plugin\edit\processed_text_editor; @@ -27,14 +27,14 @@ use Drupal\Core\Annotation\Translation; class Aloha extends ProcessedTextEditorBase { /** - * Implements Drupal\edit\Plugin\ProcessedTextEditorBase::addJsSettings(). + * Implements \Drupal\edit\Plugin\ProcessedTextEditorBase::addJsSettings(). */ function addJsSettings() { aloha_add_format_settings(); } /** - * Implements Drupal\edit\Plugin\ProcessedTextEditorBase::checkFormatCompatibility(). + * Implements \Drupal\edit\Plugin\ProcessedTextEditorBase::checkFormatCompatibility(). */ function checkFormatCompatibility($format_id) { return aloha_check_format_compatibility($format_id); diff --git a/lib/Drupal/edit/Access/EditEntityFieldAccessCheck.php b/lib/Drupal/edit/Access/EditEntityFieldAccessCheck.php index 1862677..82726c3 100644 --- a/lib/Drupal/edit/Access/EditEntityFieldAccessCheck.php +++ b/lib/Drupal/edit/Access/EditEntityFieldAccessCheck.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\edit\Access\EditEntityFieldAccessCheck. + * Contains \Drupal\edit\Access\EditEntityFieldAccessCheck. */ namespace Drupal\edit\Access; diff --git a/lib/Drupal/edit/Access/EditEntityFieldAccessCheckInterface.php b/lib/Drupal/edit/Access/EditEntityFieldAccessCheckInterface.php index aa2ac63..fe6d918 100644 --- a/lib/Drupal/edit/Access/EditEntityFieldAccessCheckInterface.php +++ b/lib/Drupal/edit/Access/EditEntityFieldAccessCheckInterface.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\edit\Access\EditEntityFieldAccessCheckInterface. + * Contains \Drupal\edit\Access\EditEntityFieldAccessCheckInterface. */ namespace Drupal\edit\Access; diff --git a/lib/Drupal/edit/EditBundle.php b/lib/Drupal/edit/EditBundle.php index 1711a7d..acfa598 100644 --- a/lib/Drupal/edit/EditBundle.php +++ b/lib/Drupal/edit/EditBundle.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\edit\EditBundle. + * Contains \Drupal\edit\EditBundle. */ namespace Drupal\edit; diff --git a/lib/Drupal/edit/EditController.php b/lib/Drupal/edit/EditController.php index 887bfc6..56f8f84 100644 --- a/lib/Drupal/edit/EditController.php +++ b/lib/Drupal/edit/EditController.php @@ -2,7 +2,7 @@ /** * @file - * Contains of Drupal\edit\EditController. + * Contains of \Drupal\edit\EditController. */ namespace Drupal\edit; @@ -87,7 +87,7 @@ class EditController extends ContainerAware { * @return \Drupal\Core\Ajax\AjaxResponse * The Ajax response. */ - public function getEditableText(EntityInterface $entity, $field_name, $langcode, $view_mode) { + public function getUntransformedText(EntityInterface $entity, $field_name, $langcode, $view_mode) { $response = new AjaxResponse(); $output = field_view_field($entity->entityType(), $entity, $field_name, $view_mode, $langcode); diff --git a/lib/Drupal/edit/EditorAttacher.php b/lib/Drupal/edit/EditorAttacher.php index 1b8e8aa..3d7f4dd 100644 --- a/lib/Drupal/edit/EditorAttacher.php +++ b/lib/Drupal/edit/EditorAttacher.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\edit\EditorAttacher. + * Contains \Drupal\edit\EditorAttacher. */ namespace Drupal\edit; diff --git a/lib/Drupal/edit/EditorAttacherInterface.php b/lib/Drupal/edit/EditorAttacherInterface.php index d3c1d21..4605ee3 100644 --- a/lib/Drupal/edit/EditorAttacherInterface.php +++ b/lib/Drupal/edit/EditorAttacherInterface.php @@ -2,13 +2,13 @@ /** * @file - * Contains Drupal\edit\EditorAttacherInterface. + * Contains \Drupal\edit\EditorAttacherInterface. */ namespace Drupal\edit; /** - * Interface for attaching an in-place editor to a field. + * Interface for attaching an in-place editor to an entity field. */ interface EditorAttacherInterface { diff --git a/lib/Drupal/edit/EditorSelector.php b/lib/Drupal/edit/EditorSelector.php index 36425ea..008448b 100644 --- a/lib/Drupal/edit/EditorSelector.php +++ b/lib/Drupal/edit/EditorSelector.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\edit\EditorSelector. + * Contains \Drupal\edit\EditorSelector. */ namespace Drupal\edit; @@ -79,7 +79,7 @@ class EditorSelector implements EditorSelectorInterface { if (isset($format_id)) { $wysiwyg_plugin = $this->getProcessedTextEditorPlugin(); if (isset($wysiwyg_plugin) && $wysiwyg_plugin->checkFormatCompatibility($format_id)) { - // Yay! Even though the text is processed, there's a wysiwyg editor + // Yay! Even though the text is processed, there's a WYSIWYG editor // that can work with it. $editor = 'direct-with-wysiwyg'; } @@ -113,7 +113,7 @@ class EditorSelector implements EditorSelectorInterface { * * @todo The terminology here is confusing. 'direct-with-wysiwyg' is one of * several possible "editor"s for processed text. When using it, we need to - * integrate a particular wysiwyg editor, which in Create.js is called a + * integrate a particular WYSIWYG editor, which in Create.js is called a * "PropertyEditor widget", but we're not yet including "widget" in the name * of ProcessedTextEditorInterface to minimize confusion with Field API * widgets. So, we're currently refering to these as "plugins", which is diff --git a/lib/Drupal/edit/EditorSelectorInterface.php b/lib/Drupal/edit/EditorSelectorInterface.php index fc30c4e..c1ce47a 100644 --- a/lib/Drupal/edit/EditorSelectorInterface.php +++ b/lib/Drupal/edit/EditorSelectorInterface.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\edit\EditorSelectorInterface. + * Contains \Drupal\edit\EditorSelectorInterface. */ namespace Drupal\edit; diff --git a/lib/Drupal/edit/Form/EditFieldForm.php b/lib/Drupal/edit/Form/EditFieldForm.php index 455893a..1836136 100644 --- a/lib/Drupal/edit/Form/EditFieldForm.php +++ b/lib/Drupal/edit/Form/EditFieldForm.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\edit\Form\EditFieldForm. + * Contains \Drupal\edit\Form\EditFieldForm. */ namespace Drupal\edit\Form; @@ -85,15 +85,6 @@ class EditFieldForm { $field_name = $form_state['field_name']; $langcode = $form_state['langcode']; - // We expect the form to only contain the single field being edited, the - // submit button, and some hidden elements internal to Form API. If there's - // anything else, then simplifying the field element itself (e.g., by hiding - // its label) may lead to confusion elsewhere. - // @todo Find a real use case of this to document. Otherwise, remove it. - if (array_diff(element_children($form), array($field_name, 'actions', 'form_build_id', 'form_token', 'form_id'))) { - return; - } - $widget_element =& $form[$field_name][$langcode]; // Hide the field label from displaying within the form, because JavaScript diff --git a/lib/Drupal/edit/Plugin/ProcessedTextEditorBase.php b/lib/Drupal/edit/Plugin/ProcessedTextEditorBase.php index 32678e5..6370011 100644 --- a/lib/Drupal/edit/Plugin/ProcessedTextEditorBase.php +++ b/lib/Drupal/edit/Plugin/ProcessedTextEditorBase.php @@ -1,7 +1,8 @@ discovery = new AnnotatedClassDiscovery('edit', 'processed_text_editor');