You are here

forward.theme in Forward 6

Same filename and directory in other branches
  1. 5 forward.theme
  2. 7 forward.theme
  3. 7.2 forward.theme

File

forward.theme
View source
<?php

/**
 * @addtogroup themeable
 * @{
 */

/**
 * Theme page output for forward form.
 *
 * @param form
 *  A fully rendered form.
 * @param node
 *  The node object being forwarded.
 */
function theme_forward_page($form, $node = NULL) {
  return $form;
}

/**
 * Format emails
 *
 * @param vars
 *   An array of email variables
 */
function theme_forward_email($vars) {
  $output = '
<html>
  <body>
    <table width="400" cellspacing="0" cellpadding="10" border="0">
      <thead>
        <tr><td><h1 style="font-family: Arial, Helvetica, sans-serif; font-size: 18px;">' . l($vars['logo'] . ' ' . $vars['site_name'], 'forward/emailref', array(
    'absolute' => TRUE,
    'query' => 'path=' . $vars['path'],
    'html' => TRUE,
  )) . '</h1></td></tr>
      </thead>
      <tbody>
        <tr>
          <td style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;">' . $vars['forward_message'];
  if ($vars['message']) {
    $output .= '<p>' . t('Message from Sender') . ':</p><p>' . $vars['message'] . '</p>';
  }
  $output .= '<h2 style="font-size: 14px;">' . l($vars['content']->title, 'forward/emailref', array(
    'absolute' => TRUE,
    'query' => 'path=' . $vars['path'],
  )) . '</h2>';
  if (theme_get_setting('toggle_node_info_' . $vars['content']->type)) {
    $output .= '<p><em>' . (!empty($vars['content']->name) ? t('by %author', array(
      '%author' => $vars['content']->name,
    )) : t('by %author', array(
      '%author' => variable_get('anonymous', 'Anonymous'),
    ))) . '</em></p>';
  }
  $output .= '<div>' . $vars['content']->teaser . '</div><p>' . l(t('Click here to read more on our site'), 'forward/emailref', array(
    'absolute' => TRUE,
    'query' => 'path=' . $vars['path'],
  )) . '</p>';
  $output .= '
          </td>
        </tr>
        <tr><td style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;">' . $vars['dynamic_content'] . '</td></tr>
        <tr><td style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;">' . $vars['forward_ad_footer'] . '</td></tr>
        <tr><td style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;">' . $vars['forward_footer'] . '</td></tr>
      </tbody>
    </table>
  </body>
</html>
  ';
  return $output;
}

/**
 * Format the e-postcards
 *
 * @param vars
 *   An array of email variables
 */
function theme_forward_postcard($vars) {
  $output = '
<html>
  <body>
    <table width="400" cellspacing="0" cellpadding="10" border="0">
      <thead>
        <tr><td><h1 style="font-family: Arial, Helvetica, sans-serif; font-size: 18px;">' . l($vars['logo'] . ' ' . $vars['site_name'], 'forward/emailref', array(
    'absolute' => TRUE,
    'query' => 'path=' . variable_get('site_frontpage', 'node'),
    'html' => TRUE,
  )) . '</h1></td></tr>
      </thead>
      <tbody>
        <tr>
          <td style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;">' . $vars['forward_message'];
  if ($vars['message']) {
    $output .= '<p>' . t('Message from Sender') . ':</p><p>' . $vars['message'] . '</p>';
  }
  $output .= '<p>' . l(t('Click here to read more on our site'), 'forward/emailref', array(
    'absolute' => TRUE,
    'query' => 'path=' . variable_get('site_frontpage', 'node'),
  )) . '</p>';
  $output .= '
          </td>
        </tr>
        <tr><td style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;">' . $vars['dynamic_content'] . '</td></tr>
        <tr><td style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;">' . $vars['forward_ad_footer'] . '</td></tr>
        <tr><td style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;">' . $vars['forward_footer'] . '</td></tr>
      </tbody>
    </table>
  </body>
</html>
  ';
  return $output;
}

Functions

Namesort descending Description
theme_forward_email Format emails
theme_forward_page Theme page output for forward form.
theme_forward_postcard Format the e-postcards