|
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
|
|
|
|