|
|
@ -69,7 +69,7 @@ function bibcite_footnotes_preprocess_bibcite_footnote_list(&$variables) { |
|
|
|
$notes = [ |
|
|
|
$notes = [ |
|
|
|
'#theme' => 'item_list', |
|
|
|
'#theme' => 'item_list', |
|
|
|
'#list_type' => 'ul', |
|
|
|
'#list_type' => 'ul', |
|
|
|
'#title' => $variables['note_type'] == ReferenceFootnotesFilter::ENDNOTE ? $config['notes_section_label'] : $config['references_section_label'], |
|
|
|
'#title' => $variables['note_type'] == $config['notes_section_label'], |
|
|
|
'#attributes' => ['class' => 'footnotes'], |
|
|
|
'#attributes' => ['class' => 'footnotes'], |
|
|
|
'#wrapper_attributes' => ['class' => 'container'], |
|
|
|
'#wrapper_attributes' => ['class' => 'container'], |
|
|
|
]; |
|
|
|
]; |
|
|
@ -91,7 +91,7 @@ function bibcite_footnotes_preprocess_bibcite_footnote_list(&$variables) { |
|
|
|
$build = []; |
|
|
|
$build = []; |
|
|
|
$reference_entity_id = $fn['reference']; |
|
|
|
$reference_entity_id = $fn['reference']; |
|
|
|
|
|
|
|
|
|
|
|
$footnote_link_text = ($dont_show_backlink_text && $reference_entity_id) ? '^' : $fn['value']; |
|
|
|
$footnote_link_text = ($dont_show_backlink_text) ? '^' : $fn['value']; |
|
|
|
if (!is_array($fn['ref_id'])) { |
|
|
|
if (!is_array($fn['ref_id'])) { |
|
|
|
$url = Url::fromUserInput('#' . $fn['ref_id'], ['attributes' => ['id' => $fn['fn_id'], 'class' => 'footnote-link']]); |
|
|
|
$url = Url::fromUserInput('#' . $fn['ref_id'], ['attributes' => ['id' => $fn['fn_id'], 'class' => 'footnote-link']]); |
|
|
|
$link = Link::fromTextAndUrl(($footnote_link_text), $url)->toRenderable(); |
|
|
|
$link = Link::fromTextAndUrl(($footnote_link_text), $url)->toRenderable(); |
|
|
@ -126,8 +126,8 @@ function bibcite_footnotes_preprocess_bibcite_footnote_list(&$variables) { |
|
|
|
. '</span>', |
|
|
|
. '</span>', |
|
|
|
]; |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|
else if (!empty($fn['text']) && $variables['note_type'] == ReferenceFootnotesFilter::ENDNOTE) { |
|
|
|
else if (!empty($fn['text'])) { |
|
|
|
$build['footnote-link'] = Link::fromTextAndUrl($fn['value'], $url)->toRenderable(); |
|
|
|
$build['footnote-link'] = Link::fromTextAndUrl($footnote_link_text, $url)->toRenderable(); |
|
|
|
$build['footnote-text'] = [ |
|
|
|
$build['footnote-text'] = [ |
|
|
|
'#type' => 'markup', |
|
|
|
'#type' => 'markup', |
|
|
|
'#markup' => ' <span class="endnote-text">' . $fn['text'] . '</span>', |
|
|
|
'#markup' => ' <span class="endnote-text">' . $fn['text'] . '</span>', |
|
|
@ -194,7 +194,8 @@ function bibcite_footnotes_preprocess_bibcite_footnote_link(&$variables) { |
|
|
|
$citation_data = $citation_tools->getRenderableReference($citation_entity_id); |
|
|
|
$citation_data = $citation_tools->getRenderableReference($citation_entity_id); |
|
|
|
|
|
|
|
|
|
|
|
// Citation contains a page reference, so construct parenthetical footnote. |
|
|
|
// Citation contains a page reference, so construct parenthetical footnote. |
|
|
|
if (!empty($fn['page'])) { |
|
|
|
// @TODO: Make it explicit. |
|
|
|
|
|
|
|
if (!empty($fn['page'] && !is_numeric($fn['value']))) { |
|
|
|
$fn['value'] = "({$fn['value']}, {$fn['page']})"; |
|
|
|
$fn['value'] = "({$fn['value']}, {$fn['page']})"; |
|
|
|
$citation_data['#data']['page'] = $fn['page']; |
|
|
|
$citation_data['#data']['page'] = $fn['page']; |
|
|
|
$class .= '-inline'; |
|
|
|
$class .= '-inline'; |
|
|
|