I was wondering why you've defined MENU_LOCAL_TASK items as you did...
Specifically, why have you added an item for the create form after each (rejected, deleted, unverified,etc) other local task? For example, you have:
'admin/user/accounts/rejected' => array(
'title' => 'Rejected',
'page callback' => 'ldapprov_list',
'page arguments' => array(3),
'access arguments' => array(LDAPPROV_PERMISSION),
'type' => MENU_LOCAL_TASK,
'weight' => 2,
),
'admin/user/accounts/rejected/create' => array(
'page callback' => 'drupal_get_form',
'page arguments' => array('ldapprov_create', 3),
'access arguments' => array(LDAPPROV_PERMISSION),
'type' => MENU_LOCAL_TASK,
),
Why not just have the first one, 'admin/user/accounts/rejected' and not the second 'admin/user/accounts/rejected/create'?
I don't see the need for having any of the other 'create' items other than this one:
'admin/user/accounts/new' => array(
'title' => 'Create user',
'page callback' => 'drupal_get_form',
'page arguments' => array('ldapprov_create', 3),
'access arguments' => array(LDAPPROV_PERMISSION),
'type' => MENU_LOCAL_TASK,
'weight' => 5,
),
Thanks for the explanation in advance!
Comments
Comment #1
miglius commentedI don't remember the exact reason why it was written like that back in drupal 47. From then on it was migrated without changing the menu logic. Maybe I had a requirement that there should be a distinct difference in the path or breadcrumb when a brand new account is created from the page where deleted or rejected accounts are created.
Comment #2
john franklin commentedyeah, those could all be collapsed down into a single create and list. The status of the account can be passed in as a parameter.