You are here

function webform_protected_downloads_help in Webform Protected Downloads 7

Same name and namespace in other branches
  1. 6 webform_protected_downloads.module \webform_protected_downloads_help()

Implementation of hook_help().

File

./webform_protected_downloads.module, line 549
This file contains hook declarations and functions for the Webform Protected Downloads module.

Code

function webform_protected_downloads_help($path, $arg) {
  $output = '';
  switch ($path) {
    case 'admin/help#webform_protected_downloads':
      $output = t("<h3>Purpose of this module</h3>\n      This module is based on the webform module and lets you configure protected downloads, meaning files of any type that can be accessed by a user only after the user has submitted a webform with a valid e-mail address.\n\n      <h3>How it works</h3>\n      This module operates on nodes that are used as webforms. A webform node that has been configured for protected downloads acts just like a normal webform survey, expect that the user must give a valid e-mail address. After the user submits the webform an e-mail will be sent to the given e-mail address. This e-mail contains a link to a download page where all protected files are listed and can be downloaded from.\n      In order to use a webform node for protected downloads this node must meet the following criteria:\n      <ul>\n        <li>must have at least one file field that is configured as a private file field</li>\n        <li>at least one private file must have been attached to the node</li>\n        <li>the webform must have at least one mandatory e-mail component</li>\n      </ul>\n\n      <h3>Step-by-step guide to use this module</h3>\n      <ol>\n        <li><a href='@webform_help_url'>Create a webform</a></li>\n        <li>Add a a mandatory mail component to the webform</li>\n        <li>Add a file field for the created webform node and configure it as a private file field (see <em>Upload destination</em> under <em>File Field settings</em>)</li>\n        <li>Upload at least one file to this field using the node edit form</li>\n        <li>Go to the <em>Protected downloads</em> tab of the node and configure details like\n        <ul>\n          <li>how long should the download stay available for a given user</li>\n          <li>the mail text of the outgoing mail, including a placeholder for the download link</li>\n          <li>custom text that appears on the downloads page above the file listing</li>\n          <li>custom text for an access denied page</li>\n        </ul>\n        </li>\n      </ol>\n\n      <h3>How to send HTML formatted mails</h3>\n      The e-mails containing the access information for the protected files are send using default drupal mail functionality. That's why you should be able to use any mailengine that offers html support in order to send formatted mails. The only mailengine that has actively been tested in conjunction with this module is the <a href='@mimemail_project_url'>mimemail module</a>.\n\n      <h3>Having problems with the configuration? Here's the checklist:</h3>\n      <ul>\n        <li>Content type in question is webform enabled? Check your <a href='@webform_settings_url'>Webform settings</a>.</li>\n        <li>Content type has a file field that is configured as private?</li>\n        <li>On /node/NID/edit a file has been added to the aforementioned file field?</li>\n        <li>On node/NID/webform you have at least one component of type \"mail\" that is set as required?</li>\n        <li>The user you are logged in as, has the permission \"administer webform protected downloads\"?</li>\n      </ul>\n\n      <h3>Useful references</h3>\n      <ul>\n        <li><a href='@reference_files_url'>Working with files in Drupal 7</li>\n      </ul>", array(
        '@webform_settings_url' => url('admin/config/content/webform'),
        '@webform_help_url' => url('admin/help/webform'),
        '@mimemail_project_url' => url('http://drupal.org/project/mimemail'),
        '@reference_files_url' => url('http://drupal.org/documentation/modules/file'),
      ));
      break;
    case 'node/%/protected-downloads':
      $output .= '<p>' . t("This page displays files that are currently attached to this webform. You can select one or more of these files to be protected downloads. This means, that they won't be listed on the normal webform view page. Instead when the user submits the form, he receives an email to a given mail (you can choose any webform component of the type mail that you have already added to this webform) containing a link to download the protected file.") . '</p>';
      break;
  }
  return $output;
}