diff --git a/core/modules/block_content/block_content.info.yml b/core/modules/block_content/block_content.info.yml index e9e7afb..9b3421c 100644 --- a/core/modules/block_content/block_content.info.yml +++ b/core/modules/block_content/block_content.info.yml @@ -1,6 +1,6 @@ -name: 'Custom Block' +name: 'Block Content' type: module -description: 'Allows the creation of custom blocks through the user interface.' +description: 'Allows the creation of block content through the user interface.' package: Core version: VERSION core: 8.x diff --git a/core/modules/block_content/block_content.links.action.yml b/core/modules/block_content/block_content.links.action.yml index 735e374..f541e4b 100644 --- a/core/modules/block_content/block_content.links.action.yml +++ b/core/modules/block_content/block_content.links.action.yml @@ -1,12 +1,12 @@ block_content_type_add: route_name: block_content.type_add - title: 'Add custom block type' + title: 'Add block content type' appears_on: - block_content.type_list block_content_add_action: route_name: block_content.add_page - title: 'Add custom block' + title: 'Add block content' appears_on: - block.admin_display - block.admin_display_theme diff --git a/core/modules/block_content/block_content.links.task.yml b/core/modules/block_content/block_content.links.task.yml index 61ab18a..3a87c44 100644 --- a/core/modules/block_content/block_content.links.task.yml +++ b/core/modules/block_content/block_content.links.task.yml @@ -1,5 +1,5 @@ block_content.list: - title: 'Custom block library' + title: 'Block content library' route_name: block_content.list base_route: block.admin_display block_content.list_sub: @@ -20,7 +20,7 @@ entity.block_content.delete_form: route_name: entity.block_content.delete_form base_route: entity.block_content.canonical -# Default tab for custom block type editing. +# Default tab for block content type editing. entity.block_content_type.edit_form: title: 'Edit' route_name: entity.block_content_type.edit_form diff --git a/core/modules/block_content/block_content.module b/core/modules/block_content/block_content.module index dd36852..76c8d8f 100644 --- a/core/modules/block_content/block_content.module +++ b/core/modules/block_content/block_content.module @@ -2,7 +2,7 @@ /** * @file - * Allows the creation of custom blocks through the user interface. + * Allows the creation of block content through the user interface. */ use Drupal\Core\Routing\RouteMatchInterface; @@ -17,13 +17,13 @@ function block_content_help($route_name, RouteMatchInterface $route_match) { case 'help.page.block_content': $output = ''; $output .= '

' . t('About') . '

'; - $output .= '

' . t('The Custom Block module allows you to create blocks of content, which can be placed in regions throughout the website. Custom blocks can have fields; see the Field module help for more information. Once created, custom blocks can be placed like blocks provided by other modules; see the Block module help page for details. For more information, see the online documentation for the Custom Block module.', array('!block-content' => \Drupal::url('block_content.list'), '!field-help' => \Drupal::url('help.page', array('name' => 'field')), '!blocks' => \Drupal::url('help.page', array('name' => 'block')), '!online-help' => 'https://drupal.org/documentation/modules/block_content')) . '

'; + $output .= '

' . t('The Block Content module allows you to create blocks of content, which can be placed in regions throughout the website. Block content can have fields; see the Field module help for more information. Once created, custom blocks can be placed like blocks provided by other modules; see the Block module help page for details. For more information, see the online documentation for the Custom Block module.', array('!block-content' => \Drupal::url('block_content.list'), '!field-help' => \Drupal::url('help.page', array('name' => 'field')), '!blocks' => \Drupal::url('help.page', array('name' => 'block')), '!online-help' => 'https://drupal.org/documentation/modules/block_content')) . '

'; $output .= '

' . t('Uses') . '

'; $output .= '
'; - $output .= '
' . t('Creating and managing custom block types') . '
'; - $output .= '
' . t('Users with the Administer blocks permission can create different custom block types, each with different fields and display settings, from the Custom block types page. The Custom block types page lists all of your created custom block types, and allows you to edit and manage them. For more information about managing fields and display settings, see the Field UI module help.', array('!types' => \Drupal::url('block_content.type_list'), '!field-ui' => \Drupal::url('help.page', array('name' => 'field_ui')))) . '
'; - $output .= '
' . t('Creating custom blocks') . '
'; - $output .= '
' . t('Users with the Administer blocks permission can add custom blocks of each of their defined custom block types. Created custom blocks are then listed on the Blocks administration page.', array('!blocks' => \Drupal::url('block.admin_display'), '!block-add' => \Drupal::url('block_content.add_page'))) . '
'; + $output .= '
' . t('Creating and managing block content types') . '
'; + $output .= '
' . t('Users with the Administer blocks permission can create different block content types, each with different fields and display settings, from the Block content types page. The Custom block types page lists all of your created custom block types, and allows you to edit and manage them. For more information about managing fields and display settings, see the Field UI module help.', array('!types' => \Drupal::url('block_content.type_list'), '!field-ui' => \Drupal::url('help.page', array('name' => 'field_ui')))) . '
'; + $output .= '
' . t('Creating block content') . '
'; + $output .= '
' . t('Users with the Administer blocks permission can add block content of each of their defined block content types. Created custom blocks are then listed on the Blocks administration page.', array('!blocks' => \Drupal::url('block.admin_display'), '!block-add' => \Drupal::url('block_content.add_page'))) . '
'; $output .= '
'; return $output; @@ -64,7 +64,7 @@ function block_content_entity_type_alter(array &$entity_types) { } /** - * Adds the default body field to a custom block type. + * Adds the default body field to a block content type. * * @param string $block_type_id * Id of the block type. diff --git a/core/modules/block_content/block_content.pages.inc b/core/modules/block_content/block_content.pages.inc index 187ce68..ea4b0b5 100644 --- a/core/modules/block_content/block_content.pages.inc +++ b/core/modules/block_content/block_content.pages.inc @@ -2,7 +2,7 @@ /** * @file - * Provides page callbacks for custom blocks. + * Provides page callbacks for block content. */ use Drupal\Component\Utility\Xss; @@ -12,7 +12,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse; /** - * Prepares variables for a custom block type creation list templates. + * Prepares variables for a block content type creation list templates. * * Default template: block-content-add-list.html.twig. * diff --git a/core/modules/block_content/block_content.routing.yml b/core/modules/block_content/block_content.routing.yml index 1628b89..57e36cb 100644 --- a/core/modules/block_content/block_content.routing.yml +++ b/core/modules/block_content/block_content.routing.yml @@ -10,7 +10,7 @@ block_content.add_page: path: '/block/add' defaults: _content: '\Drupal\block_content\Controller\BlockContentController::add' - _title: 'Add custom block' + _title: 'Add block content' options: _admin_route: TRUE requirements: @@ -74,7 +74,7 @@ entity.block_content_type.edit_form: block_content.list: path: '/admin/structure/block/block-content' defaults: - _title: 'Custom block library' + _title: 'Block content library' _entity_list: 'block_content' requirements: _permission: 'administer blocks' diff --git a/core/modules/block_content/config/schema/block_content.schema.yml b/core/modules/block_content/config/schema/block_content.schema.yml index 2e7c338..b2ce7ea 100644 --- a/core/modules/block_content/config/schema/block_content.schema.yml +++ b/core/modules/block_content/config/schema/block_content.schema.yml @@ -1,8 +1,8 @@ -# Schema for the configuration files of the Custom Block module. +# Schema for the configuration files of the Block Content module. block_content.type.*: type: config_entity - label: 'Custom block type settings' + label: 'Block content type settings' mapping: id: type: string diff --git a/core/modules/block_content/src/BlockContentAccessControlHandler.php b/core/modules/block_content/src/BlockContentAccessControlHandler.php index e886432..e68762a 100644 --- a/core/modules/block_content/src/BlockContentAccessControlHandler.php +++ b/core/modules/block_content/src/BlockContentAccessControlHandler.php @@ -13,7 +13,7 @@ use Drupal\Core\Session\AccountInterface; /** - * Defines the access control handler for the custom block entity type. + * Defines the access control handler for the block content entity type. * * @see \Drupal\block_content\Entity\BlockContent */ diff --git a/core/modules/block_content/src/BlockContentForm.php b/core/modules/block_content/src/BlockContentForm.php index 769a7f3..d761003 100644 --- a/core/modules/block_content/src/BlockContentForm.php +++ b/core/modules/block_content/src/BlockContentForm.php @@ -16,12 +16,12 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Form controller for the custom block edit forms. + * Form controller for the block content edit forms. */ class BlockContentForm extends ContentEntityForm { /** - * The custom block storage. + * The block content storage. * * @var \Drupal\Core\Entity\EntityStorageInterface */ @@ -47,7 +47,7 @@ class BlockContentForm extends ContentEntityForm { * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager * The entity manager. * @param \Drupal\Core\Entity\EntityStorageInterface $block_content_storage - * The custom block storage. + * The block content storage. * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager * The language manager. */ @@ -72,7 +72,7 @@ public static function create(ContainerInterface $container) { /** * Overrides \Drupal\Core\Entity\EntityForm::prepareEntity(). * - * Prepares the custom block object. + * Prepares the block content object. * * Fills in a few default values, and then invokes hook_block_content_prepare() * on all modules. @@ -96,9 +96,9 @@ public function form(array $form, FormStateInterface $form_state) { $account = $this->currentUser(); if ($this->operation == 'edit') { - $form['#title'] = $this->t('Edit custom block %label', array('%label' => $block->label())); + $form['#title'] = $this->t('Edit block content %label', array('%label' => $block->label())); } - // Override the default CSS class name, since the user-defined custom block + // Override the default CSS class name, since the user-defined block content // type name in 'TYPE-block-form' potentially clashes with third-party class // names. $form['#attributes']['class'][0] = drupal_html_class('block-' . $block->bundle() . '-form'); diff --git a/core/modules/block_content/src/BlockContentInterface.php b/core/modules/block_content/src/BlockContentInterface.php index d6f981c..c677734 100644 --- a/core/modules/block_content/src/BlockContentInterface.php +++ b/core/modules/block_content/src/BlockContentInterface.php @@ -11,7 +11,7 @@ use Drupal\Core\Entity\EntityChangedInterface; /** - * Provides an interface defining a custom block entity. + * Provides an interface defining a block content entity. */ interface BlockContentInterface extends ContentEntityInterface, EntityChangedInterface { @@ -48,9 +48,9 @@ public function setRevisionLog($revision_log); /** * Sets the theme value. * - * When creating a new custom block from the block library, the user is + * When creating a new block content from the block library, the user is * redirected to the configure form for that block in the given theme. The - * theme is stored against the block when the custom block add form is shown. + * theme is stored against the block when the block content add form is shown. * * @param string $theme * The theme name. @@ -63,9 +63,9 @@ public function setTheme($theme); /** * Gets the theme value. * - * When creating a new custom block from the block library, the user is + * When creating a new block content from the block library, the user is * redirected to the configure form for that block in the given theme. The - * theme is stored against the block when the custom block add form is shown. + * theme is stored against the block when the block content add form is shown. * * @return string * The theme name. @@ -73,7 +73,7 @@ public function setTheme($theme); public function getTheme(); /** - * Gets the configured instances of this custom block. + * Gets the configured instances of this block content. * * @return array * Array of Drupal\block\Core\Plugin\Entity\Block entities. diff --git a/core/modules/block_content/src/BlockContentListBuilder.php b/core/modules/block_content/src/BlockContentListBuilder.php index 731f2da..a912a39 100644 --- a/core/modules/block_content/src/BlockContentListBuilder.php +++ b/core/modules/block_content/src/BlockContentListBuilder.php @@ -11,7 +11,7 @@ use Drupal\Core\Entity\EntityListBuilder; /** - * Defines a class to build a listing of custom block entities. + * Defines a class to build a listing of block content entities. * * @see \Drupal\block_content\Entity\BlockContent */ diff --git a/core/modules/block_content/src/BlockContentTranslationHandler.php b/core/modules/block_content/src/BlockContentTranslationHandler.php index ca7a6d9..35c49f8 100644 --- a/core/modules/block_content/src/BlockContentTranslationHandler.php +++ b/core/modules/block_content/src/BlockContentTranslationHandler.php @@ -12,7 +12,7 @@ use Drupal\Core\Form\FormStateInterface; /** - * Defines the translation handler for custom blocks. + * Defines the translation handler for block content. */ class BlockContentTranslationHandler extends ContentTranslationHandler { diff --git a/core/modules/block_content/src/BlockContentTypeForm.php b/core/modules/block_content/src/BlockContentTypeForm.php index 8927162..bd0d3b8 100644 --- a/core/modules/block_content/src/BlockContentTypeForm.php +++ b/core/modules/block_content/src/BlockContentTypeForm.php @@ -95,12 +95,12 @@ public function save(array $form, FormStateInterface $form_state) { $edit_link = $this->entity->link($this->t('Edit')); $logger = $this->logger('block_content'); if ($status == SAVED_UPDATED) { - drupal_set_message(t('Custom block type %label has been updated.', array('%label' => $block_type->label()))); - $logger->notice('Custom block type %label has been updated.', array('%label' => $block_type->label(), 'link' => $edit_link)); + drupal_set_message(t('Block content type %label has been updated.', array('%label' => $block_type->label()))); + $logger->notice('Block content type %label has been updated.', array('%label' => $block_type->label(), 'link' => $edit_link)); } else { - drupal_set_message(t('Custom block type %label has been added.', array('%label' => $block_type->label()))); - $logger->notice('Custom block type %label has been added.', array('%label' => $block_type->label(), 'link' => $edit_link)); + drupal_set_message(t('Block content type %label has been added.', array('%label' => $block_type->label()))); + $logger->notice('Block content type %label has been added.', array('%label' => $block_type->label(), 'link' => $edit_link)); } $form_state->setRedirect('block_content.type_list'); diff --git a/core/modules/block_content/src/BlockContentTypeInterface.php b/core/modules/block_content/src/BlockContentTypeInterface.php index cb21631..cfb9667 100644 --- a/core/modules/block_content/src/BlockContentTypeInterface.php +++ b/core/modules/block_content/src/BlockContentTypeInterface.php @@ -10,7 +10,7 @@ use Drupal\Core\Config\Entity\ConfigEntityInterface; /** - * Provides an interface defining a custom block type entity. + * Provides an interface defining a block content type entity. */ interface BlockContentTypeInterface extends ConfigEntityInterface { diff --git a/core/modules/block_content/src/BlockContentTypeListBuilder.php b/core/modules/block_content/src/BlockContentTypeListBuilder.php index 7af28b1..3efc6db 100644 --- a/core/modules/block_content/src/BlockContentTypeListBuilder.php +++ b/core/modules/block_content/src/BlockContentTypeListBuilder.php @@ -12,7 +12,7 @@ use Drupal\Core\Entity\EntityInterface; /** - * Defines a class to build a listing of custom block type entities. + * Defines a class to build a listing of block content type entities. * * @see \Drupal\block_content\Entity\BlockContentType */ @@ -53,7 +53,7 @@ public function buildRow(EntityInterface $entity) { * {@inheritdoc} */ protected function getTitle() { - return $this->t('Custom block types'); + return $this->t('Block content types'); } } diff --git a/core/modules/block_content/src/BlockContentViewBuilder.php b/core/modules/block_content/src/BlockContentViewBuilder.php index ff2a853..ef04b5d 100644 --- a/core/modules/block_content/src/BlockContentViewBuilder.php +++ b/core/modules/block_content/src/BlockContentViewBuilder.php @@ -12,7 +12,7 @@ use Drupal\Core\Entity\EntityViewBuilder; /** - * Render controller for custom blocks. + * Render controller for block content. */ class BlockContentViewBuilder extends EntityViewBuilder { @@ -21,7 +21,7 @@ class BlockContentViewBuilder extends EntityViewBuilder { */ protected function getBuildDefaults(EntityInterface $entity, $view_mode, $langcode) { $build = parent::getBuildDefaults($entity, $view_mode, $langcode); - // The custom block will be rendered in the wrapped block template already + // The block content will be rendered in the wrapped block template already // and thus has no entity template itself. unset($build['#theme']); return $build; @@ -32,7 +32,7 @@ protected function getBuildDefaults(EntityInterface $entity, $view_mode, $langco */ protected function alterBuild(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode, $langcode = NULL) { parent::alterBuild($build, $entity, $display, $view_mode, $langcode); - // Add contextual links for this custom block. + // Add contextual links for this block content. if (!$entity->isNew() && $view_mode == 'full') { $build['#contextual_links']['block_content'] = array( 'route_parameters' => array('block_content' => $entity->id()), diff --git a/core/modules/block_content/src/Controller/BlockContentController.php b/core/modules/block_content/src/Controller/BlockContentController.php index 4716bba..6c73f92 100644 --- a/core/modules/block_content/src/Controller/BlockContentController.php +++ b/core/modules/block_content/src/Controller/BlockContentController.php @@ -17,14 +17,14 @@ class BlockContentController extends ControllerBase { /** - * The custom block storage. + * The block content storage. * * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $blockContentStorage; /** - * The custom block type storage. + * The block content type storage. * * @var \Drupal\Core\Entity\EntityStorageInterface */ @@ -45,9 +45,9 @@ public static function create(ContainerInterface $container) { * Constructs a BlockContent object. * * @param \Drupal\Core\Entity\EntityStorageInterface $block_content_storage - * The custom block storage. + * The block content storage. * @param \Drupal\Core\Entity\EntityStorageInterface $block_content_type_storage - * The custom block type storage. + * The block content type storage. */ public function __construct(EntityStorageInterface $block_content_storage, EntityStorageInterface $block_content_type_storage) { $this->blockContentStorage = $block_content_storage; @@ -55,15 +55,15 @@ public function __construct(EntityStorageInterface $block_content_storage, Entit } /** - * Displays add custom block links for available types. + * Displays add block content links for available types. * * @param \Symfony\Component\HttpFoundation\Request $request * The current request object. * * @return array - * A render array for a list of the custom block types that can be added or - * if there is only one custom block type defined for the site, the function - * returns the custom block add page for that custom block type. + * A render array for a list of the block content types that can be added or + * if there is only one block content type defined for the site, the + * function returns the block content add page for that block content type. */ public function add(Request $request) { $types = $this->blockContentTypeStorage->loadMultiple(); @@ -76,10 +76,10 @@ public function add(Request $request) { } /** - * Presents the custom block creation form. + * Presents the block content creation form. * * @param \Drupal\block_content\BlockContentTypeInterface $block_content_type - * The custom block type to add. + * The block content type to add. * @param \Symfony\Component\HttpFoundation\Request $request * The current request object. * @@ -103,13 +103,13 @@ public function addForm(BlockContentTypeInterface $block_content_type, Request $ * Provides the page title for this controller. * * @param \Drupal\block_content\BlockContentTypeInterface $block_content_type - * The custom block type being added. + * The block content type being added. * * @return string * The page title. */ public function getAddFormTitle(BlockContentTypeInterface $block_content_type) { - return $this->t('Add %type custom block', array('%type' => $block_content_type->label())); + return $this->t('Add %type block content', array('%type' => $block_content_type->label())); } } diff --git a/core/modules/block_content/src/Entity/BlockContent.php b/core/modules/block_content/src/Entity/BlockContent.php index e2320bd..2190fee 100644 --- a/core/modules/block_content/src/Entity/BlockContent.php +++ b/core/modules/block_content/src/Entity/BlockContent.php @@ -14,12 +14,12 @@ use Drupal\block_content\BlockContentInterface; /** - * Defines the custom block entity class. + * Defines the block content entity class. * * @ContentEntityType( * id = "block_content", - * label = @Translation("Custom Block"), - * bundle_label = @Translation("Custom Block type"), + * label = @Translation("Block content"), + * bundle_label = @Translation("Block content type"), * handlers = { * "storage" = "Drupal\Core\Entity\Sql\SqlContentEntityStorage", * "storage_schema" = "Drupal\block_content\BlockContentStorageSchema", @@ -60,9 +60,9 @@ class BlockContent extends ContentEntityBase implements BlockContentInterface { /** * The theme the block is being created in. * - * When creating a new custom block from the block library, the user is + * When creating a new block content from the block library, the user is * redirected to the configure form for that block in the given theme. The - * theme is stored against the block when the custom block add form is shown. + * theme is stored against the block when the block content add form is shown. * * @var string */ @@ -99,7 +99,7 @@ public function getTheme() { public function postSave(EntityStorageInterface $storage, $update = TRUE) { parent::postSave($storage, $update); - // Invalidate the block cache to update custom block-based derivatives. + // Invalidate the block cache to update block content based derivatives. \Drupal::service('plugin.manager.block')->clearCachedDefinitions(); } @@ -139,14 +139,14 @@ public function delete() { */ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields['id'] = BaseFieldDefinition::create('integer') - ->setLabel(t('Custom block ID')) - ->setDescription(t('The custom block ID.')) + ->setLabel(t('Block content ID')) + ->setDescription(t('The block content ID.')) ->setReadOnly(TRUE) ->setSetting('unsigned', TRUE); $fields['uuid'] = BaseFieldDefinition::create('uuid') ->setLabel(t('UUID')) - ->setDescription(t('The custom block UUID.')) + ->setDescription(t('The block content UUID.')) ->setReadOnly(TRUE); $fields['revision_id'] = BaseFieldDefinition::create('integer') @@ -157,7 +157,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields['langcode'] = BaseFieldDefinition::create('language') ->setLabel(t('Language code')) - ->setDescription(t('The custom block language code.')) + ->setDescription(t('The block content language code.')) ->setRevisionable(TRUE); $fields['info'] = BaseFieldDefinition::create('string') @@ -184,7 +184,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields['changed'] = BaseFieldDefinition::create('changed') ->setLabel(t('Changed')) - ->setDescription(t('The time that the custom block was last edited.')) + ->setDescription(t('The time that the block content was last edited.')) ->setRevisionable(TRUE); return $fields; diff --git a/core/modules/block_content/src/Entity/BlockContentType.php b/core/modules/block_content/src/Entity/BlockContentType.php index 007ebfb..64e8186 100644 --- a/core/modules/block_content/src/Entity/BlockContentType.php +++ b/core/modules/block_content/src/Entity/BlockContentType.php @@ -13,11 +13,11 @@ use Drupal\block_content\BlockContentTypeInterface; /** - * Defines the custom block type entity. + * Defines the block content type entity. * * @ConfigEntityType( * id = "block_content_type", - * label = @Translation("Custom block type"), + * label = @Translation("Block content type"), * handlers = { * "form" = { * "default" = "Drupal\block_content\BlockContentTypeForm", @@ -43,21 +43,21 @@ class BlockContentType extends ConfigEntityBundleBase implements BlockContentTypeInterface { /** - * The custom block type ID. + * The block content type ID. * * @var string */ public $id; /** - * The custom block type label. + * The block content type label. * * @var string */ public $label; /** - * The default revision setting for custom blocks of this type. + * The default revision setting for block content of this type. * * @var bool */ diff --git a/core/modules/block_content/src/Form/BlockContentDeleteForm.php b/core/modules/block_content/src/Form/BlockContentDeleteForm.php index 1d7724d..0d226d8 100644 --- a/core/modules/block_content/src/Form/BlockContentDeleteForm.php +++ b/core/modules/block_content/src/Form/BlockContentDeleteForm.php @@ -12,7 +12,7 @@ use Drupal\Core\Url; /** - * Provides a confirmation form for deleting a custom block entity. + * Provides a confirmation form for deleting a block content entity. */ class BlockContentDeleteForm extends ContentEntityConfirmFormBase { @@ -56,8 +56,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { */ public function submitForm(array &$form, FormStateInterface $form_state) { $this->entity->delete(); - drupal_set_message($this->t('Custom block %label has been deleted.', array('%label' => $this->entity->label()))); - $this->logger('block_content')->notice('Custom block %label has been deleted.', array('%label' => $this->entity->label())); + drupal_set_message($this->t('Block content %label has been deleted.', array('%label' => $this->entity->label()))); + $this->logger('block_content')->notice('Block content %label has been deleted.', array('%label' => $this->entity->label())); $form_state->setRedirect('block_content.list'); } diff --git a/core/modules/block_content/src/Form/BlockContentTypeDeleteForm.php b/core/modules/block_content/src/Form/BlockContentTypeDeleteForm.php index 65fe352..d27f64f 100644 --- a/core/modules/block_content/src/Form/BlockContentTypeDeleteForm.php +++ b/core/modules/block_content/src/Form/BlockContentTypeDeleteForm.php @@ -14,7 +14,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Provides a confirmation form for deleting a custom block type entity. + * Provides a confirmation form for deleting a block content type entity. */ class BlockContentTypeDeleteForm extends EntityConfirmFormBase { @@ -71,7 +71,7 @@ public function getConfirmText() { public function buildForm(array $form, FormStateInterface $form_state) { $blocks = $this->queryFactory->get('block_content')->condition('type', $this->entity->id())->execute(); if (!empty($blocks)) { - $caption = '

' . format_plural(count($blocks), '%label is used by 1 custom block on your site. You can not remove this block type until you have removed all of the %label blocks.', '%label is used by @count custom blocks on your site. You may not remove %label until you have removed all of the %label custom blocks.', array('%label' => $this->entity->label())) . '

'; + $caption = '

' . format_plural(count($blocks), '%label is used by 1 block content on your site. You can not remove this block type until you have removed all of the %label blocks.', '%label is used by @count block content on your site. You may not remove %label until you have removed all of the %label block content.', array('%label' => $this->entity->label())) . '

'; $form['description'] = array('#markup' => $caption); return $form; } @@ -85,8 +85,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { */ public function submitForm(array &$form, FormStateInterface $form_state) { $this->entity->delete(); - drupal_set_message(t('Custom block type %label has been deleted.', array('%label' => $this->entity->label()))); - $this->logger('block_content')->notice('Custom block type %label has been deleted.', array('%label' => $this->entity->label())); + drupal_set_message(t('Block content type %label has been deleted.', array('%label' => $this->entity->label()))); + $this->logger('block_content')->notice('Block content type %label has been deleted.', array('%label' => $this->entity->label())); $form_state->setRedirectUrl($this->getCancelUrl()); } diff --git a/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php index 393ee45..b786783 100644 --- a/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php +++ b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php @@ -18,11 +18,11 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Defines a generic custom block type. + * Defines a generic block content type. * * @Block( * id = "block_content", - * admin_label = @Translation("Custom block"), + * admin_label = @Translation("block content"), * category = @Translation("Custom"), * deriver = "Drupal\block_content\Plugin\Derivative\BlockContent" * ) @@ -98,9 +98,9 @@ public function defaultConfiguration() { 'status' => TRUE, 'info' => '', 'view_mode' => 'full', - // Modify the default max age for custom block blocks: modifications made - // to them will automatically invalidate corresponding cache tags, thus - // allowing us to cache custom block blocks forever. + // Modify the default max age for block content: modifications made to + // them will automatically invalidate corresponding cache tags, thus + // allowing us to cache block content forever. 'cache' => array( 'max_age' => \Drupal\Core\Cache\Cache::PERMANENT, ), @@ -128,7 +128,7 @@ public function blockForm($form, FormStateInterface $form_state) { * {@inheritdoc} */ public function blockSubmit($form, FormStateInterface $form_state) { - // Invalidate the block cache to update custom block-based derivatives. + // Invalidate the block cache to update block content based derivatives. $this->configuration['view_mode'] = $form_state->getValue('view_mode'); $this->blockManager->clearCachedDefinitions(); } @@ -143,7 +143,7 @@ public function build() { } else { return array( - '#markup' => t('Block with uuid %uuid does not exist. Add custom block.', array( + '#markup' => t('Block with uuid %uuid does not exist. Add block content.', array( '%uuid' => $uuid, '!url' => $this->urlGenerator->generate('block_content.add_page') )), diff --git a/core/modules/block_content/src/Plugin/Derivative/BlockContent.php b/core/modules/block_content/src/Plugin/Derivative/BlockContent.php index 54ec325..2294efa 100644 --- a/core/modules/block_content/src/Plugin/Derivative/BlockContent.php +++ b/core/modules/block_content/src/Plugin/Derivative/BlockContent.php @@ -10,7 +10,7 @@ use Drupal\Component\Plugin\Derivative\DeriverBase; /** - * Retrieves block plugin definitions for all custom blocks. + * Retrieves block plugin definitions for all block content. */ class BlockContent extends DeriverBase { /** diff --git a/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php b/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php index e22425e..bcd8195 100644 --- a/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php +++ b/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php @@ -12,7 +12,7 @@ use Symfony\Component\HttpFoundation\Request; /** - * Modifies the 'Add custom block' local action. + * Modifies the 'Add block content' local action. */ class BlockContentAddLocalAction extends LocalActionDefault { @@ -25,11 +25,11 @@ public function getOptions(Request $request) { if ($request->attributes->has('theme')) { $options['query']['theme'] = $request->attributes->get('theme'); } - // Adds a destination on custom block listing. + // Adds a destination on block content listing. if ($request->attributes->get(RouteObjectInterface::ROUTE_NAME) == 'block_content.list') { $options['query']['destination'] = 'admin/structure/block/block-content'; } - // Adds a destination on custom block listing. + // Adds a destination on block content listing. if ($request->attributes->get(RouteObjectInterface::ROUTE_NAME) == 'block_content.list') { $options['query']['destination'] = 'admin/structure/block/block-content'; } diff --git a/core/modules/block_content/src/Tests/BlockContentCacheTagsTest.php b/core/modules/block_content/src/Tests/BlockContentCacheTagsTest.php index cc7ae4a..186d854 100644 --- a/core/modules/block_content/src/Tests/BlockContentCacheTagsTest.php +++ b/core/modules/block_content/src/Tests/BlockContentCacheTagsTest.php @@ -11,7 +11,7 @@ use Drupal\system\Tests\Entity\EntityCacheTagsTestBase; /** - * Tests the Custom Block entity's cache tags. + * Tests the Block Content entity's cache tags. * * @group block_content */ @@ -26,7 +26,7 @@ class BlockContentCacheTagsTest extends EntityCacheTagsTestBase { * {@inheritdoc} */ protected function createEntity() { - // Create a "Llama" custom block. + // Create a "Llama" block content. $block_content = entity_create('block_content', array( 'info' => 'Llama', 'type' => 'basic', diff --git a/core/modules/block_content/src/Tests/BlockContentCreationTest.php b/core/modules/block_content/src/Tests/BlockContentCreationTest.php index 0262dd4..bac7a81 100644 --- a/core/modules/block_content/src/Tests/BlockContentCreationTest.php +++ b/core/modules/block_content/src/Tests/BlockContentCreationTest.php @@ -77,7 +77,7 @@ public function testBlockContentCreation() { // Check that the block exists in the database. $blocks = entity_load_multiple_by_properties('block_content', array('info' => $edit['info[0][value]'])); $block = reset($blocks); - $this->assertTrue($block, 'Custom Block found in database.'); + $this->assertTrue($block, 'Block Content found in database.'); // Check that attempting to create another block with the same value for // 'info' returns an error. @@ -91,16 +91,16 @@ public function testBlockContentCreation() { } /** - * Create a default custom block. + * Create a default block content. * - * Creates a custom block from defaults and ensures that the 'basic block' + * Creates a block content from defaults and ensures that the 'basic block' * type is being used. */ public function testDefaultBlockContentCreation() { $edit = array(); $edit['info[0][value]'] = $this->randomMachineName(8); $edit['body[0][value]'] = $this->randomMachineName(16); - // Don't pass the custom block type in the url so the default is forced. + // Don't pass the block content type in the url so the default is forced. $this->drupalPostForm('block/add', $edit, t('Save')); // Check that the block has been created and that it is a basic block. @@ -112,7 +112,7 @@ public function testDefaultBlockContentCreation() { // Check that the block exists in the database. $blocks = entity_load_multiple_by_properties('block_content', array('info' => $edit['info[0][value]'])); $block = reset($blocks); - $this->assertTrue($block, 'Default Custom Block found in database.'); + $this->assertTrue($block, 'Default Block Content found in database.'); } /** @@ -187,7 +187,7 @@ public function testBlockDelete() { $this->assertText(format_plural(1, 'This will also remove 1 placed block instance.', 'This will also remove @count placed block instance.')); $this->drupalPostForm(NULL, array(), 'Delete'); - $this->assertRaw(t('Custom block %name has been deleted.', array('%name' => $edit['info[0][value]']))); + $this->assertRaw(t('Block content %name has been deleted.', array('%name' => $edit['info[0][value]']))); // Create another block and force the plugin cache to flush. $edit2 = array(); diff --git a/core/modules/block_content/src/Tests/BlockContentListTest.php b/core/modules/block_content/src/Tests/BlockContentListTest.php index 07a3299..f4f3ccc 100644 --- a/core/modules/block_content/src/Tests/BlockContentListTest.php +++ b/core/modules/block_content/src/Tests/BlockContentListTest.php @@ -10,7 +10,7 @@ use Drupal\simpletest\WebTestBase; /** - * Tests the listing of custom blocks. + * Tests the listing of block content. * * @group block_content * @see \Drupal\block\BlockContentListBuilder @@ -25,14 +25,14 @@ class BlockContentListTest extends WebTestBase { public static $modules = array('block', 'block_content', 'config_translation'); /** - * Tests the custom block listing page. + * Tests the block content listing page. */ public function testListing() { $this->drupalLogin($this->drupalCreateUser(array('administer blocks', 'translate configuration'))); $this->drupalGet('admin/structure/block/block-content'); // Test for the page title. - $this->assertTitle(t('Custom block library') . ' | Drupal'); + $this->assertTitle(t('Block content library') . ' | Drupal'); // Test for the table. $element = $this->xpath('//div[@class="layout-content"]//table'); @@ -51,7 +51,7 @@ public function testListing() { $label = 'Antelope'; $new_label = 'Albatross'; // Add a new entity using the operations link. - $link_text = t('Add custom block'); + $link_text = t('Add block content'); $this->assertLink($link_text); $this->clickLink($link_text); $this->assertResponse(200); @@ -82,7 +82,7 @@ public function testListing() { $this->assertLinkByHref('block/' . $block->id()); $this->clickLink(t('Edit')); $this->assertResponse(200); - $this->assertTitle(strip_tags(t('Edit custom block %label', array('%label' => $label)) . ' | Drupal')); + $this->assertTitle(strip_tags(t('Edit block content %label', array('%label' => $label)) . ' | Drupal')); $edit = array('info[0][value]' => $new_label); $this->drupalPostForm(NULL, $edit, t('Save')); } @@ -92,7 +92,7 @@ public function testListing() { // Confirm that once the user returns to the listing, the text of the label // (versus elsewhere on the page). - $this->assertFieldByXpath('//td', $new_label, 'Label found for updated custom block.'); + $this->assertFieldByXpath('//td', $new_label, 'Label found for updated block content.'); // Delete the added entity using the operations link. $this->assertLinkByHref('block/' . $block->id() . '/delete'); @@ -104,7 +104,7 @@ public function testListing() { // Verify that the text of the label and machine name does not appear in // the list (though it may appear elsewhere on the page). - $this->assertNoFieldByXpath('//td', $new_label, 'No label found for deleted custom block.'); + $this->assertNoFieldByXpath('//td', $new_label, 'No label found for deleted block content.'); // Confirm that the empty text is displayed. $this->assertText(t('There is no Custom Block yet.')); diff --git a/core/modules/block_content/src/Tests/BlockContentSaveTest.php b/core/modules/block_content/src/Tests/BlockContentSaveTest.php index f2a845b..1eb893a 100644 --- a/core/modules/block_content/src/Tests/BlockContentSaveTest.php +++ b/core/modules/block_content/src/Tests/BlockContentSaveTest.php @@ -33,10 +33,10 @@ protected function setUp() { } /** - * Checks whether custom block IDs are saved properly during an import. + * Checks whether block content IDs are saved properly during an import. */ public function testImport() { - // Custom block ID must be a number that is not in the database. + // Block content ID must be a number that is not in the database. $max_id = db_query('SELECT MAX(id) FROM {block_content}')->fetchField(); $test_id = $max_id + mt_rand(1000, 1000000); $info = $this->randomMachineName(8); @@ -55,7 +55,7 @@ public function testImport() { // Test the import saved. $block_by_id = BlockContent::load($test_id); - $this->assertTrue($block_by_id, 'Custom block load by block ID.'); + $this->assertTrue($block_by_id, 'Block content load by block ID.'); $this->assertIdentical($block_by_id->body->value, $block_array['body']['value']); } @@ -81,7 +81,7 @@ public function testDeterminingChanges() { // block_content_test_block_content_update() determine changes and change the // title as well as programatically set the 'changed' timestamp. $this->assertEqual($block->label(), 'updated_presave_update', 'Changes have been determined.'); - $this->assertEqual($block->getChangedTime(), 979534800, 'Saving a custom block uses "changed" timestamp set in presave hook.'); + $this->assertEqual($block->getChangedTime(), 979534800, 'Saving a block content uses "changed" timestamp set in presave hook.'); // Test the static block load cache to be cleared. $block = BlockContent::load($block->id()); @@ -101,7 +101,7 @@ public function testBlockContentSaveOnInsert() { // block_content_test_block_content_insert() triggers a save on insert if the // title equals 'new'. $block = $this->createBlockContent('new'); - $this->assertEqual($block->label(), 'BlockContent ' . $block->id(), 'Custom block saved on block insert.'); + $this->assertEqual($block->label(), 'BlockContent ' . $block->id(), 'Block content saved on block insert.'); } } diff --git a/core/modules/block_content/src/Tests/BlockContentTestBase.php b/core/modules/block_content/src/Tests/BlockContentTestBase.php index 5bb7122..d5fe7dc 100644 --- a/core/modules/block_content/src/Tests/BlockContentTestBase.php +++ b/core/modules/block_content/src/Tests/BlockContentTestBase.php @@ -51,7 +51,7 @@ protected function setUp() { } /** - * Creates a custom block. + * Creates a block content. * * @param string $title * (optional) Title of block. When no value is given uses a random name. @@ -60,7 +60,7 @@ protected function setUp() { * (optional) Bundle name. Defaults to 'basic'. * * @return \Drupal\block_content\Entity\BlockContent - * Created custom block. + * Created block content. */ protected function createBlockContent($title = FALSE, $bundle = 'basic') { $title = ($title ? : $this->randomMachineName()); @@ -75,13 +75,13 @@ protected function createBlockContent($title = FALSE, $bundle = 'basic') { } /** - * Creates a custom block type (bundle). + * Creates a block content type (bundle). * * @param string $label * The block type label. * * @return \Drupal\block_content\Entity\BlockContentType - * Created custom block type. + * Created block content type. */ protected function createBlockContentType($label) { $bundle = entity_create('block_content_type', array( diff --git a/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php b/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php index aec6f69..eb6b9c5 100644 --- a/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php +++ b/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php @@ -53,7 +53,7 @@ public function getTranslatorPermissions() { } /** - * Creates a custom block. + * Creates a block content. * * @param string $title * (optional) Title of block. When no value is given uses a random name. @@ -63,7 +63,7 @@ public function getTranslatorPermissions() { * $this->bundle. Defaults to FALSE. * * @return \Drupal\block_content\Entity\BlockContent - * Created custom block. + * Created block content. */ protected function createBlockContent($title = FALSE, $bundle = FALSE) { $title = ($title ? : $this->randomMachineName()); diff --git a/core/modules/block_content/src/Tests/BlockContentTypeTest.php b/core/modules/block_content/src/Tests/BlockContentTypeTest.php index 76dfdb7..cd35308 100644 --- a/core/modules/block_content/src/Tests/BlockContentTypeTest.php +++ b/core/modules/block_content/src/Tests/BlockContentTypeTest.php @@ -8,7 +8,7 @@ namespace Drupal\block_content\Tests; /** - * Ensures that custom block type functions work correctly. + * Ensures that block content type functions work correctly. * * @group block_content */ @@ -112,7 +112,7 @@ public function testBlockContentTypeDeletion() { // Attempt to delete the block type, which should not be allowed. $this->drupalGet('admin/structure/block/block-content/manage/' . $type->id() . '/delete'); $this->assertRaw( - t('%label is used by 1 custom block on your site. You can not remove this block type until you have removed all of the %label blocks.', array('%label' => $type->label())), + t('%label is used by 1 block content on your site. You can not remove this block type until you have removed all of the %label blocks.', array('%label' => $type->label())), 'The block type will not be deleted until all blocks of that type are removed.' ); $this->assertNoText(t('This action cannot be undone.'), 'The node type deletion confirmation form is not available.'); @@ -125,7 +125,7 @@ public function testBlockContentTypeDeletion() { t('Are you sure you want to delete %type?', array('%type' => $type->id())), 'The block type is available for deletion.' ); - $this->assertText(t('This action cannot be undone.'), 'The custom block type deletion confirmation form is available.'); + $this->assertText(t('This action cannot be undone.'), 'The block content type deletion confirmation form is available.'); } /** @@ -137,7 +137,7 @@ public function testsBlockContentAddTypes() { $type = $this->createBlockContentType('foo'); $type = $this->createBlockContentType('bar'); - // Get the custom block storage. + // Get the block content storage. $storage = $this->container ->get('entity.manager') ->getStorage('block_content'); @@ -158,7 +158,7 @@ public function testsBlockContentAddTypes() { // block configure form. $path = $theme == $default_theme ? 'admin/structure/block' : "admin/structure/block/list/$theme"; $this->drupalGet($path); - $this->clickLink(t('Add custom block')); + $this->clickLink(t('Add block content')); // The seven theme has markup inside the link, we cannot use clickLink(). if ($default_theme == 'seven') { $options = $theme != $default_theme ? array('query' => array('theme' => $theme)) : array(); @@ -184,10 +184,10 @@ public function testsBlockContentAddTypes() { } } - // Test that adding a block from the 'custom blocks list' doesn't send you + // Test that adding a block from the 'block content list' doesn't send you // to the block configure form. $this->drupalGet('admin/structure/block/block-content'); - $this->clickLink(t('Add custom block')); + $this->clickLink(t('Add block content')); $this->clickLink('foo'); $edit = array('info[0][value]' => $this->randomMachineName(8)); $this->drupalPostForm(NULL, $edit, t('Save')); diff --git a/core/modules/block_content/src/Tests/PageEditTest.php b/core/modules/block_content/src/Tests/PageEditTest.php index 3577547..1576e95 100644 --- a/core/modules/block_content/src/Tests/PageEditTest.php +++ b/core/modules/block_content/src/Tests/PageEditTest.php @@ -32,7 +32,7 @@ public function testPageEdit() { // Check that the block exists in the database. $blocks = \Drupal::entityQuery('block_content')->condition('info', $edit['info[0][value]'])->execute(); $block = entity_load('block_content', reset($blocks)); - $this->assertTrue($block, 'Custom block found in database.'); + $this->assertTrue($block, 'Block content found in database.'); // Load the edit page. $this->drupalGet('block/' . $block->id()); diff --git a/core/modules/block_content/templates/block-content-add-list.html.twig b/core/modules/block_content/templates/block-content-add-list.html.twig index e5a5d97..25f9f14 100644 --- a/core/modules/block_content/templates/block-content-add-list.html.twig +++ b/core/modules/block_content/templates/block-content-add-list.html.twig @@ -1,13 +1,13 @@ {# /** * @file - * Default theme implementation to present a list of custom block types. + * Default theme implementation to present a list of block content types. * * Available variables: - * - types: A collection of all the available custom block types. + * - types: A collection of all the available block content types. * Each block type contains the following: * - link: A link to add a block of this type. - * - description: A description of this custom block type. + * - description: A description of this block content type. * * @see template_preprocess_block_content_add_list() * diff --git a/core/modules/block_content/tests/modules/block_content_test/block_content_test.info.yml b/core/modules/block_content/tests/modules/block_content_test/block_content_test.info.yml index 747efa4..33d3877 100644 --- a/core/modules/block_content/tests/modules/block_content_test/block_content_test.info.yml +++ b/core/modules/block_content/tests/modules/block_content_test/block_content_test.info.yml @@ -1,6 +1,6 @@ -name: "Custom Block module tests" +name: "Block Content module tests" type: module -description: "Support module for custom block related testing." +description: "Support module for block content related testing." package: Testing version: VERSION core: 8.x diff --git a/core/modules/block_content/tests/modules/block_content_test/block_content_test.module b/core/modules/block_content/tests/modules/block_content_test/block_content_test.module index d714cb2..5fe791e 100644 --- a/core/modules/block_content/tests/modules/block_content_test/block_content_test.module +++ b/core/modules/block_content/tests/modules/block_content_test/block_content_test.module @@ -2,9 +2,9 @@ /** * @file - * A dummy module for testing custom block related hooks. + * A dummy module for testing block content related hooks. * - * This is a dummy module that implements custom block related hooks to test API + * This is a dummy module that implements block content related hooks to test API * interaction with the block_content module. */