|
|
@ -25,7 +25,7 @@ function bibcite_footnotes_theme() { |
|
|
|
], |
|
|
|
], |
|
|
|
'bibcite_footnote_list' => [ |
|
|
|
'bibcite_footnote_list' => [ |
|
|
|
'render element' => 'footnotes', |
|
|
|
'render element' => 'footnotes', |
|
|
|
'path' => drupal_get_path('module', 'bibcite_footnotes') . '/templates', |
|
|
|
'path' => \Drupal::service('extension.list.module')->getPath('bibcite_footnotes') . '/templates', |
|
|
|
'template' => 'bibcite-footnote-list', |
|
|
|
'template' => 'bibcite-footnote-list', |
|
|
|
'variables' => [ |
|
|
|
'variables' => [ |
|
|
|
'notes' => [], |
|
|
|
'notes' => [], |
|
|
@ -145,8 +145,9 @@ function bibcite_footnotes_preprocess_bibcite_footnote_list(&$variables) { |
|
|
|
$build[] = $citation_build; |
|
|
|
$build[] = $citation_build; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$render = render($build); |
|
|
|
//$render = render($build); |
|
|
|
$item['sort'] = trim(strip_tags(render($citation_build))); |
|
|
|
$citation_build_render = \Drupal::service('renderer')->render($citation_build); |
|
|
|
|
|
|
|
$item['sort'] = trim(strip_tags($citation_build_render)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// $item['#markup'] = $render; |
|
|
|
// $item['#markup'] = $render; |
|
|
@ -197,8 +198,8 @@ function bibcite_footnotes_preprocess_bibcite_footnote_link(&$variables) { |
|
|
|
$citation_data['#data']['page'] = $fn['page']; |
|
|
|
$citation_data['#data']['page'] = $fn['page']; |
|
|
|
$class .= '-inline'; |
|
|
|
$class .= '-inline'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$citation_data_render = \Drupal::service('renderer')->render($citation_data); |
|
|
|
$title = trim(strip_tags(render($citation_data))); |
|
|
|
$title = trim(strip_tags($citation_data_render)); |
|
|
|
$url = Url::fromUserInput('#' . $fn['fn_id'], ['attributes' => ['id' => $fn['ref_id'], 'class' => $class, 'title' => $title]]); |
|
|
|
$url = Url::fromUserInput('#' . $fn['fn_id'], ['attributes' => ['id' => $fn['ref_id'], 'class' => $class, 'title' => $title]]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -307,7 +308,8 @@ function bibcite_footnotes_get_ckeditor_select_item($entity): array { |
|
|
|
|
|
|
|
|
|
|
|
$data = $serializer->normalize($entity, 'csl'); |
|
|
|
$data = $serializer->normalize($entity, 'csl'); |
|
|
|
$build = ['#theme' => 'bibcite_citation', '#data' => $data]; |
|
|
|
$build = ['#theme' => 'bibcite_citation', '#data' => $data]; |
|
|
|
$citation_text = trim(strip_tags(render($build))); |
|
|
|
$build_render = \Drupal::service('renderer')->render($build); |
|
|
|
|
|
|
|
$citation_text = trim(strip_tags($build_render)); |
|
|
|
// Attempt to match up pre-saved entities with the eventual saved ones. |
|
|
|
// Attempt to match up pre-saved entities with the eventual saved ones. |
|
|
|
$citation_key = $entity->id->first()->getValue()['value']; |
|
|
|
$citation_key = $entity->id->first()->getValue()['value']; |
|
|
|
return [$citation_text, $citation_key]; |
|
|
|
return [$citation_text, $citation_key]; |
|
|
@ -327,10 +329,11 @@ function bibcite_footnotes_preprocess_field(&$variables, $hook) { |
|
|
|
foreach($variables['element'] as $index => $element) { |
|
|
|
foreach($variables['element'] as $index => $element) { |
|
|
|
if (is_numeric($index)) { |
|
|
|
if (is_numeric($index)) { |
|
|
|
$renderable = $citation_tools->getRenderableReference($element['#bibcite_reference']); |
|
|
|
$renderable = $citation_tools->getRenderableReference($element['#bibcite_reference']); |
|
|
|
|
|
|
|
$renderable = \Drupal::service('renderer')->render($renderable); |
|
|
|
$items[] = [ |
|
|
|
$items[] = [ |
|
|
|
'orig_index' => $index, |
|
|
|
'orig_index' => $index, |
|
|
|
'orig_element' => $element, |
|
|
|
'orig_element' => $element, |
|
|
|
'rendered' => trim(strip_tags(render($renderable))), |
|
|
|
'rendered' => trim(strip_tags($renderable)), |
|
|
|
]; |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|