/[pub]/suikawiki/script/bin/mkplugin2.pl
Suika

Diff of /suikawiki/script/bin/mkplugin2.pl

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

revision 1.3 by wakaba, Sat Oct 25 02:22:06 2003 UTC revision 1.4 by wakaba, Thu Oct 30 07:48:04 2003 UTC
# Line 176  sub make_resdef ($$) { Line 176  sub make_resdef ($$) {
176  sub make_viewfragment ($$) {  sub make_viewfragment ($$) {
177    my ($src, $Info) = @_;    my ($src, $Info) = @_;
178    my $r = '';    my $r = '';
179    my $name = $src->get_attribute_value ('Name');    my $body = <<EOH;
180    $name =~ tr/-/_/;    {
   ## SuikaWiki 2 Interface  
 #    $r .= qq(SuikaWiki::View->template (@{[literal $name]})  
 #                            ->add_line (@{[literal $src->get_attribute_value ('Formatting')]});\n);  
   ## SuikaWiki 3 Interface  
     $r .= <<EOH;  
   push \@{\$SuikaWiki::View::Implementation::TemplateFragment{@{[literal $name]}}}, {  
181      Main => @{[literal $src->get_attribute_value ('Formatting')]},      Main => @{[literal $src->get_attribute_value ('Formatting')]},
182      Order => @{[0+$src->get_attribute_value ('Order')]},      Order => @{[0+$src->get_attribute_value ('Order')]},
183      Description => [@{[m13ed_val_list $src, 'Description']}],      Description => [@{[m13ed_val_list $src, 'Description']}],
184    };    };
185  EOH  EOH
186    push @{$Info->{provide}->{viewfragment}},    ## Recommended format
187         {Name => $src->get_attribute ('Name')->value};    my $name = $src->get_attribute_value ('Template');
188      if (ref ($name) and @$name > 1) {
189        $r .= qq({my \$def = $body;\n);
190        for (@$name) {
191          my $name = $_; $name =~ tr/-/_/;
192          $r .= qq(push \@{\$SuikaWiki::View::Implementation::TemplateFragment{@{[literal $name]}}}, \$def;\n);
193          push @{$Info->{provide}->{viewfragment}}, {Name => $name};
194        }
195        $r .= qq(}\n);
196      } else {                           ## Obsoleted format
197        $name = ref $name ? $name->[0] : $src->get_attribute_value ('Name');
198        $name =~ tr/-/_/;
199        $r .= qq(push \@{\$SuikaWiki::View::Implementation::TemplateFragment{@{[literal $name]}}}, $body);
200        push @{$Info->{provide}->{viewfragment}}, {Name => $name};
201      }
202    $r;    $r;
203  }  }
204    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24