X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fchi-teck%2Fdrupal-code-generator%2Fsrc%2FCommand%2FDrupal_8%2FPlugin%2FFilter.php;fp=vendor%2Fchi-teck%2Fdrupal-code-generator%2Fsrc%2FCommand%2FDrupal_8%2FPlugin%2FFilter.php;h=93d28bdff769f786d239cfd48093b25f223554da;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Filter.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Filter.php new file mode 100644 index 000000000..93d28bdff --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Filter.php @@ -0,0 +1,52 @@ + 'HTML restrictor', + 'TYPE_MARKUP_LANGUAGE' => 'Markup language', + 'TYPE_TRANSFORM_IRREVERSIBLE' => 'Irreversible transformation', + 'TYPE_TRANSFORM_REVERSIBLE' => 'Reversible transformation', + ]; + $choices = array_values($filter_types); + // Start choices list form '1'. + array_unshift($choices, NULL); + unset($choices[0]); + $questions['filter_type'] = new ChoiceQuestion('Filter type', $choices); + + $vars = &$this->collectVars($input, $output, $questions); + $vars['class'] = Utils::camelize($vars['plugin_label']); + $vars['filter_type'] = array_search($vars['filter_type'], $filter_types); + + $this->addFile() + ->path('src/Plugin/Filter/{class}.php') + ->template('d8/plugin/filter.twig'); + + $this->addFile() + ->path('config/schema/{machine_name}.schema.yml') + ->template('d8/plugin/filter-schema.twig') + ->action('append'); + } + +}