diff options
author | Yorhel <git@yorhel.nl> | 2011-01-27 10:50:51 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2011-01-27 10:50:51 +0100 |
commit | 64f3c44acebad3b64a7ea2a5462247c1a10f76ab (patch) | |
tree | 7a63549a92418f0f9b659b98f43c6155819712f6 /lib | |
parent | 78f364130abe51a4baeeef1e20a7292c3a1a28dd (diff) |
TUWF: Replaced ugly html() redefine hack with the new html() options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VNDB/Util/CommonHTML.pm | 17 | ||||
-rw-r--r-- | lib/VNDB/Util/LayoutHTML.pm | 8 |
2 files changed, 7 insertions, 18 deletions
diff --git a/lib/VNDB/Util/CommonHTML.pm b/lib/VNDB/Util/CommonHTML.pm index 97dc6ca1..4617804d 100644 --- a/lib/VNDB/Util/CommonHTML.pm +++ b/lib/VNDB/Util/CommonHTML.pm @@ -430,22 +430,7 @@ sub htmlRGHeader { return 1; } $self->resHeader('Content-Type' => 'application/xhtml+xml; charset=UTF-8'); - - # This is a REALLY ugly hack, need find a proper solution in YAWF - # TODO: TUWF has a proper solution for this, convert this to use it - no warnings 'redefine'; - my $sub = \&TUWF::XML::html; - *VNDB::Util::LayoutHTML::html = sub { - lit q|<!DOCTYPE html PUBLIC - "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" - "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">|; - tag 'html', - xmlns => "http://www.w3.org/1999/xhtml", - 'xmlns:svg' => 'http://www.w3.org/2000/svg', - 'xmlns:xlink' => 'http://www.w3.org/1999/xlink'; - }; - $self->htmlHeader(title => $title); - *VNDB::Util::LayoutHTML::html = $sub; + $self->htmlHeader(title => $title, svg => 1); $self->htmlMainTabs($type, $obj, 'rg'); return 0; } diff --git a/lib/VNDB/Util/LayoutHTML.pm b/lib/VNDB/Util/LayoutHTML.pm index fe5f0679..fc6ba6b2 100644 --- a/lib/VNDB/Util/LayoutHTML.pm +++ b/lib/VNDB/Util/LayoutHTML.pm @@ -10,13 +10,17 @@ use VNDB::Func; our @EXPORT = qw|htmlHeader htmlFooter|; -sub htmlHeader { # %options->{ title, noindex, search, feeds } +sub htmlHeader { # %options->{ title, noindex, search, feeds, svg } my($self, %o) = @_; my $skin = $self->reqParam('skin') || $self->authPref('skin') || $self->{skin_default}; $skin = $self->{skin_default} if !$self->{skins}{$skin} || !-d "$VNDB::ROOT/static/s/$skin"; # heading - html; + html lang => $self->{l10n}->language_tag(), $o{svg} ? ( + doctype => 'xhtml-math-svg', + 'xmlns:svg' => 'http://www.w3.org/2000/svg', + 'xmlns:xlink' => 'http://www.w3.org/1999/xlink' + ) : (); head; title $o{title}; Link rel => 'shortcut icon', href => '/favicon.ico', type => 'image/x-icon'; |