示例#1
0
 /**
  * Constructs a new View object.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
  *   Event dispatcher service.
  * @param \Drupal\Core\Session\AccountInterface $current_user
  *   The current user.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, EventDispatcherInterface $event_dispatcher, EntityManagerInterface $entity_manager, AccountInterface $current_user)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition, $event_dispatcher, $entity_manager);
     $this->currentUser = $current_user;
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function defaultConfiguration()
 {
     return array('entity_type' => NULL, 'bundle' => NULL) + parent::defaultConfiguration();
 }
示例#3
0
 /**
  * {@inheritdoc}
  */
 public function submitConfigurationForm(array &$form, FormStateInterface $form_state)
 {
     parent::submitConfigurationForm($form, $form_state);
     $this->configuration['bundle'] = $this->configuration['bundle']['select'];
 }
示例#4
0
 /**
  * {@inheritdoc}
  */
 public function defaultConfiguration()
 {
     return ['upload_location' => 'public://'] + parent::defaultConfiguration();
 }
示例#5
0
 /**
  * {@inheritdoc}
  */
 public function defaultConfiguration()
 {
     return ['upload_location' => 'public://', 'dropzone_description' => t('Drop files here to upload them'), 'max_filesize' => file_upload_max_size() / pow(Bytes::KILOBYTE, 2) . 'M', 'extensions' => 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp'] + parent::defaultConfiguration();
 }
示例#6
0
 /**
  * {@inheritdoc}
  */
 public function defaultConfiguration()
 {
     return ['text' => ''] + parent::defaultConfiguration();
 }