Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / metatag / metatag_views / src / Form / MetatagViewsRevertForm.php
index 6f7af554f1d6c2225764b233e3e375a6e455fda9..049f1f95648bd87a7db3c1a6c6abb8ad483e4d86 100644 (file)
@@ -6,7 +6,6 @@ use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Form\ConfirmFormBase;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
-use Drupal\views\ViewEntityInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -17,14 +16,14 @@ class MetatagViewsRevertForm extends ConfirmFormBase {
   /**
    * Entity manager for views entities.
    *
-   * @var EntityTypeManagerInterface
+   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
    */
   protected $viewsManager;
 
   /**
-   * The view entity to revert metatags on.
+   * The view entity to revert meta tags on.
    *
-   * @var ViewEntityInterface $view
+   * @var \Drupal\views\ViewEntityInterface
    */
   protected $view;
 
@@ -33,10 +32,10 @@ class MetatagViewsRevertForm extends ConfirmFormBase {
    *
    * @var string
    */
-  protected $display_id;
+  protected $displayId;
 
   /**
-   * Constructor.
+   * {@inheritdoc}
    */
   public function __construct(EntityTypeManagerInterface $entity_manager) {
     $this->viewsManager = $entity_manager->getStorage('view');
@@ -62,9 +61,9 @@ class MetatagViewsRevertForm extends ConfirmFormBase {
    * {@inheritdoc}
    */
   public function getQuestion() {
-    return $this->t('Do you want to revert metatags for @view_name : @display_name?', [
+    return $this->t('Do you want to revert meta tags for @view_name : @display_name?', [
       '@view_name' => $this->view->label(),
-      '@display_name' => $this->view->getDisplay($this->display_id)['display_title'],
+      '@display_name' => $this->view->getDisplay($this->displayId)['display_title'],
     ]);
   }
 
@@ -79,9 +78,9 @@ class MetatagViewsRevertForm extends ConfirmFormBase {
    * {@inheritdoc}
    */
   public function getDescription() {
-    return $this->t('You are about to revert the custom metatags for the %display_name display on the %view_name view. This action cannot be undone.', [
+    return $this->t('You are about to revert the custom meta tags for the %display_name display on the %view_name view. This action cannot be undone.', [
       '%view_name' => $this->view->label(),
-      '%display_name' => $this->view->getDisplay($this->display_id)['display_title'],
+      '%display_name' => $this->view->getDisplay($this->displayId)['display_title'],
     ]);
   }
 
@@ -101,13 +100,10 @@ class MetatagViewsRevertForm extends ConfirmFormBase {
 
   /**
    * {@inheritdoc}
-   *
-   * @param int $id
-   *   (optional) The ID of the item to be deleted.
    */
   public function buildForm(array $form, FormStateInterface $form_state, $view_id = NULL, $display_id = NUL) {
     $this->view = $this->viewsManager->load($view_id);
-    $this->display_id = $display_id;
+    $this->displayId = $display_id;
 
     return parent::buildForm($form, $form_state);
   }
@@ -116,9 +112,9 @@ class MetatagViewsRevertForm extends ConfirmFormBase {
    * {@inheritdoc}
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
-    // Removed metatags from the view.
+    // Removed meta tags from the view.
     $config_name = $this->view->getConfigDependencyName();
-    $config_path = 'display.' . $this->display_id . '.display_options.display_extenders.metatag_display_extender.metatags';
+    $config_path = 'display.' . $this->displayId . '.display_options.display_extenders.metatag_display_extender.metatags';
 
     $configuration = $this->configFactory()->getEditable($config_name)
       ->clear($config_path)
@@ -127,9 +123,9 @@ class MetatagViewsRevertForm extends ConfirmFormBase {
     // Redirect back to the views list.
     $form_state->setRedirect('metatag_views.metatags.list');
 
-    drupal_set_message($this->t('Reverted metatags for @view_name : @display_name', [
+    drupal_set_message($this->t('Reverted meta tags for @view_name : @display_name', [
       '@view_name' => $this->view->label(),
-      '@display_name' => $this->view->getDisplay($this->display_id)['display_title'],
+      '@display_name' => $this->view->getDisplay($this->displayId)['display_title'],
     ]));
   }