Very nice. Thanks for sharing. I did something similar but directly in our child theme’s Plugin.inc file.
public function loadTemplateData($hookName, $args) {
// Retrieve the TemplateManager
$templateMgr = $args[0];
$submission = $templateMgr->get_template_vars('citationArgs');
$submissionId = $submission['submissionId'];
$dateAccepted = "";
$editDecisionDao = DAORegistry::getDAO('EditDecisionDAO');
$decisions = $editDecisionDao->getEditorDecisions($submissionId);
foreach ($decisions as $decision) {
if ($decision['stageId'] == '3' && $decision['decision'] == '1')
$dateAccepted = $decision[dateDecided];
}
$templateMgr->assign('acceptanceDate',$dateAccepted);
}
You have to hook in the loadTemplateData function inside of init()
HookRegistry::register ('TemplateManager::display', array($this, 'loadTemplateData'));
We just use $article->getDatePublished() and $article->getDateSubmitted() directly in the theme template.