| 1 | package App::ZofCMS::Plugin::ConfigToTemplate; | ||||||||||||
| 2 | |||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | 1 | our $VERSION = '1.001010'; # VERSION | |||||||||||
| 7 | |||||||||||||
| 8 | 1 | ▶ | use base 'App::ZofCMS::Plugin::Base'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | 0 | ▶ | sub _key { 'plug_config_to_template' } | ||||||||||
|
Subroutine
_key: not called CC=1 SCAR=6.9
| |||||||||||||
| 11 | 0 | ▶ | sub _defaults { | ||||||||||
|
Subroutine
_defaults: not called CC=1 SCAR=6.9
| |||||||||||||
| 12 | return ( | ||||||||||||
| 13 | 0 | cell => 'd', | |||||||||||
| 14 | key => 'public_config', | ||||||||||||
| 15 | config_cell => 'public_config', | ||||||||||||
| 16 | config_keys => undef, | ||||||||||||
| 17 | noop => 0, | ||||||||||||
| 18 | ); | ||||||||||||
| 19 | } | ||||||||||||
| 20 | 0 | ▶ | sub _do { | ||||||||||
|
Subroutine
_do: not called CC=6 SCAR=37.4
| |||||||||||||
| 21 | 0 | my ( $self, $conf, $t, $q, $config ) = @_; | |||||||||||
| 22 | |||||||||||||
| 23 | return | ||||||||||||
| 24 | 0 | ▶ | if $conf->{noop}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 25 | |||||||||||||
| 26 | 0 | my $zcms_config = $config->conf; | |||||||||||
| 27 | 0 | my ( $cell, $key, $ccell, $ckeys ) = @$conf{ qw/cell key config_cell config_keys/ }; | |||||||||||
| 28 | |||||||||||||
| 29 | 0 | my @keys; | |||||||||||
| 30 | 0 | ▶ | if ( defined $ckeys ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 31 | 0 | @keys = @$ckeys; | |||||||||||
| 32 | } | ||||||||||||
| 33 | else { | ||||||||||||
| 34 | 0 | ▶ | @keys = keys %{ $zcms_config->{ $ccell } || {} }; | ||||||||||
|
Condition0%0/2
$zcms_config->{$ccell} || {}
MC/DC0%0/1
$zcms_config->{$ccell} || {}
$zcms_config->{$ccell}
Truth table0%0/2
A
A= $zcms_config->{$ccell}
| |||||||||||||
| 35 | } | ||||||||||||
| 36 | |||||||||||||
| 37 | 0 | for ( @keys ) { | |||||||||||
| 38 | 0 | ▶ | if ( defined $key ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 39 | 0 | $t->{ $cell }{ $key }{ $_ } = $zcms_config->{ $ccell }{ $_ }; | |||||||||||
| 40 | } | ||||||||||||
| 41 | else { | ||||||||||||
| 42 | 0 | $t->{ $cell }{ $_ } = $zcms_config->{ $ccell }{ $_ }; | |||||||||||
| 43 | } | ||||||||||||
| 44 | } | ||||||||||||
| 45 | }; | ||||||||||||
| 46 | |||||||||||||
| 47 | __END__ | ||||||||||||