Wim,
I am pulling out my php hacking skills and decided to clean up the drop downs a bit. I apologize in advance for the code but I made some fixes to my local HS3 module and would like to pass along the changes. Basically I have changed all the and to properly reflect the labels given in the config for the HS. I have attached my modified code in the zip
I hope this helps a bit
Replace on line 1413:
$hierarchy->levels[$depth] = $first_slice + array('create_new_level' => '<'. t('create new level') .'>') + $second_slice;
With:
if ($config['level_labels']['status']) {$label = $config['level_labels']['labels'][$depth + 1]; } else {$label = 'Level';}
$hierarchy->levels[$depth] = $first_slice + array('create_new_level' => '<'. t('create new ' . $label) .'>') + $second_slice;
Replace on line 1326:
$hierarchy->levels[0] = array('create_new_item' => '<'. t('create new item') .'>') + $hierarchy->levels[0];
With:
if ($config['level_labels']['status']) {$label = $config['level_labels']['labels'][0]; } else {$label = 'Item';}
$hierarchy->levels[0] = array('create_new_item' => '<'. t('create new ' . $label) .'>') + $hierarchy->levels[0];
Replace on line 1356:
$hierarchy->levels[$depth] = array('create_new_item' => '<'. t('create new item') .'>') + $hierarchy->levels[$depth];
With:
if ($config['level_labels']['status']) {$label = $config['level_labels']['labels'][$depth]; } else {$label = 'Item';}
$hierarchy->levels[$depth] = array('create_new_item' => '<'. t('create new '. $label) .'>') + $hierarchy->levels[$depth];
Replace on line 1374:
$hierarchy->levels[$depth] = array('create_new_item' => '<'. t('create new item 33') .'>') + $hierarchy->levels[$depth];
With:
if ($config['level_labels']['status']) {$label = $config['level_labels']['labels'][$depth]; } else {$label = 'Item';}
$hierarchy->levels[$depth] = array('create_new_item' => '<'. t('create new '. $label) .'>') + $hierarchy->levels[$depth];
Replace on line 1388:
$hierarchy->levels[$depth] = ($config['editability']['status'] && module_hook($config['module'], 'hierarchical_select_create_item')) ? array('create_new_item' => '<'. t('new !item', array('!item' => $config['editability']['item_types'][$depth])) .'>') : array();
With
$hierarchy->levels[$depth] = ($config['editability']['status'] && module_hook($config['module'], 'hierarchical_select_create_item')) ? array('create_new_item' => '<'. t('create new !item', array('!item' => $config['editability']['item_types'][$depth])) .'>') : array();
Comments
Comment #1
wim leersThanks 32940stf, but I've already fixed it over here myself: http://drupal.org/node/257969#comment-893253 :)