/[drupal]/contributions/modules/signit/signit.inc
ViewVC logotype

Diff of /contributions/modules/signit/signit.inc

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

revision 1.1.2.2, Wed Nov 28 18:08:29 2007 UTC revision 1.1.2.3, Thu Jan 3 01:47:49 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2    
3  // $Id:  // $Id: $
4    
5  /**  /**
6   * this file contains all the implementations of signit hook operations   * this file contains all the implementations of signit hook operations
7   * for the default operation of the module   * for the default operation of the module
# Line 14  Line 15 
15  /**  /**
16   * implementation of the hook_signit_messaging   * implementation of the hook_signit_messaging
17   */   */
18  function signit_signit_message($op, $data){  function signit_signit_message($op, $data = array()){
19    switch ($op) {    switch ($op) {
20      case 'admin':      case 'admin':
21        return signit_signit_message_admin();        return signit_signit_message_admin();
# Line 27  function signit_signit_message($op, $dat Line 28  function signit_signit_message($op, $dat
28  /**  /**
29   * generates the form for admining hook_signit_targets   * generates the form for admining hook_signit_targets
30   */   */
31  function signit_signit_message_admin($signit){  function signit_signit_message_admin() {
32    $form['signit_message_control'] = array(    $form['signit_message_control'] = array(
33      '#type' => 'checkbox',      '#type' => 'checkbox',
34      '#title' => 'SignIt creators can set the email options of their signit',      '#title' => 'SignIt creators can set the email options of their signit',
# Line 130  function signit_signit_targets_create($s Line 131  function signit_signit_targets_create($s
131      '#access' => variable_get('signit_target_title_set', false) ? true: false,      '#access' => variable_get('signit_target_title_set', false) ? true: false,
132    );    );
133    
134    // build the potential targets    // build the potential targets from list
135    // @ TODO    $addresses = explode("\n", variable_get('signit_targets_default',''));
136      // check all values to make sure we don't get any extra returns in
137      foreach($addresses as $address) {
138        $email = explode(',', $address);
139        if ($address) {$items[$email[0]] = $email[1] ? $email[1] : $email[0]; }
140      }
141    
142    // check the target settigns    // check the target settigns
143    switch (variable_get('signit_targets_set', 0)) {    switch (variable_get('signit_targets_set', 0)) {
# Line 147  function signit_signit_targets_create($s Line 153  function signit_signit_targets_create($s
153        $form['signit_targets_email_to'] = array(        $form['signit_targets_email_to'] = array(
154          '#type' => 'select',          '#type' => 'select',
155          '#title' => t('SignIt email targets'),          '#title' => t('SignIt email targets'),
156          '#default_value' => $addresses,          '#options' => $items,
157          '#description' => t('Enter email address and name seperated by comma, eg: "janedoe@janedoe.com, Jane Doe". Names are not needed, but will replace the email address on the display. Please note, changes to this do not effect already collected signatures.'),          '#description' => t('Enter email address and name seperated by comma, eg: "janedoe@janedoe.com, Jane Doe". Names are not needed, but will replace the email address on the display. Please note, changes to this do not effect already collected signatures.'),
158        );        );
159      break;      break;
# Line 156  function signit_signit_targets_create($s Line 162  function signit_signit_targets_create($s
162        $form['signit_targets_email_to'] = array(        $form['signit_targets_email_to'] = array(
163          '#type' => 'textarea',          '#type' => 'textarea',
164          '#title' => t('SignIt email targets'),          '#title' => t('SignIt email targets'),
165          '#default_value' => $addresses,          '#default_value' => $items,
166          '#description' => t('Enter email address and name seperated by comma, eg: "janedoe@janedoe.com, Jane Doe". Names are not needed, but will replace the email address on the display. Please note, changes to this do not effect already collected signatures.'),          '#description' => t('Enter email address and name seperated by comma, eg: "janedoe@janedoe.com, Jane Doe". Names are not needed, but will replace the email address on the display. Please note, changes to this do not effect already collected signatures.'),
167        );        );
168      break;      break;
169    }    }
170    
171    return $form;    return $form;
172  }  }
173    

Legend:
Removed from v.1.1.2.2  
changed lines
  Added in v.1.1.2.3

  ViewVC Help
Powered by ViewVC 1.1.2