You are here

function customfilter_help in Custom filter 2.0.x

Same name and namespace in other branches
  1. 5 customfilter.module \customfilter_help()
  2. 6 customfilter.module \customfilter_help()
  3. 7.2 customfilter.module \customfilter_help()
  4. 7 customfilter.module \customfilter_help()

Implements hook_help().

File

./customfilter.module, line 15
Allows the users with the right permission to define custom filters.

Code

function customfilter_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.customfilter':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('The <em>customfilter</em> module allows users with the right permission to create custom filters. Those will be available as text format filters to be used in your content.</p>');
      $output .= '<h3>' . t('Uses') . '</h3>';
      $output .= '<dl>';
      $output .= '<dt>' . t('Configure your custom filters and rules:') . '</dt>';
      $output .= '<dd>' . t('<em>Filters</em> are made of <em>rules</em> and eventually <em>subrules</em>. Configure them on the <a href=":filters">filter administration page</a>.', [
        ':filters' => Url::fromRoute('entity.customfilter.list')
          ->toString(),
      ]) . '</dd>';
      $output .= '<dt>' . t('Use them in your text formats:') . '</dt>';
      $output .= '<dd>' . t('<em>Custom filters</em> can be used in the text formats to enhance your contents. Enable the filters you made by <a href=":formats">administrating text formats</a>.', [
        ':formats' => Url::fromRoute('filter.admin_overview')
          ->toString(),
      ]) . '</dd>';
      $output .= '</dl>';
      return $output;
    case 'entity.customfilter.list':
      $output = '<p>' . t('Custom filter provides the ability for creating user defined filters using regular expressions. Instead of creating filter modules, users can create their own filter for specific site purpose.') . '</p>';
      $output .= '<p>' . t('A filter is a collection of replacement rules. Each filter will appear in the input format settings page. Click on the filter name to see its replacement rules.') . '</p>';
      return $output;
    case 'customfilter.rules.add':
    case 'customfilter.rules.edit':
    case 'customfilter.rules.add.subrule':
      $output = '<p>' . t('For more information about the regular expressions syntax, see <a href="http://www.php.net/manual/en/regexp.reference.php">Regular expression details</a>.') . '</p>';
      return $output;
  }
}