You are here

function flag_lists_help in Flag Lists 4.0.x

Same name and namespace in other branches
  1. 8 flag_lists.module \flag_lists_help()

Implements hook_help().

File

./flag_lists.module, line 21
Contains flag_lists.module.

Code

function flag_lists_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {

    // Main module help for the flag_lists module.
    case 'help.page.flag_lists':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('The Flag Lists module handle collections (lists) of Flags.') . '</p>';
      $output .= '<p>' . t('When the Flag Lists module is installed a reasonable set of default configuration items are loaded. They are a default Flag collection for the entity type "node" and a connected bundle for the same. Also a page view and a block to show flag lists items are configured. The page view is activated by default but the block need to be added by hand.') . '</p>';
      $output .= '<p>' . t('In short, to use the Flag Lists module do the following:') . '</p>';
      $output .= '<ul><li>';
      $output .= t('Go to <a href=":flagging_collection"><em>My Flagging Collections</em></a>', [
        ':flagging_collection' => Url::fromRoute('entity.flagging_collection.collection')
          ->toString(),
      ]);
      $output .= '</li><li>';
      $output .= t('Click <a href=":add"><em>Add Flagging collection</em></a>', [
        ':add' => Url::fromRoute('entity.flagging_collection.add_page')
          ->toString(),
      ]);
      $output .= '</li><li>';
      $output .= t('Name the list and save it');
      $output .= '</li><li>';
      $output .= t("Now a link to add the entity to the Flag list is seen on the entities that the Flag List is connected with. By default these are all node's. If you need a Flag List for another entity a Flag must be created and marked as a Flag List template.");
      $output .= '</li></ul>';
      $url = Url::fromUri('https://www.drupal.org/docs/8/modules/flag-lists');
      $link = Link::fromTextAndUrl('Flag Lists', $url);
      $output .= '<p>';
      $output .= t('More detailed information on the usage of this module can be found on the Drupal documentation site under') . ' ';
      $output .= $link
        ->toString();
      $output .= '</p>';
      return $output;
    case 'entity.flag_for_list.collection':
      $output = '';
      $output .= '<h3>' . t('Templates for Flagging Collections') . '</h3>';
      $output .= '<p>' . t('The <em>Templates</em> you see here are the <em>Flags</em> you have marked as being available for usage as <em>templates for Flagging Collections</em> when you created the <em>Flag</em>.') . '</p>';
      $output .= '<p>' . t('All entities that match the specific combination of "Entity" and "Bundles" in the list below will have the <em>Flagging Collection</em> attached to them if the user created a <em>Flagging Collection</em> based on that Template.') . '</p>';
      $output .= '<p>' . t('The template chosen decide the feel, look and behaviour of the <em>Flagging Collection</em>.') . '</p>';
      return $output;
    case 'entity.flagging_collection.collection':
      $output = '';
      $output .= '<h3>' . t('Flagging Collections') . '</h3>';
      $output .= '<p>' . t('Below are all your accessible Flagging collections on this system.') . '</p>';
      return $output;
    case 'entity.flagging_collection_type.collection':
      $output = '';
      $output .= '<h3>' . t('Flag Collection Types') . '</h3>';
      $output .= '<p>' . t('Create and configure your Flag Collection Types. The Collection types will decide how your Flag Collections are presented and what field they will have') . '</p>';
      $output .= '<p>' . t('If you want to have extra field for each flagged item this is set under the corresponding <a href="@flag">flag</a>.', [
        '@flag' => Url::fromRoute('entity.flag.collection')
          ->toString(),
      ]) . '</p>';
      return $output;
    case 'entity.flag_list_item.collection':
      $output = '';
      $output .= '<h3>' . t('Flag List Item handling') . '</h3>';
      $output .= '<p>' . t('This page is <em>only</em> for fixing problems after importing flag list items from an earlier release of Drupal. It might be needed to delete some entries after an unsuccesful import. Please note that if some items needs to be deleted this indicates that something else has gone very wrong before the import of the old flag lists.') . '</p>';
      $output .= '<p>' . t('If you see only "Exist" in the "Entity exists?" column then everything is OK with your Flag lists.') . '</p>';
      return $output;
    default:
  }
}