NAME
HTML::Menu::TreeView
SYNOPSIS
use HTML::Menu::TreeView qw(Tree);
my @tree =( {
text => 'Folder',
subtree => [
{
text => 'treeview Homepage',
href => 'http://treeview.lindnerei.de',
}
],
},);
Tree(\tree);
OO Syntax
use HTML::Menu::TreeView qw(Tree);
use strict;
my @tree =(
{
image => 'tar.png',
onclick => "alert('onclick');",
text => 'Node',
},
{
href => "http://www.lindnerei.de",
text => 'Lindnerei.de',
},
{
text => 'Folder',
folderclass => 'folderMan', # only for Crystal styles
subtree => [
{
text => 'subversion',
href => 'http://TreeView.tigris.org',
},
],
},
);
my $TreeView = new HTML::Menu::TreeView();
$TreeView->setStyle("simple");
print $TreeView->css("/srv/www/httpdocs");
print TreeView->jscript();
print $TreeView->Tree(\@tree);
allowed attributes:
href URI for linked resource.
accesskey accessibility key character.
charset char encoding of linked resource.
class class name or set of class names to an element.
coords for use with client-side image maps.
dir the base direction of directionally neutral text.
hreflang language code.
lang the base language of an elements attribute values and text content.
onblur the element lost the focus.
ondblclick event occurs when the pointing device button is double clicked
onclick event occurs when the pointing device button is clicked over an element.
onfocus the element got the focus.
onkeydown event occurs when a key is pressed down over an element.
onkeypress event occurs when a key is pressed and released over an element.
onkeyup event occurs when a key is released over an element.
onmousedown event occurs when the pointing device button is pressed over an element.
onmousemove event occurs when the pointing device is moved while it is over an element.
onmouseout event occurs when the pointing device is moved away from an element.
onmouseover event occurs when the pointing device is moved onto an element.
onmouseup event occurs when the pointing device button is released over an element.
rel forward link types.
rev reverse link types.
shape for use with client-side image maps.
style specifies style information for the current element.
tabindex position in tabbing order.
target target frame information.
type advisory content type.
title element title.
id This attribute assigns a name to an element. This name must be unique in a document.
Possible values for folderclass :
folderMan, folderVideo,folderCrystal,
folderLocked , folderText, folderFavorite,
folderPrint,folderHtml,folderSentMail,
folderImage,folderSound,folderImportant,
folderTar,folderYellow ,folderGray,
folderGreen and folderRed
see http://treeview.lindnerei.de/cgi-bin/crystal.pl for a complete list of possible values for folderclass.
FO Syntax
use HTML::Menu::TreeView qw(:all);
setDocumentRoot("/srv/www/httpdocs");
print css();
print jscript();
print Tree(\@tree,"Crystal");
DESCRIPTION
HTML::Menu::TreeView is a Modul to build an Html tree of an AoH.
Changes
0.6.8
Meta.yml and Signature
include a few example scripts: oo,fo syntax,crystal and module2treeview.
new function help
more tests.
Overwrought Documentation.
new()
if you use the oo interface you can say:
my $TreeView = new HTML::Menu::TreeView(\@tree);
and then call Tree without arguments.
print $TreeView->Tree();
setStyle()
setStyle('style');
simple = redmond like style
Crystal = Crystal style
setSize()
only for Crystal styles
16,32,48,64 and 128 are possible values.
setClasic()
use a classic node decoration
setModern()
use a classic node decoration
is the dafault decoration.
help()
help for link attributes.
return a hashref in void context,
my $hashref = help();
foreach my $key (sort(keys %{$hashref})){
print "$key : ", $hashref->{$key} ,$/;
}
or a help Message.
print help('href'),$/;
clasic()
bool clasic() ( node decoration)
getStyle()
mainly for testing.
setDocumentRoot()
set the local path to the style folder.
should be the DocumentRoot of the webserver.
example: setDocumentRoot('/srv/www/htdocs');
default: /srv/www/htdocs
getDocumentRoot()
mainly for testing.
css()
return the necessary css part without <style></style> tag.
you can set the DocumentRoot if you pass a parameter
css('/srv/www/htdocs');
You can also include it with
<link href="/style/Crystal/16/html-menu-treeview/Crystal.css" rel="stylesheet" type="text/css">
for example.
jscript()
return the necessary javascript without <script> tag.
You can also include it with
<script language="JavaScript" type="text/javascript" src="/style/treeview.js"></script>
preload()
return a javascript for preloading images.
for example you can also include it with
<script language="JavaScript" type="text/javascript" src="/style/Crystal/16/html-menu-treeview/preload.js"></script>
or
<script language="JavaScript" type="text/javascript" src="/style/Crystal/preload.js"></script>
if you use different images sizes.
Tree()
Tree(\@tree,optional $style);
Returns the Html part of the TreeView without javasript and css.
SEE ALSO
http://www.lindnerei.de, http://treeview.lindnerei.de
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 Lesser General Public License as published by the Free Software Foundation; 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 Lesser General Public License for more details.