hs_flatlist.module in Hierarchical Select 6.3
Same filename and directory in other branches
Implementation of the Hierarchical Select API that allows one to use Hierarchical Select's dropbox for selecting multiple items of a flat list.
File
modules/hs_flatlist.moduleView source
<?php
/**
* @file
* Implementation of the Hierarchical Select API that allows one to use
* Hierarchical Select's dropbox for selecting multiple items of a flat list.
*/
//----------------------------------------------------------------------------
// Hierarchical Select hooks.
/**
* Implementation of hook_hierarchical_select_params().
*/
function hs_flatlist_hierarchical_select_params() {
$params = array(
'options',
);
return $params;
}
/**
* Implementation of hook_hierarchical_select_root_level().
*/
function hs_flatlist_hierarchical_select_root_level($params) {
return $params['options'];
}
/**
* Implementation of hook_hierarchical_select_children().
*/
function hs_flatlist_hierarchical_select_children($parent, $params) {
return array();
// A flat list doesn't have any children, ever.
}
/**
* Implementation of hook_hierarchical_select_lineage().
*/
function hs_flatlist_hierarchical_select_lineage($item, $params) {
return array(
$item,
);
// No hierarchies exist in flat lists.
}
/**
* Implementation of hook_hierarchical_select_valid_item().
*/
function hs_flatlist_hierarchical_select_valid_item($item, $params) {
return in_array($item, array_keys($params['options']));
}
/**
* Implementation of hook_hierarchical_select_item_get_label().
*/
function hs_flatlist_hierarchical_select_item_get_label($item, $params) {
return $params['options'][$item];
}
/**
* Implementation of hook_hierarchical_select_implementation_info().
*/
function hs_flatlist_hierarchical_select_implementation_info() {
return array(
'hierarchy type' => t('None: flat list'),
'entity type' => t('N/A'),
);
}
Functions
Name | Description |
---|---|
hs_flatlist_hierarchical_select_children | Implementation of hook_hierarchical_select_children(). |
hs_flatlist_hierarchical_select_implementation_info | Implementation of hook_hierarchical_select_implementation_info(). |
hs_flatlist_hierarchical_select_item_get_label | Implementation of hook_hierarchical_select_item_get_label(). |
hs_flatlist_hierarchical_select_lineage | Implementation of hook_hierarchical_select_lineage(). |
hs_flatlist_hierarchical_select_params | Implementation of hook_hierarchical_select_params(). |
hs_flatlist_hierarchical_select_root_level | Implementation of hook_hierarchical_select_root_level(). |
hs_flatlist_hierarchical_select_valid_item | Implementation of hook_hierarchical_select_valid_item(). |