NAME
OpenInteract2::Action::CommonDisplay - Task to display an object
SYNOPSIS
# Just subclass and the task 'display' is implemented
package OpenInteract2::Action::MyAction;
use base qw( OpenInteract2::Action::CommonDisplay );
# Relevant configuration entries in your action.ini
[myaction]
...
c_object_type = myobject
c_display_template = mypkg::detail
c_display_fail_task = mypkg::display_error
c_display_active_field = is_active
SUPPORTED TASKS
This common action supports the following tasks:
display - Display a non-editable object.
DESCRIPTION FOR 'display'
The 'display' task simply retrieves a specified object and sends it to a template. If the object checks its active status we first do that, but we don't really do too much.
TEMPLATES USED FOR 'display'
c_display_template (no default)
This it the template we send the object to. The same object can be found in two keys: 'object' and whatever you've set c_object_type
to. So a handler manipulating 'doodad' objects will find the specified doodad in 'object' and 'doodad'.
METHODS FOR 'display'
_display_customize( \%template_params )
Called just before we generate the content. You can add parameters to \%template_params
so your template will see them.
CONFIGURATION FOR 'display'
These are in addition to the template parameters defined above.
Basic
c_object_type ($) (REQUIRED)
SPOPS key for object you'll be displaying.
c_display_fail_task ($)
Task to run if we fail to fetch the object.
Default: 'common_error'
c_display_active_field
($)
If your object has a field indicating whether the object is active, specify it here. If specified we check the object for true values ('y', 'yes', '1', 'true') -- if none match, we pass control to the c_display_fail_task
.
System-created parameters
c_object_class ($)
SPOPS object class derived from c_object_type
.
c_id_field
($)
ID field found from c_object_class
.
c_id
($)
ID value used to fetch the object.
COPYRIGHT
Copyright (c) 2002-2004 Chris Winters. All rights reserved.
AUTHORS
Chris Winters <chris@cwinters.com>