diff --git a/token.module b/token.module index 6470a25..4e55f7e 100644 --- a/token.module +++ b/token.module @@ -5,6 +5,7 @@ * Enhances the token API in core: adds a browseable UI, missing tokens, etc. */ +use Drupal\Core\Url; use Drupal\Component\Render\PlainTextOutput; use Drupal\Component\Utility\Unicode; use Drupal\Core\Block\BlockPluginInterface; @@ -36,8 +37,7 @@ function token_help($route_name, RouteMatchInterface $route_match) { $output .= '

' . t('Uses') . '

'; $output .= '

' . t('Your website uses a shared token system for exposing and using placeholder tokens and their appropriate replacement values. This allows for any module to provide placeholder tokens for strings without having to reinvent the wheel. It also ensures consistency in the syntax used for tokens, making the system as a whole easier for end users to use.') . '

'; $output .= '
'; - $output .= '
' . t('The list of the currently available tokens on this site are shown below.') . '
'; - $output .= '
' . \Drupal::service('renderer')->render($token_tree) . '
'; + $output .= '
' . t('You can also see the list of currently available tokens on the site.', array(':url' => Url::fromRoute('token.reports'))) . '
'; $output .= '
'; return $output; } diff --git a/token.routing.yml b/token.routing.yml index f2105ae..ce7c38b 100644 --- a/token.routing.yml +++ b/token.routing.yml @@ -20,3 +20,10 @@ token.flush_cache: _permission: 'flush caches' _csrf_token: 'TRUE' _module_dependencies: 'admin_menu' + +token.reports: + path: '/admin/reports/tokens' + defaults: + _controller: '\Drupal\token\Controller\AvailableTokens::content' + requirements: + _permission: 'administer token'