File tree Expand file tree Collapse file tree 10 files changed +189
-1
lines changed Expand file tree Collapse file tree 10 files changed +189
-1
lines changed Original file line number Diff line number Diff line change 9
9
10
10
use Drupal \Core \Config \Entity \ConfigEntityBase ;
11
11
use Drupal \Core \Entity \EntityWithPluginBagsInterface ;
12
+ use Drupal \Core \Form \FormStateInterface ;
12
13
use Drupal \Core \Plugin \DefaultPluginBag ;
13
14
use Drupal \Core \Plugin \DefaultSinglePluginBag ;
14
15
use Drupal \entity_browser \EntityBrowserInterface ;
@@ -251,4 +252,61 @@ public function getWidgetSelector() {
251
252
return $ this ->widgetSelectorPluginBag ()->get ($ this ->widget_selector );
252
253
}
253
254
255
+
256
+ /**
257
+ * {@inheritdoc}
258
+ */
259
+ public function getSelectedEntities () {
260
+ // @TODO Implement it.
261
+ }
262
+
263
+ /**
264
+ * {@inheritdoc}
265
+ */
266
+ public function setSelectedEntities (array $ entities ) {
267
+ // @TODO Implement it.
268
+ }
269
+
270
+ /**
271
+ * {@inheritdoc}
272
+ */
273
+ public function addSelectedEntities (array $ entities ) {
274
+ // @TODO Implement it.
275
+ }
276
+
277
+ /**
278
+ * {@inheritdoc}
279
+ */
280
+ public function selectionCompleted () {
281
+ // @TODO Implement it.
282
+ }
283
+
284
+ /**
285
+ * {@inheritdoc}
286
+ */
287
+ public function getFormId () {
288
+ // @TODO Implement it.
289
+ }
290
+
291
+ /**
292
+ * {@inheritdoc}
293
+ */
294
+ public function buildForm (array $ form , FormStateInterface $ form_state ) {
295
+ // @TODO Implement it.
296
+ }
297
+
298
+ /**
299
+ * {@inheritdoc}
300
+ */
301
+ public function validateForm (array &$ form , FormStateInterface $ form_state ) {
302
+ // @TODO Implement it.
303
+ }
304
+
305
+ /**
306
+ * {@inheritdoc}
307
+ */
308
+ public function submitForm (array &$ form , FormStateInterface $ form_state ) {
309
+ // @TODO Implement it.
310
+ }
311
+
254
312
}
Original file line number Diff line number Diff line change @@ -22,4 +22,25 @@ interface EntityBrowserDisplayInterface extends PluginInspectionInterface {
22
22
*/
23
23
public function label ();
24
24
25
+ /**
26
+ * Displays entity browser.
27
+ *
28
+ * This is the "entry point" for every non-entity browser code to interact
29
+ * with it. It will take care about displaying entity browser in one way or
30
+ * another.
31
+ *
32
+ * @return array
33
+ * An array suitable for drupal_render().
34
+ */
35
+ public function displayEntityBrowser ();
36
+
37
+ /**
38
+ * Indicates completed selection.
39
+ *
40
+ * Entity browser will call this function when selection is done. Display
41
+ * plugin is responsible for fetching selected entities and sending them to
42
+ * the initiating code.
43
+ */
44
+ public function selectionCompleted ();
45
+
25
46
}
Original file line number Diff line number Diff line change 8
8
namespace Drupal \entity_browser ;
9
9
10
10
use Drupal \Core \Config \Entity \ConfigEntityInterface ;
11
+ use Drupal \Core \Form \FormInterface ;
11
12
12
13
/**
13
14
* Provides an interface defining an entity browser entity.
14
15
*/
15
- interface EntityBrowserInterface extends ConfigEntityInterface {
16
+ interface EntityBrowserInterface extends ConfigEntityInterface, FormInterface {
16
17
17
18
/**
18
19
* Returns the entity browser name.
@@ -97,4 +98,36 @@ public function getSelectionDisplay();
97
98
*/
98
99
public function getWidgetSelector ();
99
100
101
+ /**
102
+ * Returns currently selected entities.
103
+ *
104
+ * @return array
105
+ * Array of currently selected entities.
106
+ */
107
+ public function getSelectedEntities ();
108
+
109
+ /**
110
+ * Sets currently selected entities.
111
+ *
112
+ * @param array $entities
113
+ * Entities that are currently selected.
114
+ */
115
+ public function setSelectedEntities (array $ entities );
116
+
117
+ /**
118
+ * Adds entities to currently selected entities.
119
+ *
120
+ * @param array $entities
121
+ * Entities to be added to the list of currently selected entities.
122
+ */
123
+ public function addSelectedEntities (array $ entities );
124
+
125
+ /**
126
+ * Indicates completed selection.
127
+ *
128
+ * Selection process is done and currently selected entities are sent to the
129
+ * initiating code.
130
+ */
131
+ public function selectionCompleted ();
132
+
100
133
}
Original file line number Diff line number Diff line change @@ -22,4 +22,12 @@ interface EntityBrowserSelectionDisplayInterface extends PluginInspectionInterfa
22
22
*/
23
23
public function label ();
24
24
25
+ /**
26
+ * Returns selection display form.
27
+ *
28
+ * @return array
29
+ * Form structure.
30
+ */
31
+ public function getForm ();
32
+
25
33
}
Original file line number Diff line number Diff line change @@ -30,4 +30,12 @@ public function label();
30
30
*/
31
31
public function getWeight ();
32
32
33
+ /**
34
+ * Returns widget form.
35
+ *
36
+ * @return array
37
+ * Form structure.
38
+ */
39
+ public function getForm ();
40
+
33
41
}
Original file line number Diff line number Diff line change @@ -22,4 +22,20 @@ interface EntityBrowserWidgetSelectorInterface extends PluginInspectionInterface
22
22
*/
23
23
public function label ();
24
24
25
+ /**
26
+ * Returns widget selector form.
27
+ *
28
+ * @return array
29
+ * Form structure.
30
+ */
31
+ public function getForm ();
32
+
33
+ /**
34
+ * Returns ID of the widget that is currently selected.
35
+ *
36
+ * @return string
37
+ * ID of the currently selected widget.
38
+ */
39
+ public function getCurrentWidget ();
40
+
25
41
}
Original file line number Diff line number Diff line change @@ -33,4 +33,19 @@ class Standalone extends PluginBase implements EntityBrowserDisplayInterface {
33
33
public function label () {
34
34
return $ this ->label ;
35
35
}
36
+
37
+ /**
38
+ * {@inheritdoc}
39
+ */
40
+ public function displayEntityBrowser () {
41
+ // @TODO Implement it.
42
+ }
43
+
44
+ /**
45
+ * {@inheritdoc}
46
+ */
47
+ public function selectionCompleted () {
48
+ // @TODO Implement it.
49
+ }
50
+
36
51
}
Original file line number Diff line number Diff line change @@ -34,4 +34,11 @@ public function label() {
34
34
$ this ->label ;
35
35
}
36
36
37
+ /**
38
+ * {@inheritdoc}
39
+ */
40
+ public function getForm () {
41
+ // @TODO Implement it.
42
+ }
43
+
37
44
}
Original file line number Diff line number Diff line change @@ -48,4 +48,11 @@ public function getWeight() {
48
48
return $ this ->weight ;
49
49
}
50
50
51
+ /**
52
+ * {@inheritdoc}
53
+ */
54
+ public function getForm () {
55
+ // @TODO Implement it.
56
+ }
57
+
51
58
}
Original file line number Diff line number Diff line change @@ -33,4 +33,19 @@ class Tabs extends PluginBase implements EntityBrowserWidgetSelectorInterface {
33
33
public function label () {
34
34
return $ this ->label ;
35
35
}
36
+
37
+ /**
38
+ * {@inheritdoc}
39
+ */
40
+ public function getForm () {
41
+ // @TODO Implement it.
42
+ }
43
+
44
+ /**
45
+ * {@inheritdoc}
46
+ */
47
+ public function getCurrentWidget () {
48
+ // @TODO Implement it.
49
+ }
50
+
36
51
}
You can’t perform that action at this time.
0 commit comments