Provides a filter to convert URLs into links.
@Filter(
id = "filter_url",
module = "filter",
title = @Translation("Convert URLs into links"),
type = FILTER_TYPE_MARKUP_LANGUAGE,
settings = {
"filter_url_length" = 72
}
)
Expanded class hierarchy of FilterUrl
class FilterUrl extends FilterBase {
/**
* {@inheritdoc}
*/
public function settingsForm(array $form, array &$form_state) {
$form['filter_url_length'] = array(
'#type' => 'number',
'#title' => t('Maximum link text length'),
'#default_value' => $this->settings['filter_url_length'],
'#min' => 1,
'#field_suffix' => t('characters'),
'#description' => t('URLs longer than this number of characters will be truncated to prevent long strings that break formatting. The link itself will be retained; just the text portion of the link will be truncated.'),
);
return $form;
}
/**
* {@inheritdoc}
*/
public function process($text, $langcode, $cache, $cache_id) {
return _filter_url($text, $this);
}
/**
* {@inheritdoc}
*/
public function tips($long = FALSE) {
return t('Web page addresses and e-mail addresses turn into links automatically.');
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FilterBase:: |
protected | property | A collection of all filters this filter participates in. | |
FilterBase:: |
public | property | A Boolean indicating whether the text processed by this filter may be cached. | |
FilterBase:: |
public | property | The name of the module that owns this filter. | |
FilterBase:: |
protected | property | The plugin ID of this filter. | |
FilterBase:: |
public | property | An associative array containing the configured settings of this filter. | |
FilterBase:: |
public | property | A Boolean indicating whether this filter is enabled. | |
FilterBase:: |
public | property | The weight of this filter compared to others in a filter collection. | |
FilterBase:: |
public | function |
Exports the complete configuration of this filter plugin instance. Overrides FilterInterface:: |
|
FilterBase:: |
public | function |
Returns the administrative description for this filter plugin. Overrides FilterInterface:: |
|
FilterBase:: |
public | function |
Returns the administrative label for this filter plugin. Overrides FilterInterface:: |
|
FilterBase:: |
public | function |
Returns the processing type of this filter plugin. Overrides FilterInterface:: |
|
FilterBase:: |
public | function |
Prepares the text for processing. Overrides FilterInterface:: |
|
FilterBase:: |
public | function |
Sets the configuration for this filter plugin instance. Overrides FilterInterface:: |
|
FilterBase:: |
public | function |
Constructs a Drupal\Component\Plugin\PluginBase object. Overrides PluginBase:: |
|
FilterUrl:: |
public | function |
Performs the filter processing. Overrides FilterInterface:: |
|
FilterUrl:: |
public | function |
Generates a filter's settings form. Overrides FilterBase:: |
|
FilterUrl:: |
public | function |
Generates a filter's tip. Overrides FilterBase:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
public | function |
Returns the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function |
Returns the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |