Index: mollom.pages.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.pages.inc,v
retrieving revision 1.1.2.7
diff -u -p -r1.1.2.7 mollom.pages.inc
--- mollom.pages.inc 9 Jan 2010 14:45:24 -0000 1.1.2.7
+++ mollom.pages.inc 30 Jan 2010 15:45:16 -0000
@@ -13,20 +13,56 @@
*/
function mollom_captcha_js($type, $session_id) {
$output = '';
+ $data = array('author_ip' => ip_address(), 'session_id' => $session_id);
- if ($type == 'audio') {
- $response = mollom('mollom.getAudioCaptcha', array('author_ip' => ip_address(), 'session_id' => $session_id));
- if ($response) {
- $output = '';
- $output .= ' (' . t('use image CAPTCHA') . ')';
- }
- }
- elseif ($type == 'image') {
- $response = mollom('mollom.getImageCaptcha', array('author_ip' => ip_address(), 'session_id' => $session_id));
- if ($response) {
- $output = '';
- $output .= ' (' . t('play audio CAPTCHA') . ')';
- }
+ switch ($type) {
+ case 'audio':
+ $response = mollom('mollom.getAudioCaptcha', $data);
+ if ($response) {
+ $url = check_plain($response['url']);
+ // OBJECT is used by IE.
+ // 'type' attribute required to make IE apply proprietary PARAMs below.
+ // @todo Windows Media Player on Mac may require application/x-mplayer2.
+ // @see https://www.microsoft.com/windows/windowsmedia/howto/articles/macicp.aspx
+ $output = '';
+
+ $output = '' . $output . '';
+ $output .= ' (' . t('use image CAPTCHA') . ')';
+ }
+ break;
+
+ case 'image':
+ $response = mollom('mollom.getImageCaptcha', $data);
+ if ($response) {
+ $output .= '';
+
+ $output = '' . $output . '';
+ $output .= ' (' . t('play audio CAPTCHA') . ')';
+ }
+ break;
}
print $output;
@@ -53,7 +89,19 @@ function mollom_report_form(&$form_state
'#type' => 'value',
'#value' => $id,
);
- $form['feedback'] = _mollom_feedback_options();
+ $form['feedback'] = array(
+ '#type' => 'radios',
+ '#title' => t('Optionally report this to Mollom'),
+ '#options' => array(
+ 'none' => t("Don't send feedback to Mollom"),
+ 'spam' => t('Report as spam or unsolicited advertising'),
+ 'profanity' => t('Report as obscene, violent or profane content'),
+ 'low-quality' => t('Report as low-quality content or writing'),
+ 'unwanted' => t('Report as unwanted, taunting or off-topic content'),
+ ),
+ '#default_value' => 'none',
+ '#description' => t("Mollom is a web service that helps you moderate your site's content: see http://mollom.com for more information. By sending feedback to Mollom, you teach Mollom about the content you like and dislike, allowing Mollom to do a better job helping you moderate your site's content. If you want to report multiple posts at once, you can use Mollom's bulk operations on the content and comment administration pages."),
+ );
return confirm_form($form,
t('Are you sure you want to delete and report the content as inappropriate?'),
@@ -105,21 +153,3 @@ function mollom_report_form_submit($form
}
}
-/**
- * Return a list of the possible feedback options for content.
- */
-function _mollom_feedback_options() {
- return array(
- '#type' => 'radios',
- '#title' => t('Optionally report this to Mollom'),
- '#options' => array(
- 'none' => t("Don't send feedback to Mollom"),
- 'spam' => t('Report as spam or unsolicited advertising'),
- 'profanity' => t('Report as obscene, violent or profane content'),
- 'low-quality' => t('Report as low-quality content or writing'),
- 'unwanted' => t('Report as unwanted, taunting or off-topic content'),
- ),
- '#default_value' => 'none',
- '#description' => t("Mollom is a web service that helps you moderate your site's content: see http://mollom.com for more information. By sending feedback to Mollom, you teach Mollom about the content you like and dislike, allowing Mollom to do a better job helping you moderate your site's content. If you want to report multiple posts at once, you can use Mollom's bulk operations on the content and comment administration pages."),
- );
-}