It would be nice to be able to set the maximum number of levels that a user can create..
This could be put when the user selects "Allow creating new levels".

Comments

stBorchert’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)

You may implement hook_shs_add_term_access() to deny creating new terms. Simply spoken you need to get a list of all terms of the level you'd like to deny creating childs for and use this as the base for the hook implementation.

Example:

<?php 
/**
 * Implements hook_shs_add_term_access().
 */
function shs_access_shs_add_term_access($vid, $parent, $account) {
  // No new terms in 1st level and for all terms of level x.
  if ($parent == 0 || in_array($parent, $terms_in_level_x)) {
    return FALSE;
  }
  return TRUE;
}
?>
kitikonti’s picture

@stBochert is there a reason why this will not be added in the module itself? Not everyone who use this module is a developer and so they wont be able to use this code snippet. I ask because i also need this feature. I am able to make a custom module but i think it would make sence to add this to the module?

PS: I have related two other issues i have found with the same request to this issue.

kitikonti’s picture

So, i have tested this function but it dose not 100% do what i wanted to do. Ok i could restrict creating of new terms depending of a parent term, but if i have two levels and i want to be able to create new terms in the first and the second level, it always also shows a select box for the third level after selecting an option in the secound one. The only think that dose change is that i could disable the creation of terms for the third level, but the selectbox is still there. I know i could hide it with css but i was wondering if i could prevent the rendering of this field?