summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/path/path.module
diff options
context:
space:
mode:
authorxjm <xjm@65776.no-reply.drupal.org>2017-03-03 19:20:24 -0600
committerxjm <xjm@65776.no-reply.drupal.org>2017-03-03 19:20:24 -0600
commit52e3eec616efab4d5201e30d085a09ba5c4817e6 (patch)
treed295cc8b862edc04018ba0e04ded752fd1a2f5c6 /core/modules/path/path.module
parent3aba956a39a4852f42cad8483e4e6e307bedbd0e (diff)
downloaddrupal-52e3eec616efab4d5201e30d085a09ba5c4817e6.tar.gz
drupal-52e3eec616efab4d5201e30d085a09ba5c4817e6.zip
Issue #2776975 by joelpittet, dawehner, tim.plunkett, xjm, pfrenssen: March 3, 2017: Convert core to array syntax coding standards for Drupal 8.3.x RC phase
Diffstat (limited to 'core/modules/path/path.module')
-rw-r--r--core/modules/path/path.module26
1 files changed, 13 insertions, 13 deletions
diff --git a/core/modules/path/path.module b/core/modules/path/path.module
index 182c6a9dd09..a724b773d6e 100644
--- a/core/modules/path/path.module
+++ b/core/modules/path/path.module
@@ -18,13 +18,13 @@ function path_help($route_name, RouteMatchInterface $route_match) {
case 'help.page.path':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
- $output .= '<p>' . t('The Path module allows you to specify an alias, or custom URL, for any existing internal system path. Aliases should not be confused with URL redirects, which allow you to forward a changed or inactive URL to a new URL. In addition to making URLs more readable, aliases also help search engines index content more effectively. Multiple aliases may be used for a single internal system path. To automate the aliasing of paths, you can install the contributed module <a href=":pathauto">Pathauto</a>. For more information, see the <a href=":path">online documentation for the Path module</a>.', array(':path' => 'https://www.drupal.org/documentation/modules/path', ':pathauto' => 'https://www.drupal.org/project/pathauto')) . '</p>';
+ $output .= '<p>' . t('The Path module allows you to specify an alias, or custom URL, for any existing internal system path. Aliases should not be confused with URL redirects, which allow you to forward a changed or inactive URL to a new URL. In addition to making URLs more readable, aliases also help search engines index content more effectively. Multiple aliases may be used for a single internal system path. To automate the aliasing of paths, you can install the contributed module <a href=":pathauto">Pathauto</a>. For more information, see the <a href=":path">online documentation for the Path module</a>.', [':path' => 'https://www.drupal.org/documentation/modules/path', ':pathauto' => 'https://www.drupal.org/project/pathauto']) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('Creating aliases') . '</dt>';
- $output .= '<dd>' . t('If you create or edit a taxonomy term you can add an alias (for example <em>music/jazz</em>) in the field "URL alias". When creating or editing content you can add an alias (for example <em>about-us/team</em>) under the section "URL path settings" in the field "URL alias". Aliases for any other path can be added through the page <a href=":aliases">URL aliases</a>. To add aliases a user needs the permission <a href=":permissions">Create and edit URL aliases</a>.', array(':aliases' => \Drupal::url('path.admin_overview'), ':permissions' => \Drupal::url('user.admin_permissions', array(), array('fragment' => 'module-path')))) . '</dd>';
+ $output .= '<dd>' . t('If you create or edit a taxonomy term you can add an alias (for example <em>music/jazz</em>) in the field "URL alias". When creating or editing content you can add an alias (for example <em>about-us/team</em>) under the section "URL path settings" in the field "URL alias". Aliases for any other path can be added through the page <a href=":aliases">URL aliases</a>. To add aliases a user needs the permission <a href=":permissions">Create and edit URL aliases</a>.', [':aliases' => \Drupal::url('path.admin_overview'), ':permissions' => \Drupal::url('user.admin_permissions', [], ['fragment' => 'module-path'])]) . '</dd>';
$output .= '<dt>' . t('Managing aliases') . '</dt>';
- $output .= '<dd>' . t('The Path module provides a way to search and view a <a href=":aliases">list of all aliases</a> that are in use on your website. Aliases can be added, edited and deleted through this list.', array(':aliases' => \Drupal::url('path.admin_overview'))) . '</dd>';
+ $output .= '<dd>' . t('The Path module provides a way to search and view a <a href=":aliases">list of all aliases</a> that are in use on your website. Aliases can be added, edited and deleted through this list.', [':aliases' => \Drupal::url('path.admin_overview')]) . '</dd>';
$output .= '</dl>';
return $output;
@@ -41,20 +41,20 @@ function path_help($route_name, RouteMatchInterface $route_match) {
*/
function path_form_node_form_alter(&$form, FormStateInterface $form_state) {
$node = $form_state->getFormObject()->getEntity();
- $form['path_settings'] = array(
+ $form['path_settings'] = [
'#type' => 'details',
'#title' => t('URL path settings'),
'#open' => !empty($form['path']['widget'][0]['alias']['#value']),
'#group' => 'advanced',
'#access' => !empty($form['path']['#access']) && $node->hasField('path') && $node->get('path')->access('edit'),
- '#attributes' => array(
- 'class' => array('path-form'),
- ),
- '#attached' => array(
- 'library' => array('path/drupal.path'),
- ),
+ '#attributes' => [
+ 'class' => ['path-form'],
+ ],
+ '#attached' => [
+ 'library' => ['path/drupal.path'],
+ ],
'#weight' => 30,
- );
+ ];
$form['path']['#group'] = 'path_settings';
}
@@ -66,10 +66,10 @@ function path_entity_base_field_info(EntityTypeInterface $entity_type) {
$fields['path'] = BaseFieldDefinition::create('path')
->setLabel(t('URL alias'))
->setTranslatable(TRUE)
- ->setDisplayOptions('form', array(
+ ->setDisplayOptions('form', [
'type' => 'path',
'weight' => 30,
- ))
+ ])
->setDisplayConfigurable('form', TRUE)
->setComputed(TRUE);