You are here

public function TMGMTTranslatorUIController::overviewFormSubmit in Translation Management Tool 7

Overview form submit callback.

Parameters

$form: The form array of the overview form.

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

Overrides EntityDefaultUIController::overviewFormSubmit

File

ui/includes/tmgmt_ui.controller.translator.inc, line 53
Contains the translator UI controller.

Class

TMGMTTranslatorUIController
Entity UI controller for the Translator Entity.

Code

public function overviewFormSubmit($form, &$form_state) {

  // Update image effect weights.
  if (!empty($form_state['values']['translators'])) {
    $translators = tmgmt_translator_load_multiple(array_keys($form_state['values']['translators']));
    foreach ($form_state['values']['translators'] as $key => $item) {
      if (isset($translators[$key])) {
        $translators[$key]->weight = $item['weight'];
        entity_save($this->entityType, $translators[$key]);
      }
    }
  }
}