NAME
Konstrukt::Plugin::bookmarks - Bookmark management for registered users
SYNOPSIS
You may simply integrate it by putting
<& bookmarks / &>
somewhere in your website.
DESCRIPTION
This Konstrukt Plug-In provides bookmark-facilities for your website.
You may simply integrate it by putting
<& bookmarks / &>
somewhere in your website.
To be able to reference the stored bookmarks as links, which will update the visit counters and last visit timestamps and redirect to the URL stored in the bookmark create an empty redirect.ihtml (or any othername) with this content:
<& bookmarks show="visit" / &>
Then reference the bookmark like this:
<a href="redirect.ihtml?id=<bookmark-id>">Bookmark-Title</a>
CONFIGURATION
You may do some configuration in your konstrukt.settings to let the plugin know where to get its data and which layout to use. Default:
#backend
bookmarks/backend DBI
See the documentation of the backend modules (e.g. "CONFIGURATION" in Konstrukt::Plugin::bookmarks::DBI) for their configuration.
#layout
bookmarks/template_path /templates/bookmarks/
bookmarks/root_title Links
#user levels
bookmarks/userlevel_write 2
bookmarks/userlevel_admin 3
METHODS
execute_again
Yes, this plugin may return dynamic nodes (i.e. template nodes).
init
Initializes this object. Sets $self->{backend} and $self->{template_path}layout/. init will be called by the constructor.
install
Installs the templates.
Parameters:
none
prepare
We cannot prepare anything as the input data may be different on each request. The result is completely dynamic.
execute
All the work is done in the execute step.
Parameters:
$tag - Reference to the tag (and its children) that shall be handled.
add_entry_show
Displays the form to add a bookmark.
add_entry
Takes the HTTP form input and adds a new bookmark entry.
Diesplays a confirmation of the successful addition or error messages otherwise.
edit_entry_show
Displays the form to edit a bookmark.
get_flat_category_list
Flattens the tree of categories into an array of references to the category:
(
{
id => ..,
title => ..,
author => ..,
private => ..,
depth => ..,
categories => [ ... ],
bookmarks => [ ... ]
},
{ ... },
...
)
Parameters:
$id - The id of the catetegory whose sub-categories should be flattened. (optional)
$depth - The current depth. (optional)
edit_entry
Takes the HTTP form input and updates the requested bookmark.
Displays a confirmation of the successful update or error messages otherwise.
delete_entry_show
Displays the confirmation form to delete an entry.
delete_entry
Deletes the specified entry.
Displays a confirmation of the successful removal or error messages otherwise.
show_entry
Shows the requested bookmark.
Parameters:
$id - ID of the bookmark to show (optional)
show_entries
Shows the categories and bookmarks.
Parameters:
$category - The category whose entries should be displayed
show_entries_collect_data
Recursively generates the tree of categories and bookmarks.
Returns a Konstrukt node that will display the tree.
Only used internally by "show_entries".
Parameters:
$id = The id if the category that should be handled
$user_id = The id of the user currently logged in
$user_level = The user level of the user currently logged in
$user_write = True, if the current user may create new entries
$user_admin = True, if the current user is an admin
$tree = Tree symbol of this category. Passed from the parent entry.
add_category_show
Displays the form to add a category.
add_category
Takes the HTTP form input and adds a new bookmark category.
Displays a confirmation of the successful addition or error messages otherwise.
edit_category_show
Displays the form to edit a category.
edit_category
Takes the HTTP form input and updates an existing bookmark category.
Displays a confirmation of the successful update or error messages otherwise.
delete_category_show
Displays the confirmation form to delete a category.
delete_category
Takes the HTTP form input and removes an existing bookmark category.
Displays a confirmation of the successful removal or error messages otherwise.
visit
Redirects to a given bookmark. Increases the "visits" counter and updates the "last visit" date.
AUTHOR
Copyright 2006 Thomas Wittek (mail at gedankenkonstrukt dot de). All rights reserved.
This document is free software. It is distributed under the same terms as Perl itself.
SEE ALSO
Konstrukt::Plugin::bookmarks::DBI, Konstrukt::Plugin, Konstrukt