r15374@deathmachine (orig r423): edenc | 2007-12-17 13:43:38 -0500
[catagits/Reaction.git] / lib / Reaction / UI / Widget / Action.pm
1 package Reaction::UI::Widget::Action;
2
3 use Reaction::UI::WidgetClass;
4
5 class Action is 'Reaction::UI::Widget::Object', which {
6
7   #before fragment widget {
8   #  arg form_id => $_{viewport}->location;
9   #};
10
11   #implements fragment field_list {
12   #  render field => over $_{viewport}->ordered_fields;
13   #};
14
15   #implements fragment field {
16   #  render 'viewport';
17   #};
18
19   implements fragment ok_button_fragment {
20     if (grep { $_ eq 'ok' } $_{viewport}->accept_events) {
21       arg 'event_id' => event_id 'ok';
22       arg 'label' => $_{viewport}->ok_label;
23       render 'ok_button';
24     }
25   };
26
27   implements fragment apply_button_fragment {
28     if (grep { $_ eq 'apply' } $_{viewport}->accept_events) {
29       arg 'event_id' => event_id 'apply';
30       arg 'label' => $_{viewport}->apply_label;
31       render 'apply_button';
32     }
33   };
34
35   implements fragment cancel_button_fragment {
36     if (grep { $_ eq 'cancel' } $_{viewport}->accept_events) {
37       arg 'event_id' => event_id 'cancel';
38       arg 'label' => $_{viewport}->cancel_label;
39       render 'cancel_button';
40     }
41   };
42
43 };
44
45 1;
46
47 __END__;
48
49 =head1 NAME
50
51 Reaction::UI::Widget::Action
52
53 =head1 DESCRIPTION
54
55 =head1 FRAGMENTS
56
57 =head2 widget
58
59 Renders "header", "field_list", "buttons" and "footer"
60
61 =head2 field_list
62
63 Sequentially renders the C<ordered_fields> of the viewport
64
65 =head2 buttons
66
67 Additional variables available in topic hash: "message"
68
69 =head2 header
70
71 Content is a dummy value
72
73 =head2 footer
74
75 Content is a dummy value
76
77 =head1 AUTHORS
78
79 See L<Reaction::Class> for authors.
80
81 =head1 LICENSE
82
83 See L<Reaction::Class> for the license.
84
85 =cut
86