Utils/BookmarkBrowser

From EPESI framework documentation
Jump to: navigation, search


Since EPESI version 1.3 this module is not available

Utils/BookmarkBrowser is a very easy to use module for displaying such data sets as contact lists. This module displays all data in one table divided into sections (those have to be specified by the programmer). List of all sections is displayed over the table and clicking on any of them scrolls table directly to selected section.

Initalization

Like for most of epesi modules:

$bookmark_browser = & $this->init_module('Utils/BookmarkBrowser');

And to display its content:

$this->display_module($bookmark_browser);

Usage

Adding Elements

Syntax
$bookmark_browser = & $this->init_module('Utils/BookmarkBrowser');
$bookmark_browser->add_item( <bookmark>, <title>, <element> );
Example
$bookmark_browser = & $this->init_module('Utils/BookmarkBrowser');
$bookmark_browser->add_item( 'B', 'Boston', 'Boston' );

<bookmark> is name of group to which the <element> belongs. <element> is actually what is displayd in the page. <title> is used when you choose to sort your data to determine order (<element> may containt some javascript or html data that could affect order).

Sorting

Syntax
$bookmark_browser = & $this->init_module('Utils/BookmarkBrowser');
$bookmark_browser->sort();

This simply sorts the data by values given in second parameter of add_item method.

Fitting to screen

Syntax
$bookmark_browser = & $this->init_module('Utils/BookmarkBrowser');
$bookmark_browser->strech();

When using this method Utils/BookmarkBrowser tries to expand itself vertically to use maximum of browser's window height and not to couse scrollbar to appear. Use it only, when Utils/BookmarkBrowser is the lowest element of your module and rest does not take much place.