You are here

public function GroupTypeUIController::overviewFormSubmit in Group 7

Overview form submit callback.

Parameters

array $form: The form array of the overview form.

array $form_state: The overview form state which will be used for submitting.

Overrides EntityDefaultUIController::overviewFormSubmit

File

classes/group_type.ui_controller.inc, line 111
Defines the Entity API UI class for group types.

Class

GroupTypeUIController
UI class for group types.

Code

public function overviewFormSubmit($form, &$form_state) {
  if (empty($form_state['values']['weights'])) {
    return;
  }
  foreach ($form_state['values']['weights'] as $name => $weight) {
    $group_type = group_type_load($name);
    if (entity_has_status('group_type', $group_type, ENTITY_FIXED)) {
      continue;
    }
    if ($group_type->weight != $weight) {
      $group_type->weight = $weight;
      $group_type
        ->save();
    }
  }
}