You are here

function quotes_help in Quotes 6

Same name and namespace in other branches
  1. 5 quotes.module \quotes_help()
  2. 7 quotes.module \quotes_help()

Implementation of hook_help().

File

./quotes.module, line 270
The quotes module allows users to maintain a list of quotes that can be displayed in any number of administrator-defined quote blocks.

Code

function quotes_help($path, $args = NULL) {
  $output = NULL;
  $fieldset = array(
    '#title' => t('Notes for importing'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#value' => t('
      <ul>
      <li>Tab-separated quotes should appear one quote per line in the format <em>
        <span style="color: blue;">quote</span>
        <span style="color: red;">&lt;tab&gt;</span>
        <span style="color: blue;">author</span>
        <span style="color: red;">&lt;tab&gt;</span>
        <span style="color: blue;">citation</span>
        </em>. The author and citation are optional. To import quotes, authors, or citations with more than one line, escape the embedded newlines with a backslash.
        <p>Examples:</p>
        <pre style="font-size: .8em;">
          <span style="color: blue;">Single-line quote.</span><em style="color: red;">&lt;tab&gt;</em><span style="color: blue;">Author</span><em style="color: red;">&lt;tab&gt;</em><span style="color: blue;">Citation</span>
          <span style="color: blue;">Quote without citation.</span><em style="color: red;">&lt;tab&gt;</em><span style="color: blue;">Author</span><em style="color: red;">&lt;tab&gt;</em>
          <span style="color: blue;">Quote without author or citation.</span><em style="color: red;">&lt;tab&gt;</em>
          <span style="color: blue;">Multi-line quote: line 1...\\
          ...line 2.</span><em style="color: red;">&lt;tab&gt;</em><span style="color: blue;">Author line 1\\
          Author line 2</span>
          <span style="color: blue;">Another quote.<em style="color: red;">&lt;tab&gt;</em><span style="color: blue;">Another Author</span>
        </pre>
      </li>
      <li>Fortune files do not explicitly provide an author or attribution
      for each quote/fortune. This import will extract an author when
      there is a line of the form <em>--Author</em> and will extract a citation
      when there is a line of the form <em>--Citation</em> respectively with any
      amount of leading whitespace. If a citation is used without an author
      then the author line has to be included or the citation will become the author.
        <p>Examples:</p>
        <pre style="font-size: .8em;">
        <span style="color: blue;">A fortune without an author.</span>
        <em style="color: red;">%</em>
        <span style="color: blue;">Fortune with author.</span>
        --<span style="color: blue;"> Author</span>
        <em style="color: red;">%</em>
        <span style="color: blue;">Fortune with author and citation.</span>
        --<span style="color: blue;"> Author</span>
        --<span style="color: blue;"> Citation</span>
        <em style="color: red;">%</em>
        <span style="color: blue;">Fortune without author and citation.</span>
        --<span style="color: blue;"> </span>
        --<span style="color: blue;"> Citation</span>
        <em style="color: red;">%</em>
      <span style="color: blue;">Multi-line fortune: line 1...
      ...line 2.</span>
      -- <span style="color: blue;"> Author line 1
      Author line 2</span>
      </pre>
      </li>
      <li>Any settings used in the form below (comment, moderation, sticky, input format, categories, etc.) will be applied to all imported quotes.</li>
      <li>The title entered below will be applied to all quotes. You can use the variable <em>%id</em> in the title which will be replaced by the newly-created quote\'s node ID.</li>
      <li>Fortune files and tab-separated text data can contain many quotes. To avoid timeout errors while importing large amounts of data, consider importing in smaller chunks with no more than 1000 quotes at a time.</li>
      <li>If the path module is enabled, you cannot create a path alias while importing, as the import will attempt to use the same path for every quote.</li></ul>'),
    '#children' => '',
  );
  switch ($path) {
    case 'node/add#quotes':
      return t('A quote is a famous, infamous, humorous, witty, or otherwise noteworthy quotation or fortune file entry. Quotes can be entered one at a time or mass imported in either tab-separated text or fortune file format.');
    case 'node/add/quotes':
      if (arg(3) == 'import') {
        $output .= t('<p>Use the form below to mass import quotes in either tab-separated text or fortune file format. Many quotes will be imported in this one step by creating an individual node for each imported quote. Expand the %Notes section below for more information.</p>', array(
          '%Notes' => t('Notes'),
        ));
        $output .= theme('fieldset', $fieldset);
      }
      else {
        $output .= t('Use the form below to enter a single quote.') . (user_access('import quotes') ? ' ' . t('Multiple quotes can also be !mass imported in either tab-separted text or fortune file format.', array(
          '!mass imported' => l(t('mass imported'), 'node/add/quotes/import'),
        )) : '');
      }
      return $output;
    case 'admin/settings/quotes':
      $text = t('This page displays the status of, and settings for, the quotes module. The permissions for this module are found !here.', array(
        '!here' => l(t('here'), 'admin/user/permissions'),
      ));
      $text .= '<p>Version: ' . QUOTES_VERSION . '</p>';
      return $text;
    case 'admin/settings/quotes/blocks':
      return t('You can define any number of blocks that will each display a randomly-selected quote, the most-recent quotes, or unpublished quotes. The quotes displayed in each block can be restricted to certain node IDs, roles, users, or categories. Each block has a name that is used for identification on the !block administration page and as the default title when the block is displayed.', array(
        '!block administration page' => l(t('block administration page'), 'admin/build/block'),
      ));
    case 'admin/settings/quotes/add':
      return t('Use the form below to define a new quote block.');
    case 'admin/help#quotes':
      return t('The quotes module allows users to maintain a list of quotations that they find notable, humorous, famous, infamous, or otherwise worthy of sharing with website visitors. The quotes can be displayed in any number of administrator-defined blocks. These blocks will display quotes based on the restrictions of each block. Blocks can be configured to restrict to certain nodes, roles, users, or categories.');
  }
}