Jifty/Plugin/OnlineDocs/Dispatcher.pm untested

filter: Statementstmt 0.0% 0 / 17 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod n/a totaltotal 0.0% 0 / 24 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 use warnings;
2 use strict;
3  
4 package Jifty::Plugin::OnlineDocs::Dispatcher;
5  
6 =head1 NAME
7  
8 Jifty::Plugin::OnlineDocs::Dispatcher - Dispatcher for OnlineDocs plugin
9  
10 =head1 DESCRIPTION
11  
12 Load up the OnlineDocs tab when we're in Admin mode
13  
14 =cut
15  
16 use Jifty::Dispatcher -base;
17
18 on '*' => run {
19 return unless Jifty->admin_mode;
20  
21 my $top = Jifty->web->navigation;
22 $top->child(
23 "OnlineDocs",
24 url => "/__jifty/online_docs/",
25 label => _('Online docs'),
26 sort_order => 999
27 );
28 };
29  
30 under '/__jifty/online_docs' => run {
31 return if Jifty->admin_mode;
32 warn "Attempt to access /__jifty/online_docs; either enable AdminMode, or remove the OnlineDocs plugin";
33 redirect('/__jifty/error/permission_denied');
34 };
35  
36 1;
37