| 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 |
| 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(); |
| 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', |
| 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)) { |
| 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; |
| 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 |
|
|