Apache-SetWWWTheme
view release on metacpan or search on metacpan
SetWWWTheme.pm view on Meta::CPAN
my $allowbodymod; #
my ($nextlink, $lastlink, $uplink, $BGCOLOR); # vars we use to customize the page
my ($alink, $link, $text, $vlink); # <BODY> stuff
my @infolinks; # array to contain the links in the infobar
my $usenavbar; # flag that tells if we use the top and bottom navbar
my $serverconfig; # name of the server config file
my $localconfig; # name of the local config file
my $shortlocal; # short name of local config file
my $allowsidebartoggle; # flag set by server to allow turning on/off the sidebar
my $allowBGCOLOR; # flag set by the server to allow the local config to
# change the background color. HTML pages can *never*
# override the background color.
my $nosidebar; # flag set to turn off the sidebar. $allownosidebar
# must be set to use this.
my $allowbgpicture; # let us put in a background gif or something. I put this in
# so you could kill off animated bgs and other junk
my $bgpicture; # used to set the bg picture for the produced page.
#
my $allowsidebarmod; # sidebar modification variables...
my $sidebartop; #
my $sidebarmenutitle; #
my @sidebarmenulinks; #
my $nosidebarextras; #
my $morelinkstitle; #
my $sidebarsearchbox; #
SetWWWTheme.pm view on Meta::CPAN
This module requires the Apache server, available from
http://www.apache.org; the Apache B<mod_perl> module, which is
available from http://perl.apache.org, and the B<module
HTML::WWWTheme>, by Chad Hogan (version 1.06 or greater) which may
be found at CPAN.
=head1 DESCRIPTION
The SetWWWTheme module provides a server-based look-and-feel configuration for
an entire webtree. This module allows the server to introduce a common
navigation side-bar. It also provides mechanisms to control the background
color and background picture for a web page.
This is implemented in a layered fashion. The module first reads the server
directives. This sets defaults, and decides what users may have control
over. Server directives may only be set by the webmasters. Following these,
the module reads local directives. These directives are specified in a file,
and will affect all files in that same directory, as well as subdirectories
underneath it. They are set at the user-level, and so they are subject to
the constraints imposed by the server directives. Finally, the module parses
the individual HTML files. Within a file, an HTML authour may override the
settings given in the local directives. Again, these are subject to the
SetWWWTheme.pm view on Meta::CPAN
file relative to the document root.
The creation of printable versions of pages has been greatly simplified.
No longer is any configuration required -- the page is automatically
generated using a GET method. Adding "?printable" to a URI will
cause the page to be displayed in a printable manner, for example.
The server-level configuration is primarily to set defaults. It is also to
set restrictions on the configurability of the rest of the site. The
server-level configuration decides whether or not individual authours will
be permitted to, for example, change the background colour and background
image of their web pages.
Once again, the server configuration may make use of all of the following
directives. The server then decides which of these the users may override.
Local configuration
Any authour may create a text file containing directives. The name of this file
is set by the server directive @LOCALCONFIGFILE, with a default of
LookAndFeelConfig. This file will
affect all HTML files within that directory, as well as any subdirectories.
These directives are subject to the restrictions placed by the server-level
configuration. This file is intended to be used to set common settings for a
tree. For example, one may wish to set the background colour for an entire
tree to white. Then a @BGCOLOR=#FFFFFF; directive in the local config file.
file will set this. Directives that are explicitly set override the server
settings (if allowed). Otherwise, the server's settings persist.
Individual file configuration
This is the final level of configuration. Any authour may embed directives
within a comment tag in an HTML file, as long as this tag appears before the
<BODY> tag. Directives that are explicitly set override the local
configuration and/or server settings (if allowed). Otherwise, the local
SetWWWTheme.pm view on Meta::CPAN
tag. If @ALLOWBODYMOD is set to a non-zero value, @ALINK will set this
attribute in the page. Here is an example:
@ALINK=#FF00FF;
=item @ALLOWBODYMOD
Server configuration only
This tag is used to allow or disallow users from changing BODY
elements. These include "alink", "vlink", "link", "text", "bgcolor",
and "background" items using the directives @ALINK, @VLINK, @LINK,
@TEXT, @BGCOLOR and @BGPICTURE respectively. If it is set to a non-zero
value, the user's directives will be read and used. Otherwise, user
settings will be ignored, and only the server configuration values will
be used in creating the <BODY> tag for the page. Here is an example:
@ALLOWBODYMOD=1;
=item @ALLOWBGCOLOR L<Deprecated>
Server configuration only
This tag is used to allow or disallow users from changing the
background colours of their pages. By default it is set to 0, meaning
that users are not allowed to change their background colours. If it is
not set to a non-zero value, only the server's @BGCOLOR directives will
be used. This directive is deprecated. Administrators should use
@ALLOWBODYMOD instead. Here is an example:
@ALLOWBGCOLOR=0;
=item @ALLOWBGPICTURE L<Deprecated>
Server configuration only
This tag is used to allow or disallow users from changing the
background picture of their pages. By default it is set to 0, meaning
that users are not allowed to change their background colours. If it is
not set to a non-zero value, only the server's @BGPICTURE directives
will be used. This directive is deprecated. Administrators should use
@ALLOWBODYMOD instead Here is an example:
@ALLOWBGPICTURE=0;
=item @ALLOWNOSIDEBAR L<Deprecated>
Server configuration only. I<Use @ALLOWSIDEBARTOGGLE instead>.
This tag is used to allow or disallow users from turning on/off the left
SetWWWTheme.pm view on Meta::CPAN
@SIDEBARMENUTITLE, the menu links with the @SIDEBARMENULINKS. Users
are also allowed to change the title of the "More links" section to
something else. They may also then switch the sidebar search box on
or off with @SIDEBARSEARCHBOX. Here is an example:
@ALLOWSIDEBARMOD=0;
=item @BGCOLOR
HTML and local configuration subject to server configuration
This tag may be used to set the background colour of a page (or a group
of pages, in the case of local and server configuration). @BGCOLOR is
subject to the server directive @ALLOWBGCOLOR. If @ALLOWBGCOLOR is not
set to a non-zero value by server directives, the @BGCOLOR directive
will have no effect whatsoever when used in local and HTML
configuration. @BGCOLOR will always work when used in a server
configuration. Here is an example:
@BGCOLOR=#FFFFCC;
=item @BGPICTURE
HTML and local configuration subject to server configuration
This tag may be used to set the background image of a page (or a group
of pages, in the case of a local and server configuration. @BGPICTURE
is subject to the server directive @ALLOWBGPICTURE. If @ALLOWBGPICTURE
is not set to a non-zero value by server directives, the @BGPICTURE
directive will have no effect whatsoever when used in local and HTML
configuration. @BGPICTURE will always work when used in a server
configuration. Here is an example:
@BGPICTURE=/images/paperbackground.gif;
=item @BLANKGIF
Server configuration only
This tag is used to specify the location of the blank.gif image file.
This image is a 1x1 transparent gif that is used to space the tables
properly. This should be set to the path of the image file with respect
to the server's document root. So, if the apache document root is /WWW
and the file is /WWW/images/blank.gif then the proper use of this tag
would be:
templates/Configuration view on Meta::CPAN
@NOSIDEBAR=1;
@ALLOWSIDEBARTOGGLE=1;
# the server configuration gets to decide if mere mortals are allowed
# to change things like the bgcolor and the sidebar colour.
#
@ALLOWBODYMOD=1;
@ALLOWSIDEBARMOD=1;
# Here is the default background colour and sidebar colour for all pages
# Reactivate the TEXT directive, if you wish.
@BGCOLOR=#FFFFFF;
@SIDEBARCOLOR=#CCFFCC;
@ TEXT=#000000;
# this is the location, relative to the WEB DOCUMENT ROOT of a 1x1 pixel
# blank gif. A sample blank gif is provided with HTML::WWWTheme, but
# you should create your own with photoshop or GIMP or something like
# that. I don't know about the legality of using .gif files created by
templates/Configuration view on Meta::CPAN
@TOPBOTTOMLINKS=<A HREF="/">Home</a>;
# This sets the color of the alink/vlink/link in the HTML BODY tag
# Set them to something sensible and then reactivate them if you
# want to use them.
@ ALINK=#0000FF;
@ VLINK=#00FF00;
@ LINK=#FF0000;
# This would give us a background picture (<BODY BACKGROUND=....> but
# it's deactivated. I don't like background pictures. :)
# If it's disallowed, the users won't be able to change this setting. :)
@ALLOWBGPICTURE=1;
@ BGPICTURE="/images/wallpaper";
# this sets the name displayed at the top of the sidebar. Normally you'd
# put some kind of a title here.
@SIDEBARTOP=Chad's Home Pages;
templates/LookAndFeelConfig view on Meta::CPAN
# Put this file into any directory, and it will affect any file within
# that directory and all of its subdirectories. These files are good
# for setting a look and feel for a set of physically related files.
# For example, say you have a directory of files all on one subject, and
# you decide they should all have a blue background. You could go
# something like this:
@BGCOLOR=#9999FF;
# Please recall that you can NOT "comment out" a directive. You must
# deactivate it by separating the "@" from the directive name.
@ NOSIDEBAR=0;
# That directive above is deactivated.
( run in 0.889 second using v1.01-cache-2.11-cpan-f56aa216473 )