nodeId = $this->routeMatch->getParameter('node'); $this->currentUser = $current_user; } /** * {@inheritdoc} */ public static function getParameters() : array { return array_merge( parent::getParameters(), [ 'tempstore_id' => static::TEMPSTORE_ID, 'current_user' => \Drupal::service('current_user'), ] ); } /** * {@inheritdoc} */ public function getOperations($cached_values) { $ops = []; $ops['type_selection'] = [ 'title' => $this->t('Type Selection'), 'form' => static::TYPE_SELECTION_FORM, 'values' => [ 'node' => $this->nodeId, ], ]; $ops['file_selection'] = [ 'title' => $this->t('Widget Input for Selected Type'), 'form' => static::FILE_SELECTION_FORM, 'values' => [ 'node' => $this->nodeId, ], ]; return $ops; } /** * {@inheritdoc} */ public function getNextParameters($cached_values) { return parent::getNextParameters($cached_values) + ['node' => $this->nodeId]; } /** * {@inheritdoc} */ public function getPreviousParameters($cached_values) { return parent::getPreviousParameters($cached_values) + ['node' => $this->nodeId]; } }