Form submission handler.
array $form: An associative array containing the structure of the form.
array $form_state: An associative array containing the current state of the form.
Overrides FormInterface::submitForm
public function submitForm(array &$form, array &$form_state) {
$vocabularies = $form_state['values']['vocabularies'];
$entities = entity_load_multiple($this->entityType, array_keys($vocabularies));
foreach ($vocabularies as $id => $value) {
if (isset($entities[$id]) && $value['weight'] != $entities[$id]
->get('weight')) {
// Update changed weight.
$entities[$id]
->set('weight', $value['weight']);
$entities[$id]
->save();
}
}
drupal_set_message(t('The configuration options have been saved.'));
}