/[Arh]/lib/Arh/Action/ToggleEdit.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/Arh/Action/ToggleEdit.pm

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

revision 59 by dpavlin, Fri Dec 14 14:39:05 2007 UTC revision 60 by dpavlin, Mon Apr 7 10:30:34 2008 UTC
# Line 24  use Jifty::Action schema { Line 24  use Jifty::Action schema {
24  sub take_action {  sub take_action {
25      my $self = shift;      my $self = shift;
26    
27          my $editing = $self->current_user->editing;  #       warn "## user_object = ",dump( $self->current_user->user_object->as_hash );
   
 #       warn "user = ",dump( $self->current_user->user_object->as_hash );  
28    
29          if ( ! $self->current_user->id ) {          if ( ! $self->current_user->id ) {
30                  $self->result->error( _('You need to login') );                  $self->result->error( _('You need to login') );
# Line 34  sub take_action { Line 32  sub take_action {
32                  return 0;                  return 0;
33          }          }
34    
35          $editing = ! $editing;          my $editing = $self->current_user->user_object->editing ? 0 : 1;
36          $self->current_user->user_object->set_editing( $editing );          $self->current_user->user_object->set_editing( $editing );
37    
38      $self->result->message( _('Edit mode is now ') . ( $editing ? _('on') : _("off") ) );      $self->result->message( _('Edit mode is now ') . ( $editing ? _('on') : _("off") ) );
39    
40          warn "editing $editing for ", $self->current_user->id;          warn "## editing $editing for ", $self->current_user->id;
41    
42      return 1;      return 1;
43  }  }

Legend:
Removed from v.59  
changed lines
  Added in v.60

  ViewVC Help
Powered by ViewVC 1.1.26