public function PhotosAdminStructureForm::submitForm in Album Photos 8.5
Same name and namespace in other branches
- 6.0.x src/Form/PhotosAdminStructureForm.php \Drupal\photos\Form\PhotosAdminStructureForm::submitForm()
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 ConfigFormBase::submitForm
File
- src/
Form/ PhotosAdminStructureForm.php, line 170
Class
- PhotosAdminStructureForm
- Defines a form to configure maintenance settings for this site.
Namespace
Drupal\photos\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
parent::submitForm($form, $form_state);
$this
->config('photos.settings')
->set('photos_access_photos', $form_state
->getValue('photos_access_photos'))
->set('view_mode_rearrange_album_page', $form_state
->getValue('view_mode_rearrange_album_page'))
->set('view_mode_rearrange_image_page', $form_state
->getValue('view_mode_rearrange_image_page'))
->save();
// Set warning if private file path is not set.
if (!PrivateStream::basePath() && $form_state
->getValue('photos_access_photos')) {
$this->messenger
->addWarning($this
->t('Warning: image files can
still be accessed by visiting the direct URL. For better security, ask
your website admin to setup a private file path.'));
}
}