Content.pm

filter: Statementstmt 53.1% 17 / 32 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 27.7% 5 / 18 Podpod 100% 13 / 13 totaltotal 55.5% 35 / 63 CC 1 SCAR 5.4
CC
1
Cov
53%
Admin
2.0
Home
2.0
Section
2.0
CRAP 1.7
« Articles/Site.pm ↑ Summary
1 package Labyrinth::Plugin::Content;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 our $VERSION = '5.19';
7  
8 =head1 NAME
9  
10 Labyrinth::Plugin::Content - General page content functionality.
11  
12 =head1 DESCRIPTION
13  
14 The functions contain herein are for general page content functionality.
15  
16 =cut
17  
18 #----------------------------------------------------------------------------
19 # Libraries
20  
21 4 ▶use base qw(Labyrinth::Plugin::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 4 ▶use Labyrinth::Support;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 4 ▶use Labyrinth::Variables;
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 #----------------------------------------------------------------------------
27 # Public Interface Functions
28  
29 =head1 PUBLIC INTERFACE METHODS
30  
31 =over 4
32  
33 =item Admin
34  
35 Checks whether user has admin priviledges.
36  
37 =item Home
38  
39 Sets article name to 'index' for quick loading.
40  
41 =item Section
42  
43 Sets article name to current section name for quick loading.
44  
45 =back
46  
47 =cut
48  
49 0 ▶sub Admin { AccessUser(ADMIN); }
Subroutine Admin: not called CC=1 SCAR=6.9
Pod documented
50 0 ▶sub Home { $cgiparams{name} = 'index'; }
Subroutine Home: not called CC=1 SCAR=6.9
Pod documented
51 0 ▶sub Section { $cgiparams{name} = $tvars{section}; }
Subroutine Section: not called CC=1 SCAR=6.9
Pod documented
52  
53 #----------------------------------------------------------
54 # Content Management Subroutines
55  
56 =head1 CONTENT MANAGEMENT FUNCTIONS
57  
58 =over 4
59  
60 =item GetVersion
61  
62 Sets the current application versions in template variables.
63  
64 =item ServerTime
65  
66 Sets the current server time in a template variable.
67  
68 =back
69  
70 =cut
71  
72 0 ▶sub GetVersion { $tvars{'version'} = $main::VERSION; $tvars{'labversion'} = $Labyrinth::Variables::VERSION; }
Subroutine GetVersion: not called CC=1 SCAR=6.9
Pod documented
73 0 ▶sub ServerTime { $tvars{'server'}{'date'} = formatDate(3); $tvars{'server'}{'time'} = formatDate(17); }
Subroutine ServerTime: not called CC=1 SCAR=6.9
Pod documented
74  
75 =head1 REALM CHANGING FUNCTIONS
76  
77 All the following reset the current realm.
78  
79 =over
80  
81 =item RealmAJAX
82  
83 Use when the AJAX layout template is required.
84  
85 =item RealmICal
86  
87 Use when the ICal layout template is required.
88  
89 =item RealmJS
90  
91 Use when the JavaScript layout template is required.
92  
93 =item RealmJSON
94  
95 Use when the JSON layout template is required.
96  
97 =item RealmPlain
98  
99 Use when the plain text layout template is required.
100  
101 =item RealmPopup
102  
103 Use when the popup layout template is required.
104  
105 =item RealmXML
106  
107 Use when the XML layout template is required.
108  
109 =item RealmYAML
110  
111 Use when the YAML layout template is required.
112  
113 =back
114  
115 =cut
116  
117 0 ▶sub RealmAJAX { $tvars{realm} = 'ajax'; }
Subroutine RealmAJAX: not called CC=1 SCAR=6.9
Pod documented
118 0 ▶sub RealmICal { $tvars{realm} = 'ical'; }
Subroutine RealmICal: not called CC=1 SCAR=6.9
Pod documented
119 0 ▶sub RealmJS { $tvars{realm} = 'js'; }
Subroutine RealmJS: not called CC=1 SCAR=6.9
Pod documented
120 0 ▶sub RealmJSON { $tvars{realm} = 'json'; }
Subroutine RealmJSON: not called CC=1 SCAR=6.9
Pod documented
121 0 ▶sub RealmPlain { $tvars{realm} = 'plain'; }
Subroutine RealmPlain: not called CC=1 SCAR=6.9
Pod documented
122 0 ▶sub RealmPopup { $tvars{realm} = 'popup'; }
Subroutine RealmPopup: not called CC=1 SCAR=6.9
Pod documented
123 0 ▶sub RealmXML { $tvars{realm} = 'xml'; }
Subroutine RealmXML: not called CC=1 SCAR=6.9
Pod documented
124 0 ▶sub RealmYAML { $tvars{realm} = 'yaml'; }
Subroutine RealmYAML: not called CC=1 SCAR=6.9
Pod documented
125  
126 4 1;
127  
128 __END__
« Articles/Site.pm ↑ Summary