|
|
|
@ -11,6 +11,27 @@ use Drupal\Core\Url;
|
|
|
|
|
use Drupal\Core\Link; |
|
|
|
|
use Drupal\bibcite_footnotes\CitationTools; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Implements hook_theme(). |
|
|
|
|
*/ |
|
|
|
|
function bibcite_footnotes_theme() { |
|
|
|
|
return [ |
|
|
|
|
'bibcite_footnote_link' => [ |
|
|
|
|
'render element' => 'fn', |
|
|
|
|
'template' => 'footnote-link', |
|
|
|
|
], |
|
|
|
|
'bibcite_footnote_list' => [ |
|
|
|
|
'render element' => 'footnotes', |
|
|
|
|
'path' => drupal_get_path('module', 'bibcite_footnotes') . '/templates', |
|
|
|
|
'template' => 'footnote-list', |
|
|
|
|
'variables' => [ |
|
|
|
|
'notes' => [], |
|
|
|
|
'note_type' => [], |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**_bibcite_foot |
|
|
|
|
* Implements hook_help(). |
|
|
|
|
*/ |
|
|
|
@ -49,14 +70,6 @@ function bibcite_footnotes_preprocess_footnote_list(&$variables) {
|
|
|
|
|
'#wrapper_attributes' => ['class' => 'container'], |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
$references= [ |
|
|
|
|
'#theme' => 'item_list', |
|
|
|
|
'#list_type' => 'ul', |
|
|
|
|
'#title' => $config->get('filters.filter_reference_footnotes.settings.references_section_label'), |
|
|
|
|
'#attributes' => ['class' => 'footnotes'], |
|
|
|
|
'#wrapper_attributes' => ['class' => 'container'], |
|
|
|
|
|
|
|
|
|
]; |
|
|
|
|
$references['#attached']['library'][] = 'bibcite_footnotes/reference_footnote'; |
|
|
|
|
$dont_show_backlink_text = $config->get('filters.filter_reference_footnotes.settings.reference_dont_show_backlink_text'); |
|
|
|
|
$sort_references_by = $config->get('filters.filter_reference_footnotes.settings.reference_sort_by'); |
|
|
|
@ -169,17 +182,3 @@ function bibcite_footnotes_preprocess_footnote_link(&$variables) {
|
|
|
|
|
$link = Link::fromTextAndUrl($fn['value'], $url)->toRenderable(); |
|
|
|
|
$variables['fn']['fn'][] = $link; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function bibcite_footnotes_theme_registry_alter(&$theme_registry) { |
|
|
|
|
unset($theme_registry['footnote_list']['function']); |
|
|
|
|
$theme_registry['footnote_list']['path'] = drupal_get_path('module', 'bibcite_footnotes') . '/templates'; |
|
|
|
|
$theme_registry['footnote_list']['template'] = 'footnote-list'; |
|
|
|
|
$theme_registry['footnote_list']['variables']['notes'] = []; |
|
|
|
|
$theme_registry['footnote_list']['variables']['references'] = []; |
|
|
|
|
$theme_registry['footnote_list']['variables']['footnotes'] = []; |
|
|
|
|
|
|
|
|
|
unset($theme_registry['footnote_link']['function']); |
|
|
|
|
$theme_registry['footnote_link']['path'] = drupal_get_path('module', 'bibcite_footnotes') . '/templates'; |
|
|
|
|
$theme_registry['footnote_link']['template'] = 'footnote-link'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|