annotate Lib/DOM/Page.pm @ 16:75d55f4ee263

Окончательная концепция описания схем и построения DOM документов
author Sergey
date Tue, 08 Sep 2009 17:29:07 +0400
parents 03e58a454b20
children 16ada169ca75
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
1 package DOM::Page;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
2 use Common;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
3 use Template::Context;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
4 use strict;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
5
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
6 our @ISA = qw(Object);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
7 our $AUTOLOAD;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
8
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
9 BEGIN {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
10 DeclareProperty(Title => ACCESS_ALL);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
11 DeclareProperty(NavChain => ACCESS_READ);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
12 DeclareProperty(Menus => ACCESS_READ);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
13 DeclareProperty(Properties => ACCESS_READ);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
14 DeclareProperty(Template => ACCESS_READ);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
15 DeclareProperty(TemplatesProvider => ACCESS_NONE);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
16 DeclareProperty(Site => ACCESS_READ);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
17 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
18
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
19 sub CTOR {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
20 my ($this,%args) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
21 $this->{$Site} = $args{'Site'};
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
22 $this->{$TemplatesProvider} = $args{'TemplatesProvider'};
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
23 $this->{$Properties} = $args{'Properties'} || {};
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
24 $this->{$Title} = $args{'Template'}->Title() || $args{'Properties'}->{'Title'};
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
25 $this->{$Template} = $args{'Template'};
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
26 $this->{$NavChain} = $args{'NavChain'};
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
27 $this->{$Menus} = $args{'Menus'};
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
28 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
29
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
30 sub Render {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
31 my ($this,$hOut) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
32
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
33 my $context = new Template::Context({
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
34 VARIABLES => $this->{$Site}->Objects(),
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
35 LOAD_TEMPLATES => $this->{$TemplatesProvider}
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
36 });
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
37
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
38 print $hOut $this->{$Template}->process($context);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
39 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
40
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
41 sub Dispose {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
42 my ($this) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
43
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
44 undef %$this;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
45
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
46 $this->SUPER::Dispose;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
47 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
48
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
49 sub Container {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
50 my ($this) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
51 my $nav = $this->{$NavChain};
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
52 return $nav->[@{$nav}-1];
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
53 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
54
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
55 sub AUTOLOAD {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
56 my $this = shift;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
57
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
58 my $name = $AUTOLOAD;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
59 $name =~ s/.*://;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
60
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
61 return $this->{$Properties}->{$name};
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
62 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
63
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
64 =pod
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
65
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
66 [
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
67
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
68 {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
69 Key => ,
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
70 Name => ,
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
71 Expand => ,
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
72 Value => {[ ...] | - , }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
73 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
74 ]
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
75 =cut
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
76
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
77 package DOM::PageMenu;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
78 use Common;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
79
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
80 our @ISA = qw(Object);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
81
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
82 BEGIN {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
83 DeclareProperty('Items'); #
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
84 DeclareProperty('Keys'); # ,
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
85 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
86
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
87 sub CTOR {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
88 my ($this,%args) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
89 if (ref $args{'DATA'} eq 'ARRAY') {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
90 foreach my $item (@{$args{'DATA'}}) {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
91 if (ref $item eq 'HASH') {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
92 $this->Append($item->{'Name'},_ProcessData($item->{'Value'}), Expand => $item->{'Expand'}, Key => $item->{'Key'}, Url => $item->{'Url'});
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
93 } elsif (ref $item eq 'ARRAY') {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
94 $this->Append($item->[0],_ProcessData($item->[1]), Expand => $item->[2], Key => $item->[3], Url => $item->[4]);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
95 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
96 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
97 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
98 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
99
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
100 sub Item {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
101 my ($this,$index) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
102
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
103 return $this->{$Items}[$index];
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
104 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
105
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
106 sub ItemByKey {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
107 my ($this,$key) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
108
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
109 return $this->{$Keys}->{$key};
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
110 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
111
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
112 sub InsertBefore {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
113 my ($this,$index,$name,$data,%options) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
114
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
115 my $item = {Name => $name, Value => _ProcessData($data), %options};
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
116 splice @{$this->{$Items}},$index,0,$item;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
117
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
118 if ($options{'Key'}) {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
119 $this->{$Keys}->{$options{'Key'}} = $item;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
120 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
121 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
122
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
123 sub Append {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
124 my ($this,$name,$data,%options) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
125
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
126 my $item = {Name => $name, Value => _ProcessData($data), %options};
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
127
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
128 push @{$this->{$Items}},$item;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
129
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
130 if ($options{'Key'}) {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
131 $this->{$Keys}->{$options{'Key'}} = $item;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
132 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
133 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
134
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
135 sub SubMenu {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
136 my ($this,$path) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
137 my $item = $this;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
138 foreach my $key ( split /\/+/,$path ) {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
139 $item = $item->{$Keys}->{$key};
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
140 if (not $item ) {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
141 die new Exception('Item does\'t exist', $path, $key);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
142 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
143 $item = $item->{Value};
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
144 if (not UNIVERSAL::isa($item,'DOM::PageMenu')) {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
145 $item = ($this->{$Keys}->{$key}->{Value} = new DOM::PageMenu());
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
146 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
147 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
148
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
149 return $item;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
150 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
151
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
152 sub Dump {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
153 use Data::Dumper;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
154
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
155 return Dumper(shift);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
156 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
157
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
158 sub AppendItem {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
159 my ($this,$item) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
160
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
161 push @{$this->{$Items}},$item;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
162
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
163 if ($item->{'Key'}) {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
164 $this->{$Keys}->{$item->{'Key'}} = $item;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
165 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
166 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
167
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
168 sub RemoveAt {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
169 my ($this,$index) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
170
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
171 my $item = splice @{$this->{$Items}},$index,1;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
172
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
173 if ($item->{'Key'}) {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
174 delete $this->{$Keys}->{$item->{'Key'}};
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
175 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
176
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
177 return 1;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
178 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
179
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
180 sub ItemsCount {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
181 my $this = shift;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
182 return scalar(@{$this->{$Items}});
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
183 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
184
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
185 sub Sort {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
186 my $this = shift;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
187
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
188 $this->{$Items} = \sort { $a->{'Name'} <=> $b->{'Name'} } @{$this->{$Items}};
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
189
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
190 return 1;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
191 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
192
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
193 sub as_list {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
194 my $this = shift;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
195 return $this->{$Items} || [];
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
196 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
197
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
198 sub Merge {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
199 my ($this,$that) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
200
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
201 foreach my $itemThat ($that->Items) {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
202 my $itemThis = $itemThat->{'Key'} ? $this->{$Keys}->{$itemThat->{'Key'}} : undef;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
203 if ($itemThis) {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
204 $this->MergeItems($itemThis,$itemThat);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
205 } else {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
206 $this->AppendItem($itemThat);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
207 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
208 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
209 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
210
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
211 sub MergeItems {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
212 my ($this,$itemLeft,$itemRight) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
213
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
214 while (my ($prop,$value) = each %{$itemRight}) {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
215 if ($prop eq 'Value') {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
216 if (UNIVERSAL::isa($itemLeft->{$prop},__PACKAGE__) && UNIVERSAL::isa($value,__PACKAGE__)) {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
217 $itemLeft->{$prop}->Merge($value);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
218 } else {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
219 $itemLeft->{$prop} = $value if defined $value;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
220 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
221 } else {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
222 $itemLeft->{$prop} = $value if defined $value;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
223 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
224 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
225
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
226 return 1;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
227 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
228
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
229 sub _ProcessData {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
230 my $refData = shift;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
231
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
232 if (ref $refData eq 'ARRAY') {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
233 return new DOM::PageMenu(DATA => $refData);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
234 } else {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
235 return $refData;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
236 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
237 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
238
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
239
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
240
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
241 1;