NAME

HTML::Menu::TreeView

SYNOPSIS

	use HTML::Menu::TreeView qw(Tree);

	my @tree =( {
	
	text => 'Folder',
	
	folderclass => 'folderMan',

	subtree => [

		{

                text => 'TreeView.tigris.org',

                href => 'http://TreeView.tigris.org',

		}

            ],

	},);

	Tree(\tree);

Possible values for folderclass :

folderMan, folderVideo,folderCrystal, folderLocked , folderText, folderFavorite, folderPrint,folderHtml,folderSentMail,folderImage,folderSound,folderImportant,folderTar

OO Syntax

use HTML::Menu::TreeView qw(Tree);

use strict;

my @tree =(

	{

		image => 'tar.png',

		onclick => "alert('onclick');",

		text => 'Node',

	},

	{

		href => "http://www.google.de",

		text => 'Node',

	},

	{

		text => 'Folder',

		folderclass => 'folderMan', # only for Crystal styles

		subtree => [

			{

				text => 'TreeView.tigris.org',

				href => 'http://TreeView.tigris.org',

			},

		],

	},

);

my $TreeView = new HTML::Menu::TreeView();

$TreeView->setStyle("bw");

print $TreeView->css('.');

print TreeView->jscript();

print $TreeView->Tree(\@tree);

FO Syntax

use HTML::Menu::TreeView qw(Tree css jscript setStyle setDocumentRoot);

setDocumentRoot("/srv/www/httpdocs");

setStyle("Crystalm");

print css();

print jscript();

print Tree(\@tree);

DESCRIPTION

TML::Menu::TreeView ist a Modul to build an Html tree of an AoH.

Changes

0.5.1

new Namespace HTML::Menu::TreeView

new styles red green orange.

alternate folder symbols for Crystalm style.

one folder for mimetypes (link images).

warn instead of die

spacer.gif for emty cells which contain only a background image.

Overwrought code, test, Documentation, styles, examples.

shebang within pod crashes some older Perl verions

0.4

New SYNTAX, setter for DocumentRoot and Style.

Overwrought Documentation, code,exaples.

New default style (Crystalm).

0.3

Opera fixed...

0.2

should be fit for mod_perl,

the main change is that modul make use of a Lincoln Loader like getSelf method to provide an OO and FO Syntax

(the SYNOPSIS).

cleaner code.

PUBLIC

new()

show SYNOPSIS.

setStyle($style)

setStyle("style");

bw = Black & White Style

blw = Blue Style

blwm = Blue Modern Style

plastic = Plastic Style

plasticm = Plastic Modern Style

kde = Suse 10.1 like style

Crystalm = Suse 10.1 like style

simple = redmond like style

simplem = modern redmond like style

system = Gray redmond like style

red = red Modern Style

green = green Modern Style

orange = orange Modern Style

getStyle()

mainly for testing.

setDocumentRoot($path)

set the local path to the style folder.

should be the DocumentRoot of the webserver.

example: setPath('/srv/www/htdocs');

default: /srv/www/htdocs'

getDocumentRoot()

mainly for testing.

css()

return the necessary css part without <style></style> tag.

You can also include it with

<link href="/style/Crystalm/Crystalm.css" rel="stylesheet" type="text/css">

jscript()

return the necessary javascript without <script> tag.

You can also include it with

<script language="JavaScript1.5" type="text/javascript" src="/style/TreeView.js"></script>

Tree()

Tree(\@tree,optional $style);

Returns the TreeView without javasript and css.

PRIVATE

privat initTree()

$self->initTree(\@tree);

called by Tree.

privat getSelf()

my($self,@p) = getSelf(@_);

privat appendFolder()

called by initTree.

privat appendLastFolder()

show appendFolder

privat appendNode()

called by initTree.

privat appendLastNode()

show appendNode.

AUTHOR

Dirk Lindner <lindnerei@o2online.de>

COPYRIGHT AND LICENSE

Copyright (C) 2006 by Hr. Dirk Lindner

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.