if none from db, db_htmlsafe, sprintf, function, eval, value is present an empty string will be displayed;

comma_format - optional, boolean if true the value is passed to the function comma_format;

timeformat - optional, boolean if true the value is passed to the function timeformat;

class - optional, a css class to use for the column;

style - optional, a css style to use for the column;

data_check - optional (2.1 only), an associative array, the key can be class or style, the value is a function that checks the value and return a class or a style to be used at the row (tr) level of the table.

items_per_page - optional (mandatory if get_count or base_href are present), the number of items to show in each page of the table;

get_count - an associative array that allows find the number of elements of the list, it can contain the following parameters:

file - optional a file (including path) to include;

function - mandatory, the function that counts the elements and return the value;

params - optional, an array of parameters that will be passed to the function;

base_href - optional (mandatory if items_per_page is present), the href to be user to construct the page index;

get_items - optional, an associative array that allows find the values of elements of the list, it can contain the following parameters:

file - optional a file (including path) to include;

function - mandatory, the function that returns the values of the elements;

params - optional, an array of parameters that will be passed to the function;

title - optional, the title of the table

start_var_name - optional, the starting variable name (not so sure)

default_sort_col - optional, the default column used to sort the table;

width - optional, the width of the table;

request_vars - optional, an associative array of values that can be taken from $_REQUEST to define the sorting (no idea what I'm writing), it can contain:

sort - optional, a $_GET variable name that define the column to sort;

desc - optional, a $_GET variable name to define if the column should be sorted ascending or descending;

form - optional, an associative array of data to create a form, it can contain:

hidden_fields - optional, an associative array in the form $key => $value that will be translated in hidden fields where $key will be the name of the field and $value the value (it contains by default the session data).

token - optional (2.1 only), a token name to be included as hidden field of the form;

include_start - optiolnal, boolean, if true include the starting page as hidden field (requires start_var_name);

include_sort - optional, booloean, if true add the parameter so that sorting remains the same after submitting;

no_items_label - optional, a string to show when there are no items in the list;

additional_rows - optional, an associative array or arrays that can contain HTML elements to be presented in different places on the list (supported positions are: top_of_list, after_title, above_column_headers, below_table_data, bottom_of_list), the position is the index of the associative array, than each array inside a certain position can contain:

value - mandatory, the HTML that will be inserted in the specified position;

class - optional, the name of a css class to style the element;

style - optional, a css in-line style that will be applied to the element;

javascript - optional, raw javascript that will be inserted at the end of the list;

list_menu - optional, an associative array that holds all the data to create a menu:

show_on - optional, where the menu should be created (can be both, top, bottom);

style - mandatory, can be button or tabs;

position - mandatory, the position of the tabs/buttons, it can be left or right (default is left);

links - mandatory, an array of associative data with the information to create the menu:

is_selected - mandatory, boolean, true if the menu item is selected;

href - mandatory, the url to be used for the menu;

label - mandatory, the name of the menu;

Calling the function

// Now that we have all the options, create the list.
require_once($sourcedir . '/Subs-List.php');
createList($listOptions);

Setting up the template

$context['sub_template'] = 'show_list';
$context['default_list'] = 'member_list'; // this must be the same as the id in $listOptions