function mb_content_admin_form_submit in More Buttons 7
Implements hook_form_submit().
Save options from "Add content type" form and administer nodetype form.
1 string reference to 'mb_content_admin_form_submit'
- mb_content_form_alter in mb_content/
mb_content.module - Implements hook_form_alter().
File
- mb_content/
mb_content.module, line 491 - Provides additional buttons for nodes.
Code
function mb_content_admin_form_submit($form, &$form_state) {
// Handle button management on the "Add content type" page.
// Delete the dummy content type system variable
// and set the right content type system variable.
foreach ($form_state['values'] as $key => $value) {
if ($key == 'type') {
$type = $value;
}
if (preg_match("/^mb_content_type_dummy/", $key)) {
// Insert the right content type.
$new_type = preg_replace("/mb_content_type_dummy/", $type, $key);
$form_state['values'][$new_type] = $value;
// Delete the dummy content type.
unset($form_state['values'][$key]);
}
}
}