You are here

class ConfirmForm in Flag 8.4

Provides the Confirm Form link type.

Plugin annotation


@ActionLinkType(
 id = "confirm",
label = @Translation("Confirm Form"),
description = @Translation("Redirects the user to a confirmation form.")
)

Hierarchy

Expanded class hierarchy of ConfirmForm

File

src/Plugin/ActionLink/ConfirmForm.php, line 18

Namespace

Drupal\flag\Plugin\ActionLink
View source
class ConfirmForm extends FormEntryTypeBase {

  /**
   * {@inheritdoc}
   */
  public function getUrl($action, FlagInterface $flag, EntityInterface $entity) {
    switch ($action) {
      case 'flag':
        return Url::fromRoute('flag.confirm_flag', [
          'flag' => $flag
            ->id(),
          'entity_id' => $entity
            ->id(),
        ]);
      default:
        return Url::fromRoute('flag.confirm_unflag', [
          'flag' => $flag
            ->id(),
          'entity_id' => $entity
            ->id(),
        ]);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ActionLinkTypeBase::$currentUser protected property The current user.
ActionLinkTypeBase::calculateDependencies public function
ActionLinkTypeBase::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create 1
ActionLinkTypeBase::getAction protected function Helper method to get the next flag action the user can take.
ActionLinkTypeBase::getAsLink public function Get the action link as a Link object. Overrides ActionLinkTypePluginInterface::getAsLink
ActionLinkTypeBase::getConfiguration public function Gets this plugin's configuration. Overrides ConfigurableInterface::getConfiguration
ActionLinkTypeBase::getDestination protected function Helper method to generate a destination URL parameter. 1
ActionLinkTypeBase::setConfiguration public function Sets the configuration for this plugin instance. Overrides ConfigurableInterface::setConfiguration
ActionLinkTypeBase::__construct public function Build a new link type instance and sets the configuration. Overrides PluginBase::__construct 1
ConfirmForm::getUrl public function Return a Url object for the given flag action. Overrides ActionLinkTypeBase::getUrl
FormEntryTypeBase::buildConfigurationForm public function Provides a form array for the action link plugin's settings form. Overrides ActionLinkTypeBase::buildConfigurationForm 1
FormEntryTypeBase::defaultConfiguration public function Gets default configuration for this plugin. Overrides ActionLinkTypeBase::defaultConfiguration 1
FormEntryTypeBase::getAsFlagLink public function Get the action link formatted for use in entity links. Overrides ActionLinkTypeBase::getAsFlagLink
FormEntryTypeBase::getCreateButtonText public function Returns the create button text. Overrides FormEntryInterface::getCreateButtonText
FormEntryTypeBase::getDeleteButtonText public function Returns the delete button text. Overrides FormEntryInterface::getDeleteButtonText
FormEntryTypeBase::getEditFlaggingTitle public function Returns the edit flagging details form title. Overrides FormEntryInterface::getEditFlaggingTitle
FormEntryTypeBase::getFlagQuestion public function Returns the flag confirm form question when flagging. Overrides FormEntryInterface::getFlagQuestion
FormEntryTypeBase::getUnflagQuestion public function Returns the flag confirm form question when unflagging. Overrides FormEntryInterface::getUnflagQuestion
FormEntryTypeBase::getUpdateButtonText public function Returns the update button text. Overrides FormEntryInterface::getUpdateButtonText
FormEntryTypeBase::submitConfigurationForm public function Processes the action link setting form submit. Overrides ActionLinkTypeBase::submitConfigurationForm
FormEntryTypeBase::validateConfigurationForm public function Validates the action link setting form. Overrides ActionLinkTypeBase::validateConfigurationForm 1
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
RedirectDestinationTrait::$redirectDestination protected property The redirect destination service. 1
RedirectDestinationTrait::getDestinationArray protected function Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url.
RedirectDestinationTrait::getRedirectDestination protected function Returns the redirect destination service.
RedirectDestinationTrait::setRedirectDestination public function Sets the redirect destination service.
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.