| 1 |
<?php |
<?php |
| 2 |
// $Id: cocomment.module,v 1.5 2008/01/16 22:12:35 sanduhrs Exp $ |
// $Id: cocomment.module,v 1.6 2008/01/17 10:13:23 sanduhrs Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* CoComment integration |
* CoComment integration |
| 30 |
function cocomment_comment($form, $op) { |
function cocomment_comment($form, $op) { |
| 31 |
global $base_url, $user; |
global $base_url, $user; |
| 32 |
|
|
| 33 |
if ($op == 'form') { |
if ($op == 'form' && $form['submit']) { |
| 34 |
//load necessary information |
//load necessary information |
| 35 |
$node = node_load($form['nid']['#value']); |
$node = node_load($form['nid']['#value']); |
| 36 |
|
|
| 51 |
drupal_add_js('coco = '. drupal_to_js($coco), 'inline'); |
drupal_add_js('coco = '. drupal_to_js($coco), 'inline'); |
| 52 |
|
|
| 53 |
//add cocomment's enabler.js to the site |
//add cocomment's enabler.js to the site |
| 54 |
//when submission is possible |
$item['cocomment'] = array( |
| 55 |
if ($form['submit']) { |
'#value' => '<script type="text/javascript" id="cocomment-fetchlet" src="http://www.cocomment.com/js/enabler.js"></script>', |
| 56 |
$item['cocomment'] = array( |
); |
|
'#value' => '<script type="text/javascript" id="cocomment-fetchlet" src="http://www.cocomment.com/js/enabler.js"></script>', |
|
|
); |
|
|
} |
|
| 57 |
|
|
| 58 |
return $item; |
return $item; |
| 59 |
} |
} |