[Bio] / WebApplication / WebComponent.pm Repository:
ViewVC logotype

Diff of /WebApplication/WebComponent.pm

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

revision 1.7, Wed Sep 29 16:21:51 2010 UTC revision 1.8, Fri Feb 18 18:30:19 2011 UTC
# Line 55  Line 55 
55                   'css'         => undef,                   'css'         => undef,
56                   'svURL'       => $sv_url,                   'svURL'       => $sv_url,
57                   'sigleton'    => 0,                   'sigleton'    => 0,
58                   '_type'       => $type                   '_type'       => $type,
59                     'childComponents' => [],
60                     '_orderedCSS' => [],
61                     '_orderedJS' => [],
62                 };                 };
63      bless $self, $class;      bless $self, $class;
64    
# Line 133  Line 136 
136    return [ ];    return [ ];
137  }  }
138    
139    =item * B<require_javascript_ordered> ([filenames]) || (filename)
140    
141    Adds a list of javascript files or a single file to an ordered list that
142    are required for this component. These files are always added after the
143    files in the component's child-components.
144    
145    =cut
146    
147    sub require_javascript_ordered {
148      my ($self, $files) = @_;
149      if (ref($files) eq 'ARRAY') {
150         push(@{$self->{"_orderedJS"}}, @$files);
151      } else {
152         push(@{$self->{"_orderedJS"}}, $files);
153      }
154      return $self->{"_orderedJS"};
155    }
156    
157  =pod  =pod
158    
# Line 151  Line 171 
171    return $_[0]->{'css'};    return $_[0]->{'css'};
172  }  }
173    
174    =item * B<require_css_ordered> ([filenames]) || (filename)
175    
176    Adds a list of css files or a single file to an ordered list that
177    are required for this component. These files are always added after the
178    files in the component's child-components.
179    
180    =cut
181    
182    sub require_css_ordered {
183      my ($self, $files) = @_;
184      if (ref($files) eq 'ARRAY') {
185         push(@{$self->{"_orderedCSS"}}, @$files);
186      } else {
187         push(@{$self->{"_orderedCSS"}}, $files);
188      }
189      return $self->{"_orderedCSS"};
190    }
191    
192  =pod  =pod
193    
# Line 207  Line 244 
244      return $retVal;      return $retVal;
245  }  }
246    
247    =pod
248    
249    =item * <register_component> (<CoponentName>, <id>)
250    
251    Calls register_component() of WebApplication, but also
252    remembers the scope of the component; useful when you need
253    to resolve dependencies, e.g. for js or css.
254    
255    =cut
256    
257    sub register_component {
258        my ($self, $component, $id) = @_;
259        my $web_component = $self->application()->register_component($component, $id);
260        push(@{$self->{"childComponents"}}, $web_component);
261        return $web_component;
262    }
263    
264    
265  1;  1;

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3