Update core 8.3.0

This commit is contained in:
Rob Davies 2017-04-13 15:53:35 +01:00
parent da7a7918f8
commit cd7a898e66
6144 changed files with 132297 additions and 87747 deletions

View file

@ -48,7 +48,7 @@ function hook_help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_
switch ($route_name) {
// Main module help for the block module.
case 'help.page.block':
return '<p>' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Bartik, for example, implements the regions "Sidebar first", "Sidebar second", "Featured", "Content", "Header", "Footer", etc., and a block may appear in any one of these areas. The <a href=":blocks">blocks administration page</a> provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array(':blocks' => \Drupal::url('block.admin_display'))) . '</p>';
return '<p>' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Bartik, for example, implements the regions "Sidebar first", "Sidebar second", "Featured", "Content", "Header", "Footer", etc., and a block may appear in any one of these areas. The <a href=":blocks">blocks administration page</a> provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', [':blocks' => \Drupal::url('block.admin_display')]) . '</p>';
// Help for another path in the block module.
case 'block.admin_display':

View file

@ -17,27 +17,27 @@ function help_help($route_name, RouteMatchInterface $route_match) {
$output = '<h2>' . t('Getting Started') . '</h2>';
$output .= '<p>' . t('Follow these steps to set up and start using your website:') . '</p>';
$output .= '<ol>';
$output .= '<li>' . t('<strong>Configure your website</strong> Once logged in, visit the <a href=":admin">Administration page</a>, where you may <a href=":config">customize and configure</a> all aspects of your website.', array(':admin' => \Drupal::url('system.admin'), ':config' => \Drupal::url('system.admin_config'))) . '</li>';
$output .= '<li>' . t('<strong>Enable additional functionality</strong> Next, visit the <a href=":modules">Extend page</a> and enable modules that suit your specific needs. You can find additional modules at the <a href=":download_modules">Drupal.org modules page</a>.', array(':modules' => \Drupal::url('system.modules_list'), ':download_modules' => 'https://www.drupal.org/project/modules')) . '</li>';
$output .= '<li>' . t('<strong>Customize your website design</strong> To change the "look and feel" of your website, visit the <a href=":themes">Appearance page</a>. You may choose from one of the included themes or download additional themes from the <a href=":download_themes">Drupal.org themes page</a>.', array(':themes' => \Drupal::url('system.themes_page'), ':download_themes' => 'https://www.drupal.org/project/themes')) . '</li>';
$output .= '<li>' . t('<strong>Configure your website</strong> Once logged in, visit the <a href=":admin">Administration page</a>, where you may <a href=":config">customize and configure</a> all aspects of your website.', [':admin' => \Drupal::url('system.admin'), ':config' => \Drupal::url('system.admin_config')]) . '</li>';
$output .= '<li>' . t('<strong>Enable additional functionality</strong> Next, visit the <a href=":modules">Extend page</a> and enable modules that suit your specific needs. You can find additional modules at the <a href=":download_modules">Drupal.org modules page</a>.', [':modules' => \Drupal::url('system.modules_list'), ':download_modules' => 'https://www.drupal.org/project/modules']) . '</li>';
$output .= '<li>' . t('<strong>Customize your website design</strong> To change the "look and feel" of your website, visit the <a href=":themes">Appearance page</a>. You may choose from one of the included themes or download additional themes from the <a href=":download_themes">Drupal.org themes page</a>.', [':themes' => \Drupal::url('system.themes_page'), ':download_themes' => 'https://www.drupal.org/project/themes']) . '</li>';
// Display a link to the create content page if Node module is enabled.
if (\Drupal::moduleHandler()->moduleExists('node')) {
$output .= '<li>' . t('<strong>Start posting content</strong> Finally, you may <a href=":content">add new content</a> to your website.', array(':content' => \Drupal::url('node.add_page'))) . '</li>';
$output .= '<li>' . t('<strong>Start posting content</strong> Finally, you may <a href=":content">add new content</a> to your website.', [':content' => \Drupal::url('node.add_page')]) . '</li>';
}
$output .= '</ol>';
$output .= '<p>' . t('For more information, refer to the help listed on this page or to the <a href=":docs">online documentation</a> and <a href=":support">support</a> pages at <a href=":drupal">drupal.org</a>.', array(':docs' => 'https://www.drupal.org/documentation', ':support' => 'https://www.drupal.org/support', ':drupal' => 'https://www.drupal.org')) . '</p>';
$output .= '<p>' . t('For more information, refer to the help listed on this page or to the <a href=":docs">online documentation</a> and <a href=":support">support</a> pages at <a href=":drupal">drupal.org</a>.', [':docs' => 'https://www.drupal.org/documentation', ':support' => 'https://www.drupal.org/support', ':drupal' => 'https://www.drupal.org']) . '</p>';
return ['#markup' => $output];
case 'help.page.help':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Help module generates <a href=":help-page">Help reference pages</a> to guide you through the use and configuration of modules, and provides a Help block with page-level help. The reference pages are a starting point for <a href=":handbook">Drupal.org online documentation</a> pages that contain more extensive and up-to-date information, are annotated with user-contributed comments, and serve as the definitive reference point for all Drupal documentation. For more information, see the <a href=":help">online documentation for the Help module</a>.', array(':help' => 'https://www.drupal.org/documentation/modules/help/', ':handbook' => 'https://www.drupal.org/documentation', ':help-page' => \Drupal::url('help.main'))) . '</p>';
$output .= '<p>' . t('The Help module generates <a href=":help-page">Help reference pages</a> to guide you through the use and configuration of modules, and provides a Help block with page-level help. The reference pages are a starting point for <a href=":handbook">Drupal.org online documentation</a> pages that contain more extensive and up-to-date information, are annotated with user-contributed comments, and serve as the definitive reference point for all Drupal documentation. For more information, see the <a href=":help">online documentation for the Help module</a>.', [':help' => 'https://www.drupal.org/documentation/modules/help/', ':handbook' => 'https://www.drupal.org/documentation', ':help-page' => \Drupal::url('help.main')]) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('Providing a help reference') . '</dt>';
$output .= '<dd>' . t('The Help module displays explanations for using each module listed on the main <a href=":help">Help reference page</a>.', array(':help' => \Drupal::url('help.main'))) . '</dd>';
$output .= '<dd>' . t('The Help module displays explanations for using each module listed on the main <a href=":help">Help reference page</a>.', [':help' => \Drupal::url('help.main')]) . '</dd>';
$output .= '<dt>' . t('Providing page-specific help') . '</dt>';
$output .= '<dd>' . t('Page-specific help text provided by modules is displayed in the Help block. This block can be placed and configured on the <a href=":blocks">Block layout page</a>.', array(':blocks' => (\Drupal::moduleHandler()->moduleExists('block')) ? \Drupal::url('block.admin_display') : '#')) . '</dd>';
$output .= '<dd>' . t('Page-specific help text provided by modules is displayed in the Help block. This block can be placed and configured on the <a href=":blocks">Block layout page</a>.', [':blocks' => (\Drupal::moduleHandler()->moduleExists('block')) ? \Drupal::url('block.admin_display') : '#']) . '</dd>';
$output .= '</dl>';
return ['#markup' => $output];
}

View file

@ -112,7 +112,7 @@ class HelpController extends ControllerBase {
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*/
public function helpPage($name) {
$build = array();
$build = [];
if ($this->moduleHandler()->implementsHook($name, 'help')) {
$module_name = $this->moduleHandler()->getName($name);
$build['#title'] = $module_name;
@ -122,9 +122,9 @@ class HelpController extends ControllerBase {
drupal_set_message($this->t('This module is experimental. <a href=":url">Experimental modules</a> are provided for testing purposes only. Use at your own risk.', [':url' => 'https://www.drupal.org/core/experimental']), 'warning');
}
$temp = $this->moduleHandler()->invoke($name, 'help', array("help.page.$name", $this->routeMatch));
$temp = $this->moduleHandler()->invoke($name, 'help', ["help.page.$name", $this->routeMatch]);
if (empty($temp)) {
$build['top'] = ['#markup' => $this->t('No help is available for module %module.', array('%module' => $module_name))];
$build['top'] = ['#markup' => $this->t('No help is available for module %module.', ['%module' => $module_name])];
}
else {
if (!is_array($temp)) {
@ -137,20 +137,20 @@ class HelpController extends ControllerBase {
// any such pages associated with it.
$admin_tasks = system_get_module_admin_tasks($name, system_get_info('module', $name));
if (!empty($admin_tasks)) {
$links = array();
$links = [];
foreach ($admin_tasks as $task) {
$link['url'] = $task['url'];
$link['title'] = $task['title'];
$links[] = $link;
}
$build['links'] = array(
$build['links'] = [
'#theme' => 'links__help',
'#heading' => array(
'#heading' => [
'level' => 'h3',
'text' => $this->t('@module administration pages', array('@module' => $module_name)),
),
'text' => $this->t('@module administration pages', ['@module' => $module_name]),
],
'#links' => $links,
);
];
}
return $build;
}

View file

@ -27,21 +27,21 @@ class SupernovaGenerator implements UrlGeneratorInterface {
/**
* {@inheritdoc}
*/
public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH) {
public function generate($name, $parameters = [], $referenceType = self::ABSOLUTE_PATH) {
throw new \Exception();
}
/**
* {@inheritdoc}
*/
public function getPathFromRoute($name, $parameters = array()) {
public function getPathFromRoute($name, $parameters = []) {
throw new \Exception();
}
/**
* {@inheritdoc}
*/
public function generateFromRoute($name, $parameters = array(), $options = array(), $collect_bubbleable_metadata = FALSE) {
public function generateFromRoute($name, $parameters = [], $options = [], $collect_bubbleable_metadata = FALSE) {
throw new \Exception();
}
@ -55,7 +55,7 @@ class SupernovaGenerator implements UrlGeneratorInterface {
/**
* {@inheritdoc}
*/
public function getRouteDebugMessage($name, array $parameters = array()) {
public function getRouteDebugMessage($name, array $parameters = []) {
throw new \Exception();
}

View file

@ -19,7 +19,7 @@ class ExperimentalHelpTest extends BrowserTestBase {
*
* @var array
*/
public static $modules = array('help', 'experimental_module_test', 'help_page_test');
public static $modules = ['help', 'experimental_module_test', 'help_page_test'];
/**
* The admin user.

View file

@ -20,7 +20,7 @@ class HelpTest extends BrowserTestBase {
*
* @var array.
*/
public static $modules = array('help_test', 'help_page_test');
public static $modules = ['help_test', 'help_page_test'];
/**
* Use the Standard profile to test help implementations of many core modules.
@ -41,8 +41,8 @@ class HelpTest extends BrowserTestBase {
parent::setUp();
// Create users.
$this->adminUser = $this->drupalCreateUser(array('access administration pages', 'view the administration theme', 'administer permissions'));
$this->anyUser = $this->drupalCreateUser(array());
$this->adminUser = $this->drupalCreateUser(['access administration pages', 'view the administration theme', 'administer permissions']);
$this->anyUser = $this->drupalCreateUser([]);
}
/**
@ -61,7 +61,7 @@ class HelpTest extends BrowserTestBase {
// Verify that introductory help text exists, goes for 100% module coverage.
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/help');
$this->assertRaw(t('For more information, refer to the help listed on this page or to the <a href=":docs">online documentation</a> and <a href=":support">support</a> pages at <a href=":drupal">drupal.org</a>.', array(':docs' => 'https://www.drupal.org/documentation', ':support' => 'https://www.drupal.org/support', ':drupal' => 'https://www.drupal.org')));
$this->assertRaw(t('For more information, refer to the help listed on this page or to the <a href=":docs">online documentation</a> and <a href=":support">support</a> pages at <a href=":drupal">drupal.org</a>.', [':docs' => 'https://www.drupal.org/documentation', ':support' => 'https://www.drupal.org/support', ':drupal' => 'https://www.drupal.org']));
// Verify that hook_help() section title and description appear.
$this->assertRaw('<h2>' . t('Module overviews') . '</h2>');
@ -74,13 +74,13 @@ class HelpTest extends BrowserTestBase {
// Make sure links are properly added for modules implementing hook_help().
foreach ($this->getModuleList() as $module => $name) {
$this->assertLink($name, 0, format_string('Link properly added to @name (admin/help/@module)', array('@module' => $module, '@name' => $name)));
$this->assertLink($name, 0, format_string('Link properly added to @name (admin/help/@module)', ['@module' => $module, '@name' => $name]));
}
// Ensure that module which does not provide an module overview page is
// handled correctly.
$this->clickLink(\Drupal::moduleHandler()->getName('help_test'));
$this->assertRaw(t('No help is available for module %module.', array('%module' => \Drupal::moduleHandler()->getName('help_test'))));
$this->assertRaw(t('No help is available for module %module.', ['%module' => \Drupal::moduleHandler()->getName('help_test')]));
// Verify that the order of topics is alphabetical by displayed module
// name, by checking the order of some modules, including some that would
@ -119,11 +119,11 @@ class HelpTest extends BrowserTestBase {
$this->drupalGet('admin/help/' . $module);
$this->assertResponse($response);
if ($response == 200) {
$this->assertTitle($name . ' | Drupal', format_string('%module title was displayed', array('%module' => $module)));
$this->assertTitle($name . ' | Drupal', format_string('%module title was displayed', ['%module' => $module]));
$this->assertEquals($name, $this->cssSelect('h1.page-title')[0]->getText(), "$module heading was displayed");
$admin_tasks = system_get_module_admin_tasks($module, system_get_info('module', $module));
if (!empty($admin_tasks)) {
$this->assertText(t('@module administration pages', array('@module' => $name)));
$this->assertText(t('@module administration pages', ['@module' => $name]));
}
foreach ($admin_tasks as $task) {
$this->assertLink($task['title']);
@ -149,7 +149,7 @@ class HelpTest extends BrowserTestBase {
* A list of enabled modules.
*/
protected function getModuleList() {
$modules = array();
$modules = [];
$module_data = system_rebuild_module_data();
foreach (\Drupal::moduleHandler()->getImplementations('help') as $module) {
$modules[$module] = $module_data[$module]->info['name'];

View file

@ -18,7 +18,7 @@ class NoHelpTest extends BrowserTestBase {
*
* @var array.
*/
public static $modules = array('help', 'menu_test');
public static $modules = ['help', 'menu_test'];
/**
* The user who will be created.
@ -27,7 +27,7 @@ class NoHelpTest extends BrowserTestBase {
protected function setUp() {
parent::setUp();
$this->adminUser = $this->drupalCreateUser(array('access administration pages'));
$this->adminUser = $this->drupalCreateUser(['access administration pages']);
}
/**