|
Lines 31-36
Koha::Notice::Message - Koha notice message Object class, related to the message
Link Here
|
| 31 |
|
31 |
|
| 32 |
=cut |
32 |
=cut |
| 33 |
|
33 |
|
|
|
34 |
=head3 is_html |
| 35 |
|
| 36 |
my $bool = $message->is_html; |
| 37 |
|
| 38 |
Returns a boolean denoting whether the message was generated using a preformatted html template. |
| 39 |
|
| 40 |
=cut |
| 41 |
|
| 34 |
=head3 html_content |
42 |
=head3 html_content |
| 35 |
|
43 |
|
| 36 |
my $wrapped_content = $message->html_content; |
44 |
my $wrapped_content = $message->html_content; |
|
Lines 45-54
sub html_content {
Link Here
|
| 45 |
|
53 |
|
| 46 |
my $title = $self->subject; |
54 |
my $title = $self->subject; |
| 47 |
my $content = $self->content; |
55 |
my $content = $self->content; |
| 48 |
my $css = C4::Context->preference("NoticeCSS") || ''; |
|
|
| 49 |
$css = qq{<link rel="stylesheet" type="text/css" href="$css">} if $css; |
| 50 |
|
56 |
|
| 51 |
return <<EOS; |
57 |
my $wrapped; |
|
|
58 |
if ( $self->is_html ) { |
| 59 |
|
| 60 |
my $css = C4::Context->preference("NoticeCSS") || ''; |
| 61 |
$css = qq{<link rel="stylesheet" type="text/css" href="$css">} if $css; |
| 62 |
|
| 63 |
$wrapped = <<EOS; |
| 52 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
64 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| 53 |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
65 |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 54 |
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> |
66 |
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> |
|
Lines 62-68
sub html_content {
Link Here
|
| 62 |
</body> |
74 |
</body> |
| 63 |
</html> |
75 |
</html> |
| 64 |
EOS |
76 |
EOS |
| 65 |
|
77 |
} else { |
|
|
78 |
$wrapped = "<div style=\"white-space: pre-wrap;\">\n"; |
| 79 |
$wrapped .= $content . "\n"; |
| 80 |
$wrapped .= "</div>"; |
| 81 |
} |
| 82 |
return $wrappe; |
| 66 |
} |
83 |
} |
| 67 |
|
84 |
|
| 68 |
=head3 type |
85 |
=head3 type |
| 69 |
- |
|
|