Completed
Push — 8.x-1.x ( 3d8643...b71662 )
by Janez
03:27
created

Standalone::getUuid()   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
namespace Drupal\entity_browser\Plugin\EntityBrowser\Display;
4
5
use Drupal\entity_browser\DisplayBase;
6
use Drupal\entity_browser\DisplayRouterInterface;
7
use Drupal\Core\Form\FormStateInterface;
8
9
/**
10
 * Presents entity browser as a standalone form.
11
 *
12
 * @EntityBrowserDisplay(
13
 *   id = "standalone",
14
 *   label = @Translation("Standalone form"),
15
 *   description = @Translation("Displays entity browser as a standalone form."),
16
 *   uses_route = TRUE
17
 * )
18
 */
19
class Standalone extends DisplayBase implements DisplayRouterInterface {
20
21
  /**
22
   * {@inheritdoc}
23
   */
24
  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
25
    $form['path'] = [
26
      '#type' => 'textfield',
27
      '#title' => $this->t('Path'),
28
      '#required' => TRUE,
29
      '#description' => $this->t('The path at which the browser will be accessible. Must begin with a forward slash.'),
30
      '#default_value' => $this->configuration['path'],
31
    ];
32
33
    return $form;
34
  }
35
36
  /**
37
   * {@inheritdoc}
38
   */
39
  public function defaultConfiguration() {
40
    return [
41
      'path' => '',
42
    ];
43
  }
44
45
  /**
46
   * {@inheritdoc}
47
   */
48
  public function displayEntityBrowser(FormStateInterface $form_state) {
49
    // @TODO Implement it.
50
  }
51
52
  /**
53
   * {@inheritdoc}
54
   */
55
  public function selectionCompleted(array $entities) {
56
    // @TODO Implement it.
57
  }
58
59
  /**
60
   * {@inheritdoc}
61
   */
62
  public function path() {
63
    return $this->configuration['path'];
64
  }
65
66
}
67