| 1 |
<?php |
<?php |
| 2 |
// $Id: comment_info.module,v 1.1.2.1.2.4 2007/03/20 22:07:39 mfer Exp $ |
// $Id: comment_info.module,v 1.1.2.1.2.5 2007/03/20 23:33:38 mfer Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 69 |
if ($user->uid || ($form_id != 'comment_form')) { |
if ($user->uid || ($form_id != 'comment_form')) { |
| 70 |
return; |
return; |
| 71 |
} |
} |
| 72 |
|
$form['comment_info']['optin'] = array( |
|
if (variable_get('comment_info_setting', 0) == 1 || variable_get('cache', CACHE_DISABLED) != CACHE_DISABLED) { |
|
|
drupal_add_js(drupal_get_path('module', 'comment_info').'/comment_info.js'); |
|
|
$form['comment_info']['optin'] = array( |
|
| 73 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
| 74 |
'#title' => t('Save my Comment Information for next time.'), |
'#title' => t('Save my Comment Information for next time.'), |
|
'#default_value' => $_SESSION['comment_info']['optin'] , |
|
|
'#attributes' => array('style' => 'display:none;'), |
|
| 75 |
); |
); |
| 76 |
|
if (variable_get('comment_info_setting', 0) == 1 || variable_get('cache', CACHE_DISABLED) != CACHE_DISABLED) { |
| 77 |
|
drupal_add_js(drupal_get_path('module', 'comment_info').'/comment_info.js'); |
| 78 |
|
$form['comment_info']['optin']['#attributes'] = array('style' => 'display:none;'); |
| 79 |
} |
} |
| 80 |
|
|
| 81 |
else { |
else { |
| 87 |
|
|
| 88 |
$form['#validate']['comment_info_validate'] = array(); |
$form['#validate']['comment_info_validate'] = array(); |
| 89 |
|
|
| 90 |
$form['comment_info']['optin'] = array( |
$form['comment_info']['optin']['#default_value'] = $_SESSION['comment_info']['optin']; |
|
'#type' => 'checkbox', |
|
|
'#title' => t('Save my Comment Information for next time.'), |
|
|
'#default_value' => $_SESSION['comment_info']['optin'] |
|
|
); |
|
| 91 |
} |
} |
| 92 |
} |
} |
| 93 |
|
|