Commit a074cc31 authored by Henrique Mendes's avatar Henrique Mendes Committed by Henrique Mendes
Browse files

Issue #3255339 by hmendes, marcusvsouza: Implement hook_help

parent 193a8f28
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -8,9 +8,37 @@
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Config\Entity\ConfigEntityInterface;
use Drupal\Core\Render\Element\PathElement;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Routing\TrustedRedirectResponse;
use Drupal\Core\Url;

/**
 * Implements hook_help().
 */
function entity_redirect_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.entity_redirect':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('The Entity Redirect module adds a configurable redirect after saving a node or other entity.The redirect is configurable per bundle. Also, given sufficient permissions (and presuming it is enabled for that specific content/bundle), individual users can configure their own redirects (on their profile edit page).') . '</p>';
      $output .= '<h3>' . t('Configuration') . '</h3>';
      $output .= '<p>' . t('Configuration can be accessed for each supported entity bundle on the edit page for that entity type. For example for the Node type Article that would be at /admin/structure/types/manage/article. The configuration will be in the publishing options section if available.');
      $output .= '<h3>' . t('Uses') . '</h3>';
      $output .= '<dl>';
      $output .= '<dt>' . t('Default') . '</dt>';
      $output .= '<dd>' . t('This will not impact the entity but will just go to the default.') . '</dd>';
      $output .= '<dt>' . t('Add Form') . '</dt>';
      $output .= '<dd>' . t('Redirect to a new add form for the content type/entity.') . ' </dd>';
      $output .= '<dt>' . t('Local Url') . '</dt>';
      $output .= '<dd>' . t('provide a local url in the form of /about to go to any page on the site.') . '</dd>';
      $output .= '<dt>' . t('External Url') . '</dt>';
      $output .= '<dd>' . t('Same as local url but to an external location. Note: this is only available to users with the permission set external entity redirects.') . '</dd>';
      $output .= '</dl>';
      return $output;
    default:
  }
}

/**
 * Implements hook_form_alter().
 */