openlayers-8.x-4.x-dev/src/Form/MapComponentAddForm.php

src/Form/MapComponentAddForm.php
<?php

namespace Drupal\openlayers\Form;

use Drupal\Core\Form\FormStateInterface;
use Drupal\openlayers\OpenlayersMapInterface;

use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Provides an add form for image effects.
 *
 * @internal
 */
class MapComponentAddForm extends MapComponentFormBase {

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state, OpenlayersMapInterface $map = NULL, $component = NULL) {
    $form = parent::buildForm($form, $form_state, $map, $component);
    $form['#title'] = $this->t('Add %label component to map', ['%label' => $this->mapComponent->label()]);   
    $form['actions']['submit']['#value'] = $this->t('Add component');

    return $form;
  }

  /**
   * {@inheritdoc}
   */
  protected function prepareOpenlayersComponent($component) {

    return $component;
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc