You are here

function forward_help in Forward 5

Same name and namespace in other branches
  1. 8.2 forward.module \forward_help()
  2. 4.x forward.module \forward_help()
  3. 4.0.x forward.module \forward_help()

Implementation of hook_help - adds link to non-node pages

File

./forward.module, line 742

Code

function forward_help($path) {
  if (user_access('access forward') && preg_match("/^node\\//i", $path) == 0 && variable_get('forward_display_nonnode', false)) {
    drupal_add_css(drupal_get_path('module', 'forward') . '/forward.css');
    $title = t(variable_get('forward_link_title', 'Email this !type'), array(
      '!type' => 'page',
    ));
    $img = drupal_get_path('module', 'forward') . '/forward.gif';
    $html = false;
    switch (variable_get('forward_link_style', 0)) {
      case 1:
        $title = theme('image', $img, $title, '', array(
          'class' => 'forward-icon',
        ));
        $html = true;
        break;
      case 2:
        $title = theme('image', $img, $title, '', array(
          'class' => 'forward-icon forward-icon-margin',
        )) . $title;
        $html = true;
        break;
    }
    $attributes = array(
      'title' => t('Forward this page to a friend'),
      'class' => 'forward-page',
    );
    $query = 'path=' . $path;
    return '<span class="forward">' . l($title, 'forward', $attributes, $query, NULL, NULL, $html) . '</span>';
  }
}