/[drupal]/contributions/modules/forward/forward.module
ViewVC logotype

Diff of /contributions/modules/forward/forward.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.55.2.26 by seanr, Tue Nov 3 22:51:59 2009 UTC revision 1.55.2.27 by seanr, Mon Nov 23 22:21:37 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  /* $Id: forward.module,v 1.94 2009/09/01 19:10:49 seanr Exp $ */  /* $Id: forward.module,v 1.55.2.26 2009/11/03 22:51:59 seanr Exp $ */
3    
4  /**  /**
5   * @file   * @file
# Line 198  function forward_admin_settings() { Line 198  function forward_admin_settings() {
198    $form['forward_options']['forward_sender_address'] = array(    $form['forward_options']['forward_sender_address'] = array(
199      '#type' => 'textfield',      '#type' => 'textfield',
200      '#title' => t('From address'),      '#title' => t('From address'),
201      '#default_value' => variable_get('forward_sender_address', ''),      '#default_value' => variable_get('forward_sender_address', variable_get('site_mail','')),
202      '#size' => 40,      '#size' => 40,
203      '#maxlength' => 40,      '#maxlength' => 40,
204      '#description' => t('If left blank, the from address entered in the form will be used as the from address for the email.  Enter a valid email address here to override that.  The sender\'s email will still appear in the body of the message.'),      '#description' => t('If left blank, the from address entered in the form will be used as the from address for the email.  Enter a valid email address here to override that.  The sender\'s email will still appear in the body of the message.'),
# Line 557  function forward_form(&$form_state, $pat Line 557  function forward_form(&$form_state, $pat
557    );    );
558    
559    if ($user->uid != 0) {    if ($user->uid != 0) {
560      $form['message']['yemail']['#default_value'] = $user->mail;      //$form['message']['yemail']['#default_value'] = $user->mail;
561      $form['message']['yemail']['#disabled'] = TRUE;      //$form['message']['yemail']['#disabled'] = TRUE;
562        $form['message']['yemail']['#type'] = 'hidden';
563      $form['message']['yemail']['#value'] = $user->mail;      $form['message']['yemail']['#value'] = $user->mail;
564      $form['message']['yname']['#default_value'] = $user->name;      $form['message']['yname']['#default_value'] = $user->name;
565    }    }
# Line 731  function forward_form_submit($form, &$fo Line 732  function forward_form_submit($form, &$fo
732    global $theme_key;    global $theme_key;
733    $theme_key = variable_get('theme_default', '');    $theme_key = variable_get('theme_default', '');
734    $logo = (variable_get('forward_header_image', '') == '') ? theme_get_setting('logo') : variable_get('forward_header_image', '');    $logo = (variable_get('forward_header_image', '') == '') ? theme_get_setting('logo') : variable_get('forward_header_image', '');
735    
736    $vars = array(    $vars = array(
737      'type' => $emailtype,      'type' => $emailtype,
738      'site_name' => check_plain(variable_get('site_name', 'Drupal')),      'site_name' => check_plain(variable_get('site_name', 'Drupal')),
# Line 749  function forward_form_submit($form, &$fo Line 750  function forward_form_submit($form, &$fo
750      // New values for forward.tpl.php      // New values for forward.tpl.php
751      'site_url' => url('forward/emailref', array('absolute' => TRUE, 'query' => 'path='.$returnurl.$form_state['values']['path_cid'])),      'site_url' => url('forward/emailref', array('absolute' => TRUE, 'query' => 'path='.$returnurl.$form_state['values']['path_cid'])),
752      'logo' => '<img src="'.url($logo, array('absolute' => TRUE)).'" alt="" />',      'logo' => '<img src="'.url($logo, array('absolute' => TRUE)).'" alt="" />',
753      'title' => ($emailtype == 'page') ? l($content->title, 'forward/emailref', array('absolute' => TRUE, 'query' => 'path='.$returnurl)) : FALSE,      'title' => ($emailtype == 'email') ? l($content->title, 'forward/emailref', array('absolute' => TRUE, 'query' => 'path='.$returnurl)) : FALSE,
754      'submitted' => (theme_get_setting('toggle_node_info_'.$content->type)) ? t('by %author', array('%author' => $content->name)) : FALSE,      'submitted' => (theme_get_setting('toggle_node_info_'.$content->type)) ? t('by %author', array('%author' => $content->name)) : FALSE,
755      'node' => ($emailtype == 'page') ? $content->teaser : FALSE,      'node' => ($emailtype == 'email') ? $content->teaser : FALSE,
756      'link' => ($emailtype == 'page') ? l(t('Click here to read more on our site'), 'forward/emailref', array('absolute' => TRUE, 'query' => 'path='.$returnurl.$form_state['values']['path_cid'])) : FALSE,      'link' => ($emailtype == 'email') ? l(t('Click here to read more on our site'), 'forward/emailref', array('absolute' => TRUE, 'query' => 'path='.$returnurl.$form_state['values']['path_cid'])) : FALSE,
757    );    );
758    
759    if (variable_get('forward_theme_template', 0)) {    if (variable_get('forward_theme_template', 0)) {
# Line 890  function forward_link($type, $node=0, $t Line 891  function forward_link($type, $node=0, $t
891    if ((($type == 'node' && variable_get('forward_display_'. $node->type, '1')) || $type == 'comment')    if ((($type == 'node' && variable_get('forward_display_'. $node->type, '1')) || $type == 'comment')
892      && user_access('access forward') && variable_get('forward_form_type', 'link') == 'link') {      && user_access('access forward') && variable_get('forward_form_type', 'link') == 'link') {
893      $links = array();      $links = array();
     // FIXME $type could not be 'system' due to condition above  
     //    if (($type == 'system')) {  
     //      // URL, page title, func called for page content, arg, 1 = don't disp menu  
     //      menu('forward', t('Email this page'), 'forward_page', 1, 1);  
     //    }  
894    
895      // This var is set in the settings section under the admin/modules/forward section      // This var is set in the settings section under the admin/modules/forward section
896      // It shows 'email this $nodetype' or 'email this page'      // It shows 'email this $nodetype' or 'email this page'

Legend:
Removed from v.1.55.2.26  
changed lines
  Added in v.1.55.2.27

  ViewVC Help
Powered by ViewVC 1.1.3