class SettingsForm in Markdown 8.2
Markdown Settings Form.
Hierarchy
- class \Drupal\Core\Form\FormBase implements ContainerInjectionInterface, FormInterface uses DependencySerializationTrait, LoggerChannelTrait, MessengerTrait, LinkGeneratorTrait, RedirectDestinationTrait, UrlGeneratorTrait, StringTranslationTrait
- class \Drupal\markdown\Form\ParserConfigurationForm implements FilterAwareInterface, ParserAwareInterface uses PluginDependencyTrait, FilterAwareTrait, FormTrait, MoreInfoTrait, ParserAwareTrait
- class \Drupal\markdown\Form\SettingsForm
- class \Drupal\markdown\Form\ParserConfigurationForm implements FilterAwareInterface, ParserAwareInterface uses PluginDependencyTrait, FilterAwareTrait, FormTrait, MoreInfoTrait, ParserAwareTrait
Expanded class hierarchy of SettingsForm
Deprecated
in markdown:8.x-2.0 and is removed from markdown:3.0.0. Use \Drupal\markdown\Form\ParserConfigurationForm instead.
See also
https://www.drupal.org/project/markdown/issues/3142418
File
- src/
Form/ SettingsForm.php, line 23
Namespace
Drupal\markdown\FormView source
class SettingsForm extends ParserConfigurationForm {
/**
* The Markdown service.
*
* @var \Drupal\markdown\MarkdownInterface
*/
protected $markdown;
/**
* MarkdownSettingsForm constructor.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $configFactory
* The Config Factory service.
* @param \Drupal\Core\Config\TypedConfigManagerInterface $typedConfigManager
* The Typed Config Manager service.
* @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cacheTagsInvalidator
* The Cache Tags Invalidator service.
* @param \Drupal\Core\Render\ElementInfoManagerInterface $elementInfo
* The Element Info Plugin Manager service.
* @param \Drupal\markdown\MarkdownInterface $markdown
* The Markdown service.
* @param \Drupal\markdown\PluginManager\ParserManagerInterface $parserManager
* The Markdown Parser Plugin Manager service.
* @param \Drupal\markdown\Config\MarkdownConfig $settings
* The markdown settings config.
*/
public function __construct(ConfigFactoryInterface $configFactory, TypedConfigManagerInterface $typedConfigManager, CacheTagsInvalidatorInterface $cacheTagsInvalidator, ElementInfoManagerInterface $elementInfo, MarkdownInterface $markdown, ParserManagerInterface $parserManager, MarkdownConfig $settings) {
parent::__construct($configFactory, $typedConfigManager, $cacheTagsInvalidator, $elementInfo, $parserManager);
$this->markdown = $markdown;
$this->settings = $settings;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container = NULL, MarkdownConfig $settings = NULL) {
if (!$container) {
$container = \Drupal::getContainer();
}
return new static($container
->get('config.factory'), $container
->get('config.typed'), $container
->get('cache_tags.invalidator'), $container
->get('plugin.manager.element_info'), $container
->get('markdown'), $container
->get('plugin.manager.markdown.parser'), $settings ?: MarkdownConfig::load('markdown.settings', NULL, $container)
->setKeyPrefix('parser'));
}
/**
* Indicates whether user is currently viewing the site-wide settings form.
*
* @return bool
* TRUE or FALSE
*
* @deprecated in markdown:8.x-2.0 and is removed from markdown:3.0.0.
* No replacement. Check route name yourself.
* @see https://www.drupal.org/project/markdown/issues/3142418
*/
public static function siteWideSettingsForm() {
return \Drupal::routeMatch()
->getRouteName() === 'markdown.settings';
}
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'markdown_configuration';
}
/**
* Builds the subform for markdown settings.
*
* Note: building a subform requires that it's ultimately constructed in
* a #process callback. This is to ensure the complete form (from the parent)
* has been constructed properly.
*
* @param array $element
* A render array element.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*
* @return array
* The modified render array element.
*
* @deprecated in markdown:8.x-2.0 and is removed from markdown:3.0.0.
* No replacement.
* @see https://www.drupal.org/project/markdown/issues/3142418
*/
public function buildSubform(array $element, FormStateInterface $form_state) {
return $element;
}
/**
* The AJAX callback used to return the parser ajax wrapper.
*
* @deprecated in markdown:8.x-2.0 and is removed from markdown:3.0.0. Use
* \Drupal\markdown\Plugin\Filter\FilterMarkdown::ajaxChangeParser instead.
* @see https://www.drupal.org/project/markdown/issues/3142418
*/
public static function ajaxChangeParser(array $form, FormStateInterface $form_state) {
return FilterMarkdown::ajaxChangeParser($form, $form_state);
}
/**
* Retrieves configuration from values.
*
* @param array $values
* An array of values.
*
* @return array
* The configuration array.
*
* @deprecated in markdown:8.x-2.0 and is removed from markdown:3.0.0.
* Use \Drupal\markdown\Form\ParserConfigurationForm::getConfigFromValues
* instead.
* @see https://www.drupal.org/project/markdown/issues/3142418
*/
public function getConfigurationFromValues(array $values) {
$config = $this
->getConfigFromValues($this->settings
->getName(), $values);
return $config
->get();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
DependencyTrait:: |
protected | property | The object's dependencies. | |
DependencyTrait:: |
protected | function | Adds multiple dependencies. | |
DependencyTrait:: |
protected | function | Adds a dependency. | |
FilterAwareTrait:: |
protected | property | A Filter plugin. | |
FilterAwareTrait:: |
public | function | ||
FilterAwareTrait:: |
public | function | ||
FormBase:: |
protected | property | The config factory. | 1 |
FormBase:: |
protected | property | The request stack. | 1 |
FormBase:: |
protected | property | The route match. | |
FormBase:: |
protected | function | Retrieves a configuration object. | |
FormBase:: |
protected | function | Gets the config factory for this form. | 1 |
FormBase:: |
private | function | Returns the service container. | |
FormBase:: |
protected | function | Gets the current user. | |
FormBase:: |
protected | function | Gets the request object. | |
FormBase:: |
protected | function | Gets the route match. | |
FormBase:: |
protected | function | Gets the logger for a specific channel. | |
FormBase:: |
protected | function |
Returns a redirect response object for the specified route. Overrides UrlGeneratorTrait:: |
|
FormBase:: |
public | function | Resets the configuration factory. | |
FormBase:: |
public | function | Sets the config factory for this form. | |
FormBase:: |
public | function | Sets the request stack object to use. | |
FormTrait:: |
protected static | property | Flag indicating whether the token module exists. | |
FormTrait:: |
public static | function | Adds a data attribute to an element. | |
FormTrait:: |
public static | function | Adds multiple data attributes to an element. | |
FormTrait:: |
public static | function | Adds a #states selector to an element. | |
FormTrait:: |
public static | function | Creates an element, adding data attributes to it if necessary. | |
FormTrait:: |
public static | function | Creates an inline status message to be used in a render array. | |
FormTrait:: |
public static | function | Creates a Token browser element for use when dealing with tokens. | |
FormTrait:: |
public static | function | Retrieves the selector for an element. | |
FormTrait:: |
public static | function | Allows a form element to be reset to its default value. | |
LinkGeneratorTrait:: |
protected | property | The link generator. | 1 |
LinkGeneratorTrait:: |
protected | function | Returns the link generator. | |
LinkGeneratorTrait:: |
protected | function | Renders a link to a route given a route name and its parameters. | |
LinkGeneratorTrait:: |
public | function | Sets the link generator service. | |
LoggerChannelTrait:: |
protected | property | The logger channel factory service. | |
LoggerChannelTrait:: |
protected | function | Gets the logger for a specific channel. | |
LoggerChannelTrait:: |
public | function | Injects the logger channel factory. | |
MessengerTrait:: |
protected | property | The messenger. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
MessengerTrait:: |
public | function | Sets the messenger. | |
MoreInfoTrait:: |
protected | function | Appends existing content with a "More Info" link. | |
ParserAwareTrait:: |
protected | property | A Markdown Parser instance. | |
ParserAwareTrait:: |
public | function | 1 | |
ParserAwareTrait:: |
public | function | ||
ParserConfigurationForm:: |
protected | property | The Cache Tags Invalidator service. | |
ParserConfigurationForm:: |
protected | property | The Element Info Plugin Manager service. | |
ParserConfigurationForm:: |
protected | property | The Markdown Parser Plugin Manager service. | |
ParserConfigurationForm:: |
protected | property | ||
ParserConfigurationForm:: |
public | function |
Form constructor. Overrides FormInterface:: |
|
ParserConfigurationForm:: |
protected | function | Builds the parser form elements. | |
ParserConfigurationForm:: |
protected | function | Builds the extension settings for a specific parser. | |
ParserConfigurationForm:: |
protected | function | Builds the settings for a specific parser. | |
ParserConfigurationForm:: |
protected | function | Builds the render strategy for a specific parser. | |
ParserConfigurationForm:: |
public | function | Retrieves configuration from an array of values. | |
ParserConfigurationForm:: |
protected static | function | ||
ParserConfigurationForm:: |
public | function | Process callback for constructing markdown settings for a parser. | |
ParserConfigurationForm:: |
public | function |
Form submission handler. Overrides FormInterface:: |
|
ParserConfigurationForm:: |
public | function | Subform submission handler. | |
ParserConfigurationForm:: |
public | function |
Form validation handler. Overrides FormBase:: |
|
ParserConfigurationForm:: |
public | function | Subform validation handler. | |
PluginDependencyTrait:: |
protected | function | Calculates and adds dependencies of a specific plugin instance. | 1 |
PluginDependencyTrait:: |
protected | function | Calculates and returns dependencies of a specific plugin instance. | |
PluginDependencyTrait:: |
protected | function | Wraps the module handler. | 1 |
PluginDependencyTrait:: |
protected | function | Wraps the theme handler. | 1 |
RedirectDestinationTrait:: |
protected | property | The redirect destination service. | 1 |
RedirectDestinationTrait:: |
protected | function | Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url. | |
RedirectDestinationTrait:: |
protected | function | Returns the redirect destination service. | |
RedirectDestinationTrait:: |
public | function | Sets the redirect destination service. | |
RendererTrait:: |
protected static | property | The Renderer service. | |
RendererTrait:: |
protected | function | Retrieves the Renderer service. | |
SettingsForm:: |
protected | property | The Markdown service. | |
SettingsForm:: |
public static | function | The AJAX callback used to return the parser ajax wrapper. | |
SettingsForm:: |
public | function | Builds the subform for markdown settings. | |
SettingsForm:: |
public static | function |
Instantiates a new instance of this class. Overrides ParserConfigurationForm:: |
|
SettingsForm:: |
public | function | Retrieves configuration from values. | |
SettingsForm:: |
public | function |
Returns a unique string identifying the form. Overrides ParserConfigurationForm:: |
|
SettingsForm:: |
public static | function | Indicates whether user is currently viewing the site-wide settings form. | |
SettingsForm:: |
public | function |
MarkdownSettingsForm constructor. Overrides ParserConfigurationForm:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
UrlGeneratorTrait:: |
protected | property | The url generator. | |
UrlGeneratorTrait:: |
protected | function | Returns the URL generator service. | |
UrlGeneratorTrait:: |
public | function | Sets the URL generator service. | |
UrlGeneratorTrait:: |
protected | function | Generates a URL or path for a specific route based on the given parameters. |