Completed
Pull Request — 8.x-1.x (#126)
by Janez
06:19
created

EntityBrowserWizard::getWizardLabel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * @file
4
 * Contains \Drupal\entity_browser\Wizard\EntityBrowserWizard.
5
 */
6
namespace Drupal\entity_browser\Wizard;
7
8
use Drupal\Core\Form\FormStateInterface;
9
use Drupal\Core\Url;
10
use Drupal\ctools\Wizard\EntityFormWizardBase;
11
use Drupal\entity_browser\Form\DisplayConfig;
12
use Drupal\entity_browser\Form\GeneralInfoConfig;
13
use Drupal\entity_browser\Form\SelectionDisplayConfig;
14
use Drupal\entity_browser\Form\WidgetsConfig;
15
use Drupal\entity_browser\Form\WidgetSelectorConfig;
16
17
/**
18
 * Custom form wizard for entity browser configuration.
19
 */
20
class EntityBrowserWizard extends EntityFormWizardBase {
21
22
  /**
23
   * {@inheritdoc}
24
   */
25
  public function getWizardLabel() {
26
    return $this->t('Entity browser');
27
  }
28
29
  /**
30
   * {@inheritdoc}
31
   */
32
  public function getMachineLabel() {
33
    return $this->t('Label');
34
  }
35
36
  /**
37
   * {@inheritdoc}
38
   */
39
  public function getEntityType() {
40
    return 'entity_browser';
41
  }
42
43
  /**
44
   * {@inheritdoc}
45
   */
46
  public function exists() {
47
    return 'Drupal\entity_browser\Entity\EntityBrowser::load';
48
  }
49
50
  /**
51
   * {@inheritdoc}
52
   */
53
  public function getOperations($cached_values) {
54
    return [
55
      'general' => [
56
        'title' => $this->t('General information'),
57
        'form' => GeneralInfoConfig::class,
58
      ],
59
      'display' => [
60
        'title' => $this->t('Display'),
61
        'form' => DisplayConfig::class,
62
      ],
63
      'widget_selector' => [
64
        'title' => $this->t('Widget selector'),
65
        'form' => WidgetSelectorConfig::class,
66
      ],
67
      'selection_display' => [
68
        'title' => $this->t('Selection display'),
69
        'form' => SelectionDisplayConfig::class,
70
      ],
71
      'widgets' => [
72
        'title' => $this->t('Widgets'),
73
        'form' => WidgetsConfig::class,
74
      ],
75
    ];
76
  }
77
78
}
79