DynamicUserHelpLink.php in Lightweight Directory Access Protocol (LDAP) 8.3
File
ldap_authentication/src/Plugin/Derivative/DynamicUserHelpLink.php
View source
<?php
namespace Drupal\ldap_authentication\Plugin\Derivative;
use Drupal\Component\Plugin\Derivative\DeriverBase;
class DynamicUserHelpLink extends DeriverBase {
private $config;
public function __construct() {
$this->config = \Drupal::config('ldap_authentication.settings');
}
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;
}
}