# Copyright (c) 2002 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: MetaTags.pm,v 2.1 2006/10/16 21:08:05 moeller Exp $ package Bivio::UI::HTML::Widget::MetaTags; use strict; $Bivio::UI::HTML::Widget::MetaTags::VERSION = sprintf('%d.%02d', q$Revision: 2.1 $ =~ /\d+/g); $_ = $Bivio::UI::HTML::Widget::MetaTags::VERSION; =head1 NAME Bivio::UI::HTML::Widget::MetaTags - generates meta tags in header =head1 RELEASE SCOPE bOP =head1 SYNOPSIS use Bivio::UI::HTML::Widget::MetaTags; =cut =head1 EXTENDS L =cut use Bivio::UI::Widget; @Bivio::UI::HTML::Widget::MetaTags::ISA = ('Bivio::UI::Widget'); =head1 DESCRIPTION C is used like: Page({ head => Join([ MetaTags( "This is a cool site", "Cool stuff, Stuff that is cool, coolest stuff", ), Title([ view_widget_value('title'), view_widget_value('sub_title'), ]), ]), =cut #=IMPORTS #=VARIABLES =head1 METHODS =cut =for html =head2 static internal_new_args() : hash_ref Implements positional argument parsing for L. =cut sub internal_new_args { my(undef, $description, $keywords, $attributes) = @_; return { meta_description => $description, meta_keywords => $keywords, ($attributes ? %$attributes : ()), }; } =for html =head2 render(any source, string_ref buffer) Render the title by joining the I. We set the Title in the reply as well. =cut sub render { my($self, $source, $buffer) = @_; foreach my $k (sort(grep(s/^meta_//, @{$self->get_keys}))) { my($b); next unless $self->unsafe_render_attr("meta_$k", $source, \$b); $$buffer .= qq{\n}; } #TODO: Modify the reply header? return; } #=PRIVATE SUBROUTINES =head1 COPYRIGHT Copyright (c) 2002 bivio Software, Inc. All Rights Reserved. Visit http://www.bivio.biz for more info. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; If not, you may get a copy from: http://www.opensource.org/licenses/lgpl-license.html =head1 VERSION $Id: MetaTags.pm,v 2.1 2006/10/16 21:08:05 moeller Exp $ =cut 1;