public UpdateManagerUpdate::submitForm(array &$form, FormStateInterface $form_state)
Form submission handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides FormInterface::submitForm
File
- core/modules/update/src/Form/UpdateManagerUpdate.php, line 312
Class
- UpdateManagerUpdate
- Configure update settings for this site.
Namespace
Drupal\update\Form
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | public function submitForm( array & $form , FormStateInterface $form_state ) { $this ->moduleHandler->loadInclude( 'update' , 'inc' , 'update.manager' ); $projects = array (); foreach ( array ( 'projects' , 'disabled_projects' ) as $type ) { if (! $form_state ->isValueEmpty( $type )) { $projects = array_merge ( $projects , array_keys ( array_filter ( $form_state ->getValue( $type )))); } } $operations = array (); foreach ( $projects as $project ) { $operations [] = array ( 'update_manager_batch_project_get' , array ( $project , $form_state ->getValue( array ( 'project_downloads' , $project )), ), ); } $batch = array ( 'title' => $this ->t( 'Downloading updates' ), 'init_message' => $this ->t( 'Preparing to download selected updates' ), 'operations' => $operations , 'finished' => 'update_manager_download_batch_finished' , 'file' => drupal_get_path( 'module' , 'update' ) . '/update.manager.inc' , ); batch_set( $batch ); } |
Please login to continue.