Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frederickjh/d1d62c12d83bc1f3342d to your computer and use it in GitHub Desktop.
Save frederickjh/d1d62c12d83bc1f3342d to your computer and use it in GitHub Desktop.
Code from slide 45 of "Tailor your backend to meet the clients needs" - remove items from vertical tabs, and add them to another fieldset
<?php
/** Text from slide 45 of "Tailor your backend to meet the clients needs"
* http://www.slideshare.net/stevenvdhout/durable-drupal-backend
* remove items from vertical tabs, and add them to another fieldset
**/
if (isset($form['#groups']['group_settings'])) {
$weight = 0;
foreach ($form as $key => $value) {
if(is_array($value) && isset($value['#group'])) {
unset($form[$key]['#group']);
$form['#group_children'][$key] = "group_settings";
// make sure these fieldset show up at the bottom
$form[$key]['#weight'] = 100 + $weight;
$weight++;
}
}
// make sure the actions are last
$form['actions']['#weight'] = 100 + $weight;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment