Sf action

From ARK
Revision as of 08:50, 22 September 2009 by Guy (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Description

This subform is used to attach actions to items. Although actions look a bit like XMIs in that they link actors to items, they have a key difference which is that the relationship is qualified by an actiontype. The field will need to be setup in field_settings.php and acctiontypes need to be entered in cor_lut_actiontype. An alias will also need to be entered in cor_tbl_alias that corresponds to the cor_lut_actiontype entry.

sf_event.php still exists as a parallel subform for handling events. The code from both could potentially be merged, but at this stage, they two can be used independently to do slightly different things with actions/events.

The new form makes use of some new styles and modifications to the main stylesheet. These changes also affect sf_xmi.php which shares some code with this form.

The form can be used to always act on a specified actiontype named in the field eg 'checkedby'. In this mode, only that action will be displayed in the actors list and that action will always be added by the add form.

The form can also be used in a dynamic mode by specifying 'dyn' as the actiontype for the field. In this mode, all actions associated with the item will display and a drop down menu will be offered to the user when selecting which action to associate with the actor and item.

In dynamic mode, an optional list of actiontypes to exclude may also be used. This 'op_exclude_actions' takes a comma separated (no spaces) list of action type numbers (may work with nicknames - not tested). This list of actions is then excluded from the form.

As with sf_event.php, the action field is expected to be wrapped in an event.

Additional Settings IN THE FIELD

Note that action fields using this form must be wrapped in an event. Also the following additional vars are required as of 0.7.

'displaytxt' - There is a new obligatory settings var for all event fields passed to this form 'displaytxt' which sets the nickname of the txt element of the actor to display eg. 'name' or 'initials' or indeed any other txttype attached to your abk entries.

'op_displaytxt2' - Used to set an optional second part of the name which appears after the name separated by a hyphen: "name - option".

Additional Settings IN THE SF

'op_exclude_actions' - In dynamic mode, an optional list of actiontypes to exclude may also be used. This 'op_exclude_actions' takes a comma separated (no spaces) list of action type numbers (may work with nicknames - not tested). This list of actions is then excluded from the form.

Example Configuration

An example of sf_action configuration:

$conf_mcd_action =
    array(
        'view_state' => 'max',
        'edit_state' => 'view',
        'sf_nav_type' => 'full',
        'sf_title' => 'event', 
        'sf_html_id' => 'cxt_actors', // Must be unique
        'script' => 'php/subforms/sf_action.php',
        'op_label' => 'space',
        'op_input' => 'save',
        'op_exclude_actions' => '1,2,4,5,3,25,12',
        'events' => array(
            $conf_event_actionexample,
        )
);