NAME

Slash::Utility::Display - SHORT DESCRIPTION for Slash


SYNOPSIS

        use Slash::Utility;
        # do not use this module directly


DESCRIPTION

LONG DESCRIPTION.


EXPORTED FUNCTIONS

createSelect(LABEL, DATA [, DEFAULT, RETURN, NSORT, ORDERED])

Creates a drop-down list in HTML. List is sorted by default alphabetically according to list values.

Parameters
LABEL
The name for the HTML entity.

DATA
A hashref containing key-value pairs for the list. Keys are list values, and values are list labels. If an arrayref is passed, it is converted to a hashref, where the keys and values are the same.

DEFAULT
Default value for the list.

RETURN
See ``Return value'' below.

NSORT
Sort numerically, not alphabetically.

ORDERED
If an arrayref is passed, an already-sorted array reference of keys. If non-ref, then an arrayref of hash keys is created sorting the hash values, alphabetically and case-insensitively. If ORDERED is passed in either form, then the NSORT parameter is ignored.

Return value
If RETURN is true, the text of the list is returned. Otherwise, list is just printed, and returns true/false if operation is successful.

If there are no elements in DATA, just returns/prints nothing.

Dependencies
The 'select' template block.

selectTopic(LABEL [, DEFAULT, SECTION, RETURN])

Creates a drop-down list of topics in HTML. Calls createSelect.

Parameters
LABEL
The name for the HTML entity.

DEFAULT
Default topic for the list.

SECTION
Default section to take topics from.

RETURN
See ``Return value'' below.

Return value
If RETURN is true, the text of the list is returned. Otherwise, list is just printed, and returns true/false if operation is successful.

selectSection(LABEL [, DEFAULT, SECT, RETURN, ALL])

Creates a drop-down list of sections in HTML. Calls createSelect.

Parameters
LABEL
The name for the HTML entity.

DEFAULT
Default topic for the list.

SECT
Hashref for current section. If SECT->{isolate} is true, list is not created, but hidden value is returned instead.

RETURN
See ``Return value'' below.

ALL
Boolean for including ``All Topics'' item.

Return value
If RETURN is true, the text of the list is returned. Otherwise, list is just printed, and returns true/false if operation is successful.

Dependencies
The 'sectionisolate' template block.

selectSortcode()

Creates a drop-down list of sortcodes in HTML. Default is the user's preference. Calls createSelect.

Return value
The created list.

selectMode()

Creates a drop-down list of modes in HTML. Default is the user's preference. Calls createSelect.

Return value
The created list.

selectThreshold(COUNTS)

Creates a drop-down list of thresholds in HTML. Default is the user's preference. Calls createSelect.

Parameters
COUNTS
An arrayref of thresholds -> counts for that threshold.

Return value
The created list.

Dependencies
The 'selectThreshLabel' template block.

linkStory(STORY)

The generic ``Link a Story'' function, used wherever stories need linking.

Parameters
STORY
A hashref containing data about a story to be linked to.

Return value
The complete <A HREF ...></A> text for linking to the story.

Dependencies
The 'linkStory' template block.

pollbooth(QID [, NO_TABLE, CENTER])

Creates a voting pollbooth.

Parameters
QID
The unique question ID for the poll.

NO_TABLE
Boolean for whether to leave the poll out of a table. If false, then will be formatted inside a fancybox.

CENTER
Whether or not to center the tabled pollbooth (only works with NO_TABLE).

Return value
Returns the pollbooth data.

Dependencies
The 'pollbooth' template block.

currentAdminUsers()

Displays table of current admin users, with what they are adminning.

Return value
The HTML to display.

Dependencies
The 'currentAdminUsers' template block.

horizmenu()

Silly little function to create a horizontal menu from the 'mainmenu' block.

Return value
The horizontal menu.

Dependencies
The 'mainmenu' template block.

titlebar(WIDTH, TITLE)

Prints a titlebar widget. Deprecated; exactly equivalent to:

        slashDisplay('titlebar', {
                width   => $width,
                title   => $title
        });
Parameters
WIDTH
Width of the titlebar.

TITLE
Title of the titlebar.

Return value
None.

Dependencies
The 'titlebar' template block.

fancybox(WIDTH, TITLE, CONTENTS [, CENTER, RETURN])

Creates a fancybox widget.

Parameters
WIDTH
Width of the fancybox.

TITLE
Title of the fancybox.

CONTENTS
Contents of the fancybox. (I see a pattern here.)

CENTER
Boolean for whether or not the fancybox should be centered.

RETURN
Boolean for whether to return or print the fancybox.

Return value
The fancybox if RETURN is true, or true/false on success/failure.

Dependencies
The 'fancybox' template block.

portalbox(WIDTH, TITLE, CONTENTS, BID [, URL])

Creates a portalbox widget. Calls fancybox to process the box itself.

Parameters
WIDTH
Width of the portalbox.

TITLE
Title of the portalbox.

CONTENTS
Contents of the portalbox.

BID
The block ID for the portal in question.

URL
URL to link the title of the portalbox to.

Return value
The portalbox.

Dependencies
The 'fancybox', 'portalboxtitle', and 'portalmap' template blocks.

linkCommentPages(SID, PID, CID, TOTAL)

Print links to pages for additional comments.

Parameters
SID
Story ID.

PID
Parent ID.

CID
Comment ID.

TOTAL
Total number of comments.

Return value
Links.

Dependencies
The 'linkCommentPages' template block.

linkComment(COMMENT [, PRINTCOMMENT, DATE])

Print a link to a comment.

Parameters
COMMENT
A hashref containing data about the comment.

PRINTCOMMENT
Boolean for whether to create link directly to comment, instead of to the story for that comment.

DATE
Boolean for whather to print date with link.

Return value
Link for comment.

Dependencies
The 'linkComment' template block.

createMenu(MENU)

Creates a menu.

Parameters
MENU
The name of the menu to get.

Return value
The menu.

Dependencies
The template blocks 'admin', 'user' (in the 'menu' page), and any other template blocks for menus, along with all the data in the 'menus' table.


SEE ALSO

Slash(3), Slash::Utility(3).


VERSION

$Id: Display.pm,v 1.1.2.31 2001/10/01 23:15:10 pudge Exp $