33 lines
961 B
Text
33 lines
961 B
Text
<?php
|
|
|
|
/**
|
|
* Implements hook_ENTITY_TYPE_update() for Drutopia article content.
|
|
*/
|
|
function geo_citation_article_update(Drupal\Core\Entity\EntityInterface $entity)
|
|
{
|
|
$article_type = $entity->field_article_type->getValue();
|
|
// If it's not a GEO Original article, there's nothing for us to do.
|
|
if (!$article_type == 6) {
|
|
return;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Implements hook_entity_extra_field_info().
|
|
*/
|
|
function geo_citation_entity_extra_field_info() {
|
|
$extra = [];
|
|
$extra['node']['article']['display']['geo_citation'] = [
|
|
'label' => t('GEO Citation'),
|
|
'description' => t('Re-presents title, author, date and other information in a standard citeable format.'),
|
|
'weight' => 90,
|
|
];
|
|
return $extra;
|
|
}
|
|
|
|
/**
|
|
* Implements hook_ENTITY_TYPE_view() for Drutopia articles.
|
|
*/
|
|
function geo_citation_article_view(array &$build, \Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display, $view_mode) {
|
|
|
|
}
|