Sf linklist

From ARK
Revision as of 18:21, 14 July 2010 by Guy (talk | contribs) (Description)

Jump to: navigation, search

Description

The sf_linklist is for outputting formatted lists of links. The text appearing within the link is markup and is thus non language specific. The subform does not handle data.

As this does not handle data, the fields array is used to carry the link_list. This is a simple list of links that will be formatted and outputted into the left panel. Each link requires the following:

  • href - link to the output
  • mknname - mark-up nickname will search the markup table for this nickname and print the markup

within the 'href' the following vars need to be set up (see example below):

  • view - the view the link should point to (regist, detfrm, files or a custom view)
  • item_key - itemkey to point to if any (cxt_cd, smp_cd)
$link_list[] = 
    array(
        'href' => "{$_SERVER['PHP_SELF']}?view=regist&item_key=cxt_cd", 
        'mknname' => 'regcxt'
);
$link_list[] = 
    array(
	'href' => "{$_SERVER['PHP_SELF']}?view=detfrm&item_key=cxt_cd", 
	'mknname' => 'detcxt'
);
$link_list[] = 
    array(
	'href' => "{$_SERVER['PHP_SELF']}?view=regist&item_key=pln_cd", 
	'mknname' => 'regpln'
);

Additional Fields

There are no obligatory additional fields, but beware that 'fields' must contain the link list and should NOT contain ARK fields

Example Configuration

An example of sf_linklist using a single modtype

$delp_subform1 =
    array(
        'view_state' => 'max',
        'edit_state' => 'view',
        'sf_nav_type' => 'none',
        'sf_title' => 'lplinklist', 
        'sf_html_id' => 'lplinklist', // Must be unique
        'script' => 'php/subforms/sf_linklist.php',
        'op_label' => 'space',
        'op_input' => 'save',
        'op_modtype' => FALSE, //if each modtype uses same fields (see below)
        'op_condition' =>
            array(
                array(
                    'func'=> 'chkUserPerm',
                    'args'=> array(84)
            )
        ),
        'fields' => $lp_link_list
);