X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fpathauto%2Fsrc%2FForm%2FPathautoSettingsForm.php;h=64a7f60534268dfd521bb7a2b2401e582f5c3a2e;hp=cbf24079887e574d70ef3863e93fde6029f44329;hb=059867c3f96750652c80f39e44c442a58c2549ee;hpb=f8fc16ae6b862bef59baaad5d051dd37b7ff11b2 diff --git a/web/modules/contrib/pathauto/src/Form/PathautoSettingsForm.php b/web/modules/contrib/pathauto/src/Form/PathautoSettingsForm.php index cbf240798..64a7f6053 100644 --- a/web/modules/contrib/pathauto/src/Form/PathautoSettingsForm.php +++ b/web/modules/contrib/pathauto/src/Form/PathautoSettingsForm.php @@ -35,7 +35,7 @@ class PathautoSettingsForm extends ConfigFormBase { protected $aliasTypeManager; /** - * {@inheritDoc} + * {@inheritdoc} */ public function __construct(ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager, AliasTypeManager $alias_type_manager) { parent::__construct($config_factory); @@ -45,7 +45,7 @@ class PathautoSettingsForm extends ConfigFormBase { } /** - * {@inheritDoc} + * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( @@ -195,7 +195,13 @@ class PathautoSettingsForm extends ConfigFormBase { '#title' => $this->t('Strings to Remove'), '#default_value' => $config->get('ignore_words'), '#description' => $this->t('Words to strip out of the URL alias, separated by commas. Do not use this to remove punctuation.'), - '#wysiwyg' => FALSE, + ); + + $form['safe_tokens'] = array( + '#type' => 'textarea', + '#title' => $this->t('Safe tokens'), + '#default_value' => implode(', ', $config->get('safe_tokens')), + '#description' => $this->t('List of tokens that are safe to use in alias patterns and do not need to be cleaned. For example urls, aliases, machine names. Separated with a comma.'), ); $form['punctuation'] = array( @@ -254,6 +260,9 @@ class PathautoSettingsForm extends ConfigFormBase { } $value = $enabled_entity_types; } + elseif ($key == 'safe_tokens') { + $value = array_filter(array_map('trim', explode(',', $value))); + } $config->set($key, $value); } $config->save();