<?php
/**
* The template file to show bookmarks, instantiates a proper tree-delegate and tree renderer
*
* @package be.nauta.booby.plugins.bookmarks.view
* @author Barry Nauta
* @copyright Barry Nauta
*
* This file is part of the Booby project.
* The booby project is located at the following location:
* http://www.nauta.be/booby/
*
* Copyright (c) 2003 - 2004 Barry Nauta
*
* The Booby project is released under the General Public License
* More detailes in the file 'gpl.html' or on the following
* website: <code>http://www.gnu.org</code> and look for licenses
*
* Enjoy :-)
*/
/*
* Show the ancestor path. Contributed by Michael
*/
if(isset($parameters['ancestors']) && $parentId != 0)
{
echo ('<!-- Ancestors -->');
echo ('<table><tr>');
// The root link
echo ('<td><a href="?parentId=0" class="ancestor">'.$dictionary['root'].'</a></td>');
// all ancestors other than root
foreach($parameters['ancestors'] as $ancestor)
{
echo ('<td> / ');
echo ('<a href="?parentId='.$ancestor->itemId.'" class="ancestor">');
echo ($ancestor->name);
echo ('</a>');
echo ('</td>');
}
echo ('</tr></table>');
}
include ('templates/'.$_SESSION['booby_template'].'/icons.inc');
$configuration = array ();
/*
* Build up a proper configuration for the tree display.
*/
$configuration['icons']=$icons;
$configuration['dictionary']=$dictionary;
$configuration['callback']='BookmarkController.php';
/*
* Check for conditional overlib
*/
if (isset ($_SESSION['bookmarkOverlib']))
{
$configuration ['overlib'] =$_SESSION['bookmarkOverlib'];
}
else
{
$configuration ['overlib'] = true;
}
/*
* Check where the link should be opened (same window or new window)
*/
if (isset ($_SESSION['bookmarkNewWindowTarget']))
{
$configuration ['bookmarkNewWindowTarget'] =$_SESSION['bookmarkNewWindowTarget'];
}
/*
* Are we displaying a yahoo like tree?
*/
if (isset ($_SESSION['bookmarkTree']) && $_SESSION['bookmarkTree'] == 'Yahoo')
{
include_once "base/view/YahooTree.php";
include_once "plugins/bookmarks/view/BookmarkYahooTreeDelegate.php";
/*
* Build up a proper configuration for the tree display, this makes only sense for
* the yahoo-like tree
*/
if (isset ($_SESSION['bookmarkYahooTreeColumnCount']))
{
$configuration ['numberOfColumns'] =$_SESSION['bookmarkYahooTreeColumnCount'];
}
else
{
$configuration ['numberOfColumns'] = 2;
}
$delegate = new BookmarkYahooTreeDelegate ($configuration);
$tree = new YahooTree ($delegate, $configuration);
}
/*
* If not, render using default
*/
else
{
include_once "base/view/Tree.php";
include_once "plugins/bookmarks/view/BookmarkExplorerTreeDelegate.php";
$delegate = new BookmarkExplorerTreeDelegate ($configuration);
$tree = new Tree ($delegate, $configuration);
/*
* Do we show expanded items? (This is not a useful option in the yahoo tree)
*/
if (isset ($_SESSION['bookmarkExpand']))
{
$tree -> setExpanded ($_SESSION['bookmarkExpand']);
}
}
/*
* Now actually show the layout
*/
echo ($tree -> toHtml ($parent, $renderObjects));
?>
|