line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Kwiki::Raw; |
2
|
1
|
|
|
1
|
|
23707
|
use Kwiki::Plugin '-Base'; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use mixin 'Kwiki::Installer'; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
const class_id => 'raw'; |
6
|
|
|
|
|
|
|
const cgi_class => 'Kwiki::Raw::CGI'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub register { |
11
|
|
|
|
|
|
|
my $registry = shift; |
12
|
|
|
|
|
|
|
$registry->add(action => 'raw'); |
13
|
|
|
|
|
|
|
$registry->add(toolbar => 'raw_button', |
14
|
|
|
|
|
|
|
template => 'raw_button.html', |
15
|
|
|
|
|
|
|
show_for => 'display', |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub raw { |
20
|
|
|
|
|
|
|
if ($self->cgi->page_name) { |
21
|
|
|
|
|
|
|
$self->hub->headers->content_type('text/plain'); |
22
|
|
|
|
|
|
|
$self->hub->pages->new_from_name($self->cgi->page_name)->content; |
23
|
|
|
|
|
|
|
} else { |
24
|
|
|
|
|
|
|
$self->render_screen( |
25
|
|
|
|
|
|
|
error_msg => 'raw requires page_name', |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
package Kwiki::Raw::CGI; |
31
|
|
|
|
|
|
|
use Kwiki::CGI -base; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
cgi page_name => -utf8; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
package Kwiki::Raw |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__DATA__ |