| 1 |
<?php |
<?php |
| 2 |
// $Id: fasttoggle.toggle.inc,v 1.1 2007/10/07 12:44:04 timcn Exp $ |
// $Id: fasttoggle.toggle.inc,v 1.1.2.1 2008/11/08 11:09:20 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 |
| 41 |
// The action is not confirmed. The user came here through a regular link; |
// The action is not confirmed. The user came here through a regular link; |
| 42 |
// no AJAX was involved. That means, we need a confirmation form so that |
// no AJAX was involved. That means, we need a confirmation form so that |
| 43 |
// we get a POST form. |
// we get a POST form. |
| 44 |
return drupal_get_form('fasttoggle_node_option_confirm', $node, $options[$option][intval(!$node->$option)]); |
$labels = _fasttoggle_get_label('node_'. $option, FASTTOGGLE_LABEL_STATUS); |
| 45 |
|
return drupal_get_form('fasttoggle_node_option_confirm', $node, $labels[intval(!$node->$option)]); |
| 46 |
} |
} |
| 47 |
} |
} |
| 48 |
else { |
else { |
| 95 |
// The action is not confirmed. The user came here through a regular link; |
// The action is not confirmed. The user came here through a regular link; |
| 96 |
// no AJAX was involved. That means, we need a confirmation form so that |
// no AJAX was involved. That means, we need a confirmation form so that |
| 97 |
// we get a POST form. |
// we get a POST form. |
| 98 |
return drupal_get_form('fasttoggle_user_option_confirm', $user, $options[$option][intval(!$user->$option)]); |
$labels = _fasttoggle_get_label('user_'. $option, FASTTOGGLE_LABEL_STATUS); |
| 99 |
|
return drupal_get_form('fasttoggle_user_option_confirm', $user, $labels[intval(!$user->$option)]); |
| 100 |
} |
} |
| 101 |
} |
} |
| 102 |
else { |
else { |
| 153 |
// The action is not confirmed. The user came here through a regular link; |
// The action is not confirmed. The user came here through a regular link; |
| 154 |
// no AJAX was involved. That means, we need a confirmation form so that |
// no AJAX was involved. That means, we need a confirmation form so that |
| 155 |
// we get a POST form. |
// we get a POST form. |
| 156 |
return drupal_get_form('fasttoggle_comment_option_confirm', $comment, $options[$option][intval(!$comment->$option)]); |
$labels = _fasttoggle_get_label('comment_'. $option, FASTTOGGLE_LABEL_STATUS); |
| 157 |
|
return drupal_get_form('fasttoggle_comment_option_confirm', $comment, $labels[intval(!$comment->$option)]); |
| 158 |
} |
} |
| 159 |
} |
} |
| 160 |
else { |
else { |