Sf attr bytype

From ARK
Jump to: navigation, search

Description

The sf_attr_bytype subform is a generic script to assign an attribute of a specific type. It is a updated and more general version of the earlier sf_finds.

Additional Fields

'op_dd_order' => 'id_desc', // options are the options of ddAttr()

This op can be used by admins to set up sort orders for the menus. Please see the documentation of the ddAttr() function for a list of possible options.

'op_editctrllist' => TRUE

This option is used to allow a dialogue box that permits adding to the controlled lists. If you don NOT want this to appear, UNSET this settings var. Admins should also set up an array of sgrps that can have access to this feature (suggest admins only). The array goes into the main settings file just after the filter admin permissions as follows:

// Control list permissions
// Members of the following (sgrp) groups will have permission to add items to controlled lists
$ctrllist_admin_grps =
    array(
        1
);

Display Modes

sf_attr_bytype has a number of different ways of displaying the different attributes. These choices are set on a FIELD BY FIELD basis.

The default is to display attributes as a dynamic dropdown list (i.e. once a choice is made another dropdown appears allowing the user to attach another attribute fo the same type). However, you can add the following op to the field setting:

'op_display_mode'=> 'radio' - Will display all the attributes of that type as radio buttons. This can be used when you want to limit the user to only being able to attach one attribute.

'op_display_mode'=> 'checkbox' - Will display all the attributes of that type as checkboxes, allowing easy clicking on and clicking off of attributes

If you want the same attributetype to be displayed in more than one place with a a different display mode then make a another field for it in the field_settings.php

Example Configuration

$conf_mcd_samplestatus =
    array(
        'view_state' => 'max',
        'edit_state' => 'view',
        'sf_nav_type' => 'full',
        'sf_title' => 'samplestatus',
        'sf_html_id' => 'smp_samplestatus', // Must be unique
        'script' => 'php/subforms/sf_attr_bytype.php',
        'op_label' => 'space',
        'op_input' => 'save',
        'fields' => array(
            $conf_field_samplestatus,
	    $conf_field_priority,
	    $conf_field_sampleaction
        )
);