Commit dc329a53 authored by M Parker's avatar M Parker

Add functions to output options arrays for constants.

parent 3af18dc8
......@@ -183,6 +183,46 @@ function d3_sankey_libraries_info_alter(&$libraries) {
/* Helper functions. */
/**
* Helper function to return an array of Sankey chart type options.
*
* The output from this function is intended to be used as the '#options'
* property for Form API 'checkboxes', 'radios', 'select', and 'tableselect'
* controls.
*
* @return array
* An associative array, where the key is a string representing the type of
* Sankey chart, and the value is a string containing a translated label for
* that type of Sankey chart.
*/
function d3_sankey_options_sankeytype() {
return array(
D3_SANKEY_SANKEYTYPE_DEFAULT => t('Default'),
D3_SANKEY_SANKEYTYPE_SELECTION => t('Current item selection'),
D3_SANKEY_SANKEYTYPE_PATH => t('Current item and path selection'),
);
}
/**
* Helper function to return an array of Sankey label alignment options.
*
* The output from this function is intended to be used as the '#options'
* property for Form API 'checkboxes', 'radios', 'select', and 'tableselect'
* controls.
*
* @return array
* An associative array, where the key is a string representing the alignment
* for node labels in a Sankey chart, and the value is a string containing a
* translated label for that type of label alignment.
*/
function d3_sankey_options_alignlabel() {
return array(
D3_SANKEY_ALIGNLABEL_AUTO => t('Automatically align labels'),
D3_SANKEY_ALIGNLABEL_START => t('Align labels to start of paths'),
D3_SANKEY_ALIGNLABEL_END => t('Align labels to end of paths'),
);
}
/**
* Helper function to return the path to the libraries contained in this module.
*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment