line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package HTML::WebMake::Out; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
66
|
|
6
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
31
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
|
|
507
|
use vars qw{ |
9
|
|
|
|
|
|
|
@ISA |
10
|
1
|
|
|
1
|
|
6
|
}; |
|
1
|
|
|
|
|
16
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
########################################################################### |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new ($$$$$) { |
18
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
19
|
0
|
|
0
|
|
|
|
$class = ref($class) || $class; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
my ($file, $name, $attrs) = @_; |
22
|
0
|
|
|
|
|
|
my $self = { %$attrs }; # copy the attrs |
23
|
0
|
|
|
|
|
|
bless ($self, $class); |
24
|
0
|
|
|
|
|
|
my $attrval; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
$self->{main} = $file->{main}; |
27
|
0
|
|
|
|
|
|
$self->{name} = $name; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
$attrval = $attrs->{'format'}; |
30
|
0
|
|
0
|
|
|
|
$attrval ||= $self->{main}->{metadata}->get_attrdefault ('format'); |
31
|
0
|
0
|
|
|
|
|
if (defined $attrval) { |
32
|
0
|
0
|
|
|
|
|
if ($attrval eq 'text/html') { |
33
|
0
|
|
|
|
|
|
delete $self->{format}; |
34
|
|
|
|
|
|
|
} else { |
35
|
0
|
|
|
|
|
|
$self->{format} = |
36
|
|
|
|
|
|
|
HTML::WebMake::FormatConvert::format_name_to_zname($attrval); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
0
|
0
|
|
|
|
|
if (defined $attrs->{root}) { |
41
|
0
|
|
|
|
|
|
$self->{main}->fail (" tags cannot have root attribute: $name"); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# is this out the "main" URL for any content items in it? |
45
|
0
|
|
|
|
|
|
$attrval = $attrs->{'ismainurl'}; |
46
|
0
|
0
|
|
|
|
|
if (!defined $attrval) { |
47
|
0
|
|
|
|
|
|
$attrval = $self->{main}->{metadata}->get_attrdefault ('ismainurl'); |
48
|
|
|
|
|
|
|
} |
49
|
0
|
0
|
|
|
|
|
if (defined $attrval) { |
50
|
0
|
|
|
|
|
|
$self->{ismainurl} = $self->{main}->{util}->parse_boolean ($attrval); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
$attrval = $attrs->{'clean'}; |
54
|
0
|
0
|
|
|
|
|
if (!defined $attrval) { |
55
|
0
|
|
|
|
|
|
$attrval = $self->{main}->{metadata}->get_attrdefault ('clean'); |
56
|
|
|
|
|
|
|
} |
57
|
0
|
|
|
|
|
|
$self->{clean} = $attrval; |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
$self; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
# ------------------------------------------------------------------------- |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub get_format { |
65
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
66
|
|
|
|
|
|
|
|
67
|
0
|
0
|
|
|
|
|
if (!defined $self->{format}) { return 'text/html'; } |
|
0
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
HTML::WebMake::FormatConvert::format_zname_to_name($self->{format}); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
# ------------------------------------------------------------------------- |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub get_text { |
74
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
my $name = $self->{name}; |
77
|
0
|
|
|
|
|
|
my $txt = '${OUT:'.$name.'}'; |
78
|
0
|
|
|
|
|
|
$self->{main}->subst ($name, \$txt); |
79
|
0
|
|
|
|
|
|
$txt; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
# ------------------------------------------------------------------------- |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub use_for_content_urls { |
85
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
86
|
0
|
|
|
|
|
|
my $ret = $self->{ismainurl}; |
87
|
0
|
0
|
|
|
|
|
return (defined $ret) ? ($ret+0) : 1; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
# ------------------------------------------------------------------------- |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
1; |