X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ffilter%2Fsrc%2FFilterFormatListBuilder.php;h=f15474694d5aadc42d43b1b3f09fc12e6793c12d;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=cf084564c0b44a76a82ea5a179da1c8add18c61c;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/filter/src/FilterFormatListBuilder.php b/web/core/modules/filter/src/FilterFormatListBuilder.php index cf084564c..f15474694 100644 --- a/web/core/modules/filter/src/FilterFormatListBuilder.php +++ b/web/core/modules/filter/src/FilterFormatListBuilder.php @@ -8,6 +8,7 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Messenger\MessengerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -29,6 +30,13 @@ class FilterFormatListBuilder extends DraggableListBuilder { */ protected $configFactory; + /** + * The messenger. + * + * @var \Drupal\Core\Messenger\MessengerInterface + */ + protected $messenger; + /** * Constructs a new FilterFormatListBuilder. * @@ -38,11 +46,14 @@ class FilterFormatListBuilder extends DraggableListBuilder { * The entity storage class. * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The config factory. + * @param \Drupal\Core\Messenger\MessengerInterface $messenger + * The messenger. */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, ConfigFactoryInterface $config_factory) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, ConfigFactoryInterface $config_factory, MessengerInterface $messenger) { parent::__construct($entity_type, $storage); $this->configFactory = $config_factory; + $this->messenger = $messenger; } /** @@ -52,7 +63,8 @@ class FilterFormatListBuilder extends DraggableListBuilder { return new static( $entity_type, $container->get('entity.manager')->getStorage($entity_type->id()), - $container->get('config.factory') + $container->get('config.factory'), + $container->get('messenger') ); } @@ -150,7 +162,7 @@ class FilterFormatListBuilder extends DraggableListBuilder { parent::submitForm($form, $form_state); filter_formats_reset(); - drupal_set_message($this->t('The text format ordering has been saved.')); + $this->messenger->addStatus($this->t('The text format ordering has been saved.')); } }