/[drupal]/contributions/modules/fasttoggle/fasttoggle.toggle.inc
ViewVC logotype

Diff of /contributions/modules/fasttoggle/fasttoggle.toggle.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.2, Sat Nov 8 11:38:19 2008 UTC revision 1.1.2.3, Tue Feb 3 20:17:31 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: fasttoggle.toggle.inc,v 1.1.2.1 2008/11/08 11:09:20 timcn Exp $  // $Id: fasttoggle.toggle.inc,v 1.1.2.2 2008/11/08 11:38:19 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
# Line 20  function fasttoggle_node_option($node, $ Line 20  function fasttoggle_node_option($node, $
20        // Save the node.        // Save the node.
21        $node->$option = key($options[$option]);        $node->$option = key($options[$option]);
22        node_save($node);        node_save($node);
23    
24          // Let other modules respond.
25          module_invoke_all('fasttoggle_toggle', 'node', $node, $option);
26    
27        // Output the new status for the updated link text on AJAX changes        // Output the new status for the updated link text on AJAX changes
28        if (isset($_POST['javascript']) && $_POST['javascript']) {        if (isset($_POST['javascript']) && $_POST['javascript']) {
# Line 77  function fasttoggle_user_option($user, $ Line 80  function fasttoggle_user_option($user, $
80      if (isset($_POST['confirm']) && $_POST['confirm']) {      if (isset($_POST['confirm']) && $_POST['confirm']) {
81        $array = array($option => !$user->$option);        $array = array($option => !$user->$option);
82        $user = user_save($user, $array);        $user = user_save($user, $array);
83    
84          // Let other modules respond.
85          module_invoke_all('fasttoggle_toggle', 'user', $user, $option);
86    
87        // Output the new option for the updated link text on AJAX changes        // Output the new option for the updated link text on AJAX changes
88        if (isset($_POST['javascript']) && $_POST['javascript']) {        if (isset($_POST['javascript']) && $_POST['javascript']) {
# Line 132  function fasttoggle_comment_option($comm Line 138  function fasttoggle_comment_option($comm
138      if (isset($_POST['confirm']) && $_POST['confirm']) {      if (isset($_POST['confirm']) && $_POST['confirm']) {
139        $comment->$option = !$comment->$option;        $comment->$option = !$comment->$option;
140        comment_save((array)$comment);        comment_save((array)$comment);
141    
142          // Let other modules respond.
143          module_invoke_all('fasttoggle_toggle', 'comment', $comment, $option);
144    
145        // Output the new status for the updated link text on AJAX changes        // Output the new status for the updated link text on AJAX changes
146        if (isset($_POST['javascript']) && $_POST['javascript']) {        if (isset($_POST['javascript']) && $_POST['javascript']) {

Legend:
Removed from v.1.1.2.2  
changed lines
  Added in v.1.1.2.3

  ViewVC Help
Powered by ViewVC 1.1.2