Alexander O'Neill 6 years ago
parent
commit
d59d001f8b
  1. 10
      bibcite_footnotes.module
  2. 4
      src/Plugin/Filter/ReferenceFootnotesFilter.php
  3. 0
      templates/bibcite-footnote-link.html.twig
  4. 0
      templates/bibcite-footnote-list.html.twig

10
bibcite_footnotes.module

@ -18,12 +18,12 @@ function bibcite_footnotes_theme() {
return [ return [
'bibcite_footnote_link' => [ 'bibcite_footnote_link' => [
'render element' => 'fn', 'render element' => 'fn',
'template' => 'footnote-link', 'template' => 'bibcite-footnote-link',
], ],
'bibcite_footnote_list' => [ 'bibcite_footnote_list' => [
'render element' => 'footnotes', 'render element' => 'footnotes',
'path' => drupal_get_path('module', 'bibcite_footnotes') . '/templates', 'path' => drupal_get_path('module', 'bibcite_footnotes') . '/templates',
'template' => 'footnote-list', 'template' => 'bibcite-footnote-list',
'variables' => [ 'variables' => [
'notes' => [], 'notes' => [],
'note_type' => [], '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. * 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\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException * @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'); $config = \Drupal::config('filter.format.rich_text_references');//filters.filter_reference_footnotes.settings');
$footnotes = $variables['footnotes']; $footnotes = $variables['footnotes'];
@ -157,7 +157,7 @@ function _bibcite_footnotes_reference_array_cmp($a, $b) {
return strcmp($a1, $b1); 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']['#type'] = 'markeup';
// $variables['fn']['fn']['#markup'] = '<h2>Hello!</h2>'; // $variables['fn']['fn']['#markup'] = '<h2>Hello!</h2>';
$fn = $variables['fn']['fn']; $fn = $variables['fn']['fn'];

4
src/Plugin/Filter/ReferenceFootnotesFilter.php

@ -17,7 +17,7 @@ use Drupal\footnotes\Plugin\Filter\FootnotesFilter;
* type = \Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE, * type = \Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
* cache = FALSE, * cache = FALSE,
* settings = { * settings = {
* "footnotes_collapse" = FALSE, * "footnotes_footnotefootnote_linkcollapse" = FALSE,
* "footnotes_ibid" = FALSE, * "footnotes_ibid" = FALSE,
* "notes_section_label" = "Notes", * "notes_section_label" = "Notes",
* "references_section_label" = "References" * "references_section_label" = "References"
@ -155,7 +155,7 @@ class ReferenceFootnotesFilter extends FootnotesFilter {
// themed as a list // themed as a list
$markup = [ $markup = [
'#theme' => 'bibcite_footnote_list', '#theme' => 'bibcite_footnote_list',
'#footnotes' => $notes,, '#footnotes' => $notes,
'#note_type' => self::ENDNOTE, '#note_type' => self::ENDNOTE,
'#config' => $this->settings, '#config' => $this->settings,
]; ];

0
templates/footnote-link.html.twig → templates/bibcite-footnote-link.html.twig

0
templates/footnote-list.html.twig → templates/bibcite-footnote-list.html.twig

Loading…
Cancel
Save