line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Kwiki::Widgets::Links; |
2
|
1
|
|
|
1
|
|
1304
|
use Kwiki::Plugin -Base; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use mixin 'Kwiki::Installer'; |
4
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
const class_id => 'widgets_links'; |
7
|
|
|
|
|
|
|
const class_title => 'Links widget'; |
8
|
|
|
|
|
|
|
const config_file => 'widgets_links.yaml'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub register { |
11
|
|
|
|
|
|
|
my $registry = shift; |
12
|
|
|
|
|
|
|
$registry->add(widget => 'widgets_links', |
13
|
|
|
|
|
|
|
template => 'widgets_links.html'); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub get_links { |
17
|
|
|
|
|
|
|
my @l = @{$self->hub->config->widgets_links}; |
18
|
|
|
|
|
|
|
map { { title => $l[$_], url => $l[$_+1] } } map { $_ * 2 } 0..$#l/2; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
__DATA__ |