Completed
Pull Request — 8.x-1.x (#148)
by
unknown
02:42
created

Standalone::displayEntityBrowser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * Contains \Drupal\entity_browser\Plugin\EntityBrowser\Display\Standalone.
5
 */
6
7
namespace Drupal\entity_browser\Plugin\EntityBrowser\Display;
8
9
use Drupal\entity_browser\DisplayBase;
10
use Drupal\entity_browser\DisplayRouterInterface;
11
use Drupal\Core\Form\FormStateInterface;
12
13
/**
14
 * Presents entity browser as a standalone form.
15
 *
16
 * @EntityBrowserDisplay(
17
 *   id = "standalone",
18
 *   label = @Translation("Standalone form"),
19
 *   description = @Translation("Displays entity browser as a standalone form."),
20
 *   uses_route = TRUE
21
 * )
22
 */
23
class Standalone extends DisplayBase implements DisplayRouterInterface {
24
25
  /**
26
   * {@inheritdoc}
27
   */
28
  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
29
    $form['path'] = [
30
      '#type' => 'textfield',
31
      '#title' => $this->t('Path'),
32
      '#required' => TRUE,
33
      '#description' => $this->t('The path at which the browser will be accessible. Must begin with a forward slash.'),
34
      '#default_value' => $this->configuration['path'],
35
    ];
36
37
    return $form;
38
  }
39
40
  /**
41
   * {@inheritdoc}
42
   */
43
  public function defaultConfiguration() {
44
    return [
45
      'path' => '',
46
    ];
47
  }
48
49
  /**
50
   * {@inheritdoc}
51
   */
52
  public function displayEntityBrowser(FormStateInterface $form_state) {
53
    // @TODO Implement it.
54
  }
55
56
  /**
57
   * {@inheritdoc}
58
   */
59
  public function selectionCompleted(array $entities) {
60
    // @TODO Implement it.
61
  }
62
63
  /**
64
   * {@inheritdoc}
65
   */
66
  public function path() {
67
    return $this->configuration['path'];
68
  }
69
70
  /**
71
   * {@inheritdoc}
72
   */
73
  public function getUuid() {
74
    return '';
75
  }
76
77
  /**
78
   * {@inheritdoc}
79
   */
80
  public function setUuid($uuid) {
81
    // @TODO Implement it.
82
  }
83
84
}
85