Created
March 17, 2015 21:00
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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
http://www.slideshare.net/stevenvdhout/durable-drupal-backend
https://www.youtube.com/watch?v=N0JHKi-OosM