You are here

function stringoverrides_help in String Overrides 5

Same name and namespace in other branches
  1. 6 stringoverrides.module \stringoverrides_help()
  2. 7 stringoverrides.module \stringoverrides_help()

Implementation of hook_help()

File

./stringoverrides.module, line 11
Configuration interface to provide a quick and easy way of replacing text.

Code

function stringoverrides_help($path) {
  $output = '';
  if ($path == 'admin/help#stringoverrides') {
    $output = '<p>' . t('The <strong>String Overrides</strong> module provides a quick and easy way of replacing text.') . '</p>';
    $output .= '<p>' . t('To replace a string, enter what you find when the string is passed through the <a href="@t">t()</a> function. String Overrides cannot translate user-defined content, it can only replace strings wrapped in the t() function. To find the strings you can actually change, open up a module and look for t() function calls. Places where %, @, or ! are used means that the translation contains dynamic information (such as the node type or title in the above examples), these are not translated while the text around them are.', array(
      '@t' => 'http://api.drupal.org/api/function/t',
    )) . '</p>';
    $output .= '<p>' . t('For example:') . '</p>';
    $output .= theme('item_list', array(
      'The %post has been updated.',
      'Are you sure you want to delete %title?',
      'Screenshot for %theme theme',
    ));
  }
  else {
    if (arg(0) == 'admin' && arg(1) == 'settings' && arg(2) == 'stringoverrides') {
      if (arg(3) == 'import') {
        $output = '<p>' . t('Upload a *.po file here to import a collection of strings.') . '</p>';
      }
      else {
        if (arg(3) == 'export') {
          $output = '<p>' . t('The following is a generated *.po file. You can use this feature to backup the current String Overrides.') . '</p>';
        }
        else {
          $output = '<p>' . t('The following provides quick and easy way of replacing text.') . '</p>';
        }
      }
    }
  }
  return $output;
}