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

Diff of /contributions/modules/tellafriend/tellafriend.module

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

revision 1.17, Thu Dec 25 22:05:48 2008 UTC revision 1.18, Sun Jan 4 16:38:21 2009 UTC
# Line 37  function tellafriend_perm() { Line 37  function tellafriend_perm() {
37  }  }
38    
39  /**  /**
40  * Implementation of hook_menu().   * Implementation of hook_menu().
41  */   */
42  function tellafriend_menu() {  function tellafriend_menu() {
43    $items = array();    $items = array();
44    
# Line 146  function tellafriend_settings() { Line 146  function tellafriend_settings() {
146      '#type' => 'radios',      '#type' => 'radios',
147      '#title' => t('Block style'),      '#title' => t('Block style'),
148      '#default_value' => variable_get('tellafriend_block_style', 0),      '#default_value' => variable_get('tellafriend_block_style', 0),
149      '#options' => array(0 => t('Link (Default)'), 1 => t('TextField(s)')),      '#options' => array(0 => t('Link (Default)'), 1 => t('TextField(s)  (option not avalaible yet)')),
150      '#description' => t('Select the visual style of the Block. "Link" will display a link to a page to be used by the user to send invitations, "TextField(s)" will display textfields boxes which user can fill with email(s) directly'),      '#description' => t('Select the visual style of the Block. "Link" will display a link to a page to be used by the user to send invitations, "TextField(s)" will display textfields boxes which user can fill with email(s) directly.'),
151    );    );
152    $form['tellafriend_block_options']['tellafriend_block_linklabel'] = array(    $form['tellafriend_block_options']['tellafriend_block_linklabel'] = array(
153      '#type' => 'textfield',      '#type' => 'textfield',
# Line 166  function tellafriend_settings() { Line 166  function tellafriend_settings() {
166      '#size' => 2,      '#size' => 2,
167      '#maxlength' => '2',      '#maxlength' => '2',
168    );    );
169    
170      $form['tellafriend_import'] = array(
171        '#type' => 'fieldset',
172        '#title' => t('Allow import of emails from addressbooks (Yahoo, Gmail, Plaxo, ....)'),
173        '#collapsible' => TRUE,
174        '#collapsed' => FALSE,
175        '#description' => t('Allow import emails from addressbooks (Yahoo, Gmail, Plaxo, ....). (Not avalaible yet)'),
176      );
177      $form['tellafriend_import']['tellafriend_import_yahoo'] = array(
178        '#type' => 'checkbox',
179        '#title' => t('From Yahoo'),
180        '#return_value' => 1,
181        '#default_value' => variable_get('tellafriend_import_yahoo', 0),
182      );
183      $form['tellafriend_import']['tellafriend_import_gmail'] = array(
184        '#type' => 'checkbox',
185        '#title' => t('From Gmail'),
186        '#return_value' => 1,
187        '#default_value' => variable_get('tellafriend_import_gmail', 0),
188      );
189      $form['tellafriend_import']['tellafriend_import_plaxo'] = array(
190        '#type' => 'checkbox',
191        '#title' => t('From Plaxo'),
192        '#return_value' => 1,
193        '#default_value' => variable_get('tellafriend_import_plaxo', 0),
194      );
195      $form['tellafriend_import']['tellafriend_import_linkedin'] = array(
196        '#type' => 'checkbox',
197        '#title' => t('From LinkedIn'),
198        '#return_value' => 1,
199        '#default_value' => variable_get('tellafriend_import_linkedin', 0),
200      );
201      $form['tellafriend_import']['tellafriend_import_facebook'] = array(
202        '#type' => 'checkbox',
203        '#title' => t('From Facebook'),
204        '#return_value' => 1,
205        '#default_value' => variable_get('tellafriend_import_facebook', 0),
206      );
207    
208    $form['tellafriend_mail'] = array(    $form['tellafriend_mail'] = array(
209      '#type' => 'fieldset',      '#type' => 'fieldset',
210      '#title' => t('E-mail template'),      '#title' => t('E-mail template'),
# Line 440  function tellafriend_page_submit($form, Line 479  function tellafriend_page_submit($form,
479    
480  //To be done : separate the send action from the function tellafriend_page_submit  //To be done : separate the send action from the function tellafriend_page_submit
481  function tellafriend_send_mail() {  function tellafriend_send_mail() {
   
482  }  }
483    
484  /**  /**
# Line 449  function tellafriend_send_mail() { Line 487  function tellafriend_send_mail() {
487  function tellafriend_mail($key, &$message, $params) {  function tellafriend_mail($key, &$message, $params) {
488    $message['from'] .= $params['from'];    $message['from'] .= $params['from'];
489    $message['subject'] = $params['subject'];    $message['subject'] = $params['subject'];
490    $message['body']    = $params['body'];    $message['body'] = $params['body'];
491    $message['headers'] = array_merge($message['headers'], $params['headers']);    $message['headers'] = array_merge($message['headers'], isset($params['headers']) ? $params['headers'] : array());
492    $message['headers']['MIME-Version'] = '1.0';    $message['headers']['MIME-Version'] = '1.0';
493    $message['headers']['Content-Type'] = 'text/html; charset=utf-8';    $message['headers']['Content-Type'] = 'text/html; charset=utf-8';
494  }  }

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.2