line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Kwiki::AdSense; |
2
|
1
|
|
|
1
|
|
61260
|
use Kwiki::Plugin -Base; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use mixin 'Kwiki::Installer'; |
4
|
|
|
|
|
|
|
our $VERSION = '0.11'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
const class_id => 'adsense'; |
7
|
|
|
|
|
|
|
const config_file => 'adsense.yaml'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub register { |
10
|
|
|
|
|
|
|
my $registry = shift; |
11
|
|
|
|
|
|
|
$registry->add(preload => 'adsense'); |
12
|
|
|
|
|
|
|
$registry->add(widget => 'adsense', |
13
|
|
|
|
|
|
|
template => 'adsense.html', |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
$registry->add(preference => $self->show_adsense); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub show_adsense { |
19
|
|
|
|
|
|
|
my $p = $self->new_preference('show_adsense'); |
20
|
|
|
|
|
|
|
$p->query('Show Google AdSense Ads?'); |
21
|
|
|
|
|
|
|
$p->default(1); |
22
|
|
|
|
|
|
|
return $p; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__DATA__ |