Name

CatalystX::Usul::Plugin::Model::StashHelper - Convenience methods for stuffing the stash

Version

0.1.$Revision: 406 $

Synopsis

package CatalystX::Usul;
use parent qw(Catalyst::Component CatalystX::Usul::Base);

package CatalystX::Usul::Model;
use parent qw(CatalystX::Usul CatalystX::Usul::StashHelper);

package YourApp::Model::YourModel;
use parent qw(CatalystX::Usul::Model);

Description

Many convenience methods for stuffing/resetting the stash. The form widget definitions will be replaced later by the form building method which is called from the HTML view

Subroutines/Methods

add_append

Stuff some content into the stash so that it will appear in the append div in the template. The content is a hash ref which will be interpreted as a widget definition by the form builder which is invoked by the HTML view. Multiple calls push the content onto a stack which is rendered in the order in which it was stacked

add_button

Add a button definition to the stash. The template will render these as image buttons on the bbar div

add_buttons

Loop around "add_button"

add_chooser

Generates the data for the popup chooser window which allows a data value to be selected from a list produced by some query. It is intended as a replacement for a popup menu widget where the list of values would be prohibitively long

add_error

Stringifies the passed error object, localises the text, logs it as an error and calls "add_result" to display it at the top of the sdata div

add_error_msg

Localises the message text, creates a new error object and calls "add_error"

add_field

Create a widget definition for a form field

Adds some useful debugging info to the footer

add_header

Stuffs the stash with the data for the page header

add_hidden

Adds a hidden field to the form

add_result

Adds the result of forwarding to an an action. This is the result div in the template

add_result_msg

Localises the message text and calls "add_result"

Adds the sequence of links used in search page results; first page, previous page, list of pages around the current one, next page, and last page

add_sidebar_panel

Stuffs the stash with the data necessary to create a panel in the accordion widget on the sidebar

check_field_wrapper

$model->check_field_wrapper;

Extract parameters from the query and call check_field. Stash the result

clear_append

Clears the stash of the widget data used by the region appended to the main data store

clear_buttons

Clears button data from the stash

clear_controls

Groups the methods that clear the stash of data not used in a minority of pages

Clears all footer data. Called by "add_footer"

clear_form

Initialises the sdata div contents. Called by /stash_content on first use

clear_hidden

Clears the hidden fields from the form

clear_menu

Clears the stash of the main navigation menu data

Clears the stash of the quick links navigation data

clear_result

Clears the stash of messages from the output of actions

clear_sidebar

Clears the stash of the data used by the sidebar accordion widget

clear_tools

Clears the stash of the data used to create the tools menu

Adds a horizontal rule to separate the footer. Called by "add_footer"

group_fields

Stashes the data used by HTML::FormWidgets to throw fieldset around a group of fields

Returns a content hash ref that renders as a clickable image anchor. The link returns to the web servers default page

open_window

Returns the Javascript fragment that will open a new window in the web browser

search_page

Create a KinoSearch results page

simple_page

Creates a "simple" page from information stored in the configuration files

stash_content

Pushes the content (usually a widget definition) onto the specified stack

stash_form

Calls "stash_content" specifying the sdata stack

stash_meta

Adds some meta data to the response for an Ajax call

Configuration and Environment

None

Diagnostics

None

Dependencies

CatalystX::Usul
Data::Pageset
Lingua::Flags
Time::Elapsed

Incompatibilities

There are no known incompatibilities in this module.

Bugs and Limitations

There are no known bugs in this module. Please report problems to the address below. Patches are welcome

Author

Peter Flanigan, <Support at RoxSoft.co.uk>

License and Copyright

Copyright (c) 2008 Peter Flanigan. All rights reserved

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic

This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE