| 1 |
<?php |
<?php |
| 2 |
// $Id$ |
// $Id: fasttoggle.toggle.inc,v 1.1 2007/10/07 12:44:04 timcn Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Menu callback. Toggle options for a node if the action is confirmed via |
* Menu callback. Toggle options for a node if the action is confirmed via |
| 29 |
'callback' => 'node', |
'callback' => 'node', |
| 30 |
'option' => $option, |
'option' => $option, |
| 31 |
'status' => $node->$option, |
'status' => $node->$option, |
| 32 |
|
'className' => 'fasttoggle-status-node-'. $option .'-'. intval($node->$option), |
| 33 |
)); |
)); |
| 34 |
exit; |
exit; |
| 35 |
} |
} |
| 82 |
drupal_set_header('Content-Type: text/javascript; charset=utf-8'); |
drupal_set_header('Content-Type: text/javascript; charset=utf-8'); |
| 83 |
echo drupal_to_js(array( |
echo drupal_to_js(array( |
| 84 |
'text' => $options[$option][intval($user->$option)], |
'text' => $options[$option][intval($user->$option)], |
| 85 |
|
'className' => 'fasttoggle-status-user-'. $option .'-'. intval($user->$option), |
| 86 |
)); |
)); |
| 87 |
exit; |
exit; |
| 88 |
} |
} |
| 139 |
'callback' => 'comment', |
'callback' => 'comment', |
| 140 |
'option' => $option, |
'option' => $option, |
| 141 |
'status' => $comment->$option, |
'status' => $comment->$option, |
| 142 |
|
'className' => 'fasttoggle-status-comment-'. $option .'-'. (1 - intval($comment->$option)), |
| 143 |
)); |
)); |
| 144 |
exit; |
exit; |
| 145 |
} |
} |