Hello,
Here's another suggestion for the TAC configuration (Administration > Configuration > Taxonomy access control), but I'm not sure it is the best way to do it :
For example, if I got the vocabulary "Video game", containing the following terms tree :
- Role Playing Game
- Under 12 years old
- Under 18 years old
- 18 years old and more
- Strategy Game
- Under 12 years old
- Under 18 years old
- 18 years old and more
when editing TAC for a role, I see the "Video game" terms, but without their parent terms : I see 2 times "Under 12 years old", but without knowing which one refers to Role Playing Game and which one to Strategy Game.
A piece of PHP which works, but I'm not sure it's the best :
in taxonomy_access.admin.inc, function theme_taxonomy_access_admin_form() :
<?php
foreach (array_keys($form['vocabs']) as $vid) {
if (is_numeric($vid) AND isset($form['grants'][$vid])) {
$row = $sub_header;
$row[0] = array('data' => '<h3>' . check_plain($form['vocabs'][$vid]['#title']) . '</h3>', 'colspan' => 3);
$rows[] = $row;
foreach (array_keys($form['grants'][$vid]) as $tid) {
if (is_numeric($tid)) {
$select_key = $tid? 'selected_terms' : 'selected_defaults';
$select_id = $tid? $tid : $vid;
/**
* suggestion - BEGINNING
*/
if (!empty($tid)) {
$_taxoParents = taxonomy_get_parents_all($tid);
if (isset($_taxoParents[0])) unset($_taxoParents[0]);
if (count($_taxoParents) > 0) {
foreach ($_taxoParents as $_taxoParent) {
$form[$select_key][$select_id]['#title'] = $_taxoParent->name . ' > ' . str_replace(' ', '', $form[$select_key][$select_id]['#title']);
}
}
}
/**
* suggestion - END
*/
$row = array(
array('data' => drupal_render($form[$select_key][$select_id]), 'colspan' => 3),
);
// et cetera
}
}
}
}
?>
What do you think about that ?
Comments
Comment #1
xjmThanks for the suggestion. This bothers me at times too. However, I'm worried that this would make the form even noisier.
In general TAC's UI needs an overhaul, so this is something we should keep in mind for that.
Comment #2
xjmTagging.