/[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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 23 - (show annotations)
Fri Nov 30 23:23:14 2007 UTC (11 years, 11 months ago) by dpavlin
File size: 788 byte(s)
another huge code dump:
- rename database columns to prevent conficts with standards
- added editing accessor to user which returns edit mode
- ToggleEdit action to change editing state (broken)
- tweaks all over templates to make units entry a breeze
- version bump [0.03]
1 use strict;
2 use warnings;
3
4 =head1 NAME
5
6 Arh::Action::ToggleEdit
7
8 =cut
9
10 package Arh::Action::ToggleEdit;
11 use base qw/Arh::Action Jifty::Action/;
12
13 use Data::Dump qw/dump/;
14
15 use Jifty::Param::Schema;
16 use Jifty::Action schema {
17
18 };
19
20 =head2 take_action
21
22 =cut
23
24 sub take_action {
25 my $self = shift;
26
27 my $editing = $self->current_user->editing;
28
29 # warn "user = ",dump( $self->current_user->user_object->as_hash );
30
31 if ( ! $self->current_user->id ) {
32 $self->result->error( _('You need to login') );
33 warn "not logged in!";
34 return 0;
35 }
36
37 $editing = ! $editing;
38 $self->current_user->user_object->set_editing( $editing );
39
40 $self->result->message( _('Edit mode is now '), $editing ? _('on') : _("off") );
41
42 warn "editing $editing for ", $self->current_user->id;
43
44 return 1;
45 }
46
47
48 1;
49

  ViewVC Help
Powered by ViewVC 1.1.26