You are here

class DynamicUserHelpLink in Lightweight Directory Access Protocol (LDAP) 8.3

Same name and namespace in other branches
  1. 8.4 ldap_authentication/src/Plugin/Derivative/DynamicUserHelpLink.php \Drupal\ldap_authentication\Plugin\Derivative\DynamicUserHelpLink

Provides help messages for users when configured.

Hierarchy

Expanded class hierarchy of DynamicUserHelpLink

1 string reference to 'DynamicUserHelpLink'
ldap_authentication.links.task.yml in ldap_authentication/ldap_authentication.links.task.yml
ldap_authentication/ldap_authentication.links.task.yml

File

ldap_authentication/src/Plugin/Derivative/DynamicUserHelpLink.php, line 10

Namespace

Drupal\ldap_authentication\Plugin\Derivative
View source
class DynamicUserHelpLink extends DeriverBase {
  private $config;

  /**
   * Constructor.
   */
  public function __construct() {
    $this->config = \Drupal::config('ldap_authentication.settings');
  }

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($basePluginDefinition) {
    if ($this->config
      ->get('ldapUserHelpLinkText') && $this->config
      ->get('ldapUserHelpLinkUrl')) {
      $basePluginDefinition['title'] = $this->config
        ->get('ldapUserHelpLinkText');
      $basePluginDefinition['route_name'] = 'ldap_authentication.ldap_help_redirect';
      $this->derivatives['ldap_authentication.show_user_help_link'] = $basePluginDefinition;
    }
    return $this->derivatives;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DeriverBase::$derivatives protected property List of derivative definitions. 1
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition
DynamicUserHelpLink::$config private property
DynamicUserHelpLink::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions
DynamicUserHelpLink::__construct public function Constructor.