Hi,
Just wanted to say maybe adding a sorting by ALpha through the block would be a nice addon.
I've added the following like to the code to make it work.
OLD:
/**
* Implementation of hook_allowed_values().
*/
function blockreference_allowed_values($field) {
$options = _blockreference_potential_references($field, TRUE);
foreach ($options as $key => $value) {
$options[$key] = _blockreference_item($field, $value);
}
if (!$field['required']) {
$options = array(0 => '<'. t('none') .'>') + $options;
}
return $options;
}
NEW:
OLD:
/**
* Implementation of hook_allowed_values().
*/
function blockreference_allowed_values($field) {
$options = _blockreference_potential_references($field, TRUE);
foreach ($options as $key => $value) {
$options[$key] = _blockreference_item($field, $value);
}
+ array_multisort(array_map('strtolower', $options), $options);
if (!$field['required']) {
$options = array(0 => '<'. t('none') .'>') + $options;
}
return $options;
}
Comments
Comment #1
danielb commenteddone, thanks