Changeset 62
- Timestamp:
- 12/03/10 01:25:01 (14 years ago)
- Location:
- server/trunk/web
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
server/trunk/web/lib/Sophie/Model/Help/POD.pm
r61 r62 1 package Sophie::Model::Help:: XMLRPC;1 package Sophie::Model::Help::POD; 2 2 use Moose; 3 3 use namespace::autoclean; … … 27 27 =cut 28 28 29 sub list{29 sub pom { 30 30 my ($self) = @_; 31 return sort keys %{$self->{method}};31 return values %{ $self->{pom} } 32 32 } 33 33 34 sub present { 35 my ($self, $section) = @_; 36 $self->{method}{$section}->present(Pod::POM::View::HTML->new); 34 sub xmlrpc_functions { 35 my ($self) = @_; 36 my @pod; 37 foreach my $pom ($self->pom) { 38 foreach my $head1 ($pom->content) { 39 foreach my $item ($head1->content) { 40 my $title = $item->title or next; 41 $title =~ s/[^\w\._].*$//; 42 if ($self->{xmlrpc_methods}->{$title}) { 43 push(@pod, $item); 44 } 45 } 46 } 47 } 48 my $ppvh = Pod::POM::View::HTML->new; 49 return join("\n\n", map { $_->present($ppvh) } @pod); 37 50 } 38 51 … … 40 53 my ($self, $c, @args) = @_; 41 54 42 my %method = %{ $c->server->xmlrpc->list_methods }; 55 $self->{xmlrpc_methods} = $c->server->xmlrpc->list_methods; 56 43 57 foreach my $controller ($c->controllers) { 44 58 my $pod = Pod::Find::pod_where({ -verbose => 0, -inc => 1 }, … … 47 61 my $parser = Pod::POM->new(); 48 62 my $pom = $parser->parse($pod); 49 foreach my $head1 ($pom->content) { 50 foreach my $item ($head1->content) { 51 my $title = $item->title or next; 52 $title =~ s/[^\w\._].*$//; 53 if ($method{$title}) { 54 $self->{method}{$title} = $item; 55 } 56 } 57 } 63 $self->{pom}{$controller} = $pom; 64 58 65 } 59 66 -
server/trunk/web/root/templates/html/help/xmlrpc/index.html
r58 r62 1 [% pom = c.model('Help::XMLRPC') %] 2 [% FOREACH sec = pom.list %] 3 [% pom.present(sec) %] 4 [% END %] 1 [% c.model('Help::POD').xmlrpc_functions %]
Note: See TracChangeset
for help on using the changeset viewer.