You are here

public static function UltimateCronPluginMultiple::jobSettingsFormSubmit in Ultimate Cron 7.2

Job settings form submit handler.

Overrides UltimateCronPlugin::jobSettingsFormSubmit

File

./ultimate_cron.plugin.inc, line 803
Plugin framework for Ultimate Cron.

Class

UltimateCronPluginMultiple
Class for handling multiple plugins.

Code

public static function jobSettingsFormSubmit($form, &$form_state, $plugin_type, $job = NULL) {
  $plugins = _ultimate_cron_plugin_load_all($plugin_type);
  foreach ($plugins as $name => $plugin) {
    if ($plugin
      ->isValid($job)) {
      $plugin
        ->settingsFormSubmit($form, $form_state, $job);

      // Weed out blank values that have fallbacks.
      $elements =& $form['settings'][$plugin_type][$name];
      $values =& $form_state['values']['settings'][$plugin_type][$name];
      $plugin
        ->cleanForm($elements, $values, array(
        'settings',
        $plugin_type,
        $name,
      ));
    }
    else {
      unset($form_state['values']['settings'][$plugin_type][$name]);
    }
  }
}