From d59d001f8be943ce12ff3e731953b07a3f862d62 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Fri, 2 Nov 2018 16:37:07 -0300 Subject: [PATCH] WIP --- bibcite_footnotes.module | 10 +++++----- src/Plugin/Filter/ReferenceFootnotesFilter.php | 4 ++-- ...-link.html.twig => bibcite-footnote-link.html.twig} | 0 ...-list.html.twig => bibcite-footnote-list.html.twig} | 0 4 files changed, 7 insertions(+), 7 deletions(-) rename templates/{footnote-link.html.twig => bibcite-footnote-link.html.twig} (100%) rename templates/{footnote-list.html.twig => bibcite-footnote-list.html.twig} (100%) diff --git a/bibcite_footnotes.module b/bibcite_footnotes.module index 4b9d702..e505106 100644 --- a/bibcite_footnotes.module +++ b/bibcite_footnotes.module @@ -18,12 +18,12 @@ function bibcite_footnotes_theme() { return [ 'bibcite_footnote_link' => [ 'render element' => 'fn', - 'template' => 'footnote-link', + 'template' => 'bibcite-footnote-link', ], 'bibcite_footnote_list' => [ 'render element' => 'footnotes', 'path' => drupal_get_path('module', 'bibcite_footnotes') . '/templates', - 'template' => 'footnote-list', + 'template' => 'bibcite-footnote-list', 'variables' => [ 'notes' => [], 'note_type' => [], @@ -50,7 +50,7 @@ function bibcite_footnotes_help($route_name, RouteMatchInterface $route_match) { } /** - * Implementation of hook_preprocess_footnote_list(). + * Implementation of hook_preprocess_bibcite_footnote_list(). * * Gatehrs all notes and prints out Notes and References as separate lists. * @@ -59,7 +59,7 @@ function bibcite_footnotes_help($route_name, RouteMatchInterface $route_match) { * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException */ -function bibcite_footnotes_preprocess_footnote_list(&$variables) { +function bibcite_footnotes_preprocess_bibcite_footnote_list(&$variables) { $config = \Drupal::config('filter.format.rich_text_references');//filters.filter_reference_footnotes.settings'); $footnotes = $variables['footnotes']; @@ -157,7 +157,7 @@ function _bibcite_footnotes_reference_array_cmp($a, $b) { return strcmp($a1, $b1); } -function bibcite_footnotes_preprocess_footnote_link(&$variables) { +function bibcite_footnotes_preprocess_bibcite_footnote_link(&$variables) { // $variables['fn']['fn']['#type'] = 'markeup'; // $variables['fn']['fn']['#markup'] = '

Hello!

'; $fn = $variables['fn']['fn']; diff --git a/src/Plugin/Filter/ReferenceFootnotesFilter.php b/src/Plugin/Filter/ReferenceFootnotesFilter.php index 0315182..25d4090 100644 --- a/src/Plugin/Filter/ReferenceFootnotesFilter.php +++ b/src/Plugin/Filter/ReferenceFootnotesFilter.php @@ -17,7 +17,7 @@ use Drupal\footnotes\Plugin\Filter\FootnotesFilter; * type = \Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE, * cache = FALSE, * settings = { - * "footnotes_collapse" = FALSE, + * "footnotes_footnotefootnote_linkcollapse" = FALSE, * "footnotes_ibid" = FALSE, * "notes_section_label" = "Notes", * "references_section_label" = "References" @@ -155,7 +155,7 @@ class ReferenceFootnotesFilter extends FootnotesFilter { // themed as a list $markup = [ '#theme' => 'bibcite_footnote_list', - '#footnotes' => $notes,, + '#footnotes' => $notes, '#note_type' => self::ENDNOTE, '#config' => $this->settings, ]; diff --git a/templates/footnote-link.html.twig b/templates/bibcite-footnote-link.html.twig similarity index 100% rename from templates/footnote-link.html.twig rename to templates/bibcite-footnote-link.html.twig diff --git a/templates/footnote-list.html.twig b/templates/bibcite-footnote-list.html.twig similarity index 100% rename from templates/footnote-list.html.twig rename to templates/bibcite-footnote-list.html.twig