Lines 17-23
package Koha::Notice::Message;
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
|
|
|
21 |
use Koha::Database; |
20 |
use Koha::Database; |
22 |
|
21 |
|
23 |
use base qw(Koha::Object); |
22 |
use base qw(Koha::Object); |
Lines 32-37
Koha::Notice::Message - Koha notice message Object class, related to the message
Link Here
|
32 |
|
31 |
|
33 |
=cut |
32 |
=cut |
34 |
|
33 |
|
|
|
34 |
=head3 html_content |
35 |
|
36 |
my $wrapped_content = $message->html_content; |
37 |
|
38 |
This method returns the message content approprately wrapped |
39 |
with html headers and css includes for html formatted notices. |
40 |
|
41 |
=cut |
42 |
|
43 |
sub html_content { |
44 |
my ($self) = @_; |
45 |
|
46 |
my $title = $self->subject; |
47 |
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 |
|
51 |
return <<EOS; |
52 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
53 |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
54 |
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> |
55 |
<head> |
56 |
<title>$title</title> |
57 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
58 |
$css |
59 |
</head> |
60 |
<body> |
61 |
$content |
62 |
</body> |
63 |
</html> |
64 |
EOS |
65 |
|
66 |
} |
67 |
|
35 |
=head3 type |
68 |
=head3 type |
36 |
|
69 |
|
37 |
=cut |
70 |
=cut |