comparison core/modules/settings_tray/settings_tray.module @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
3 /** 3 /**
4 * @file 4 * @file
5 * Allows configuring blocks and other configuration from the site front-end. 5 * Allows configuring blocks and other configuration from the site front-end.
6 */ 6 */
7 7
8 use Drupal\Core\Url;
8 use Drupal\Core\Asset\AttachedAssetsInterface; 9 use Drupal\Core\Asset\AttachedAssetsInterface;
9 use Drupal\Core\Routing\RouteMatchInterface; 10 use Drupal\Core\Routing\RouteMatchInterface;
10 use Drupal\block\entity\Block; 11 use Drupal\block\entity\Block;
11 use Drupal\block\BlockInterface; 12 use Drupal\block\BlockInterface;
12 use Drupal\settings_tray\Block\BlockEntitySettingTrayForm; 13 use Drupal\settings_tray\Block\BlockEntitySettingTrayForm;
16 */ 17 */
17 function settings_tray_help($route_name, RouteMatchInterface $route_match) { 18 function settings_tray_help($route_name, RouteMatchInterface $route_match) {
18 switch ($route_name) { 19 switch ($route_name) {
19 case 'help.page.settings_tray': 20 case 'help.page.settings_tray':
20 $output = '<h3>' . t('About') . '</h3>'; 21 $output = '<h3>' . t('About') . '</h3>';
21 $output .= '<p>' . t('The Settings Tray module allows users with the <a href=":administer_block_permission">Administer blocks</a> and <a href=":contextual_permission">Use contextual links</a> permissions to edit blocks without visiting a separate page. For more information, see the <a href=":handbook_url">online documentation for the Settings Tray module</a>.', [':handbook_url' => 'https://www.drupal.org/documentation/modules/settings_tray', ':administer_block_permission' => \Drupal::url('user.admin_permissions', [], ['fragment' => 'module-block']), ':contextual_permission' => \Drupal::url('user.admin_permissions', [], ['fragment' => 'module-contextual'])]) . '</p>'; 22 $output .= '<p>' . t('The Settings Tray module allows users with the <a href=":administer_block_permission">Administer blocks</a> and <a href=":contextual_permission">Use contextual links</a> permissions to edit blocks without visiting a separate page. For more information, see the <a href=":handbook_url">online documentation for the Settings Tray module</a>.', [':handbook_url' => 'https://www.drupal.org/documentation/modules/settings_tray', ':administer_block_permission' => Url::fromRoute('user.admin_permissions', [], ['fragment' => 'module-block'])->toString(), ':contextual_permission' => Url::fromRoute('user.admin_permissions', [], ['fragment' => 'module-contextual'])->toString()]) . '</p>';
22 $output .= '<h3>' . t('Uses') . '</h3>'; 23 $output .= '<h3>' . t('Uses') . '</h3>';
23 $output .= '<dl>'; 24 $output .= '<dl>';
24 $output .= '<dt>' . t('Editing blocks in place') . '</dt>'; 25 $output .= '<dt>' . t('Editing blocks in place') . '</dt>';
25 $output .= '<dd>'; 26 $output .= '<dd>';
26 $output .= '<p>' . t('To edit blocks in place, either click the <strong>Edit</strong> button in the toolbar and then click on the block, or choose "Quick edit" from the block\'s contextual link. (See the <a href=":contextual">Contextual Links module help</a> for more information about how to use contextual links.)', [':contextual' => \Drupal::url('help.page', ['name' => 'contextual'])]) . '</p>'; 27 $output .= '<p>' . t('To edit blocks in place, either click the <strong>Edit</strong> button in the toolbar and then click on the block, or choose "Quick edit" from the block\'s contextual link. (See the <a href=":contextual">Contextual Links module help</a> for more information about how to use contextual links.)', [':contextual' => Url::fromRoute('help.page', ['name' => 'contextual'])->toString()]) . '</p>';
27 $output .= '<p>' . t('The Settings Tray for the block will open in a sidebar, with a compact form for configuring what the block shows.') . '</p>'; 28 $output .= '<p>' . t('The Settings Tray for the block will open in a sidebar, with a compact form for configuring what the block shows.') . '</p>';
28 $output .= '<p>' . t('Save the form and the changes will be immediately visible on the page.') . '</p>'; 29 $output .= '<p>' . t('Save the form and the changes will be immediately visible on the page.') . '</p>';
29 $output .= '</dd>'; 30 $output .= '</dd>';
30 $output .= '</dl>'; 31 $output .= '</dl>';
31 return ['#markup' => $output]; 32 return ['#markup' => $output];