Skip to content

Instantly share code, notes, and snippets.

@NateWr
Last active February 27, 2019 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NateWr/eecdfc38c819ee92d6da121d1ec1598e to your computer and use it in GitHub Desktop.
Save NateWr/eecdfc38c819ee92d6da121d1ec1598e to your computer and use it in GitHub Desktop.
Remove incomplete submissions from the active submissions list in OJS/OMP.
<?php
class RemoveIncompleteFromActiveListPlugin extends GenericPlugin {
/**
* Initialize the plugin
*/
public function init() {
HookRegistry::register ('TemplateManager::display', array($this, 'modifyTemplateData'));
}
/**
* Fired when the `TemplateManager::display` hook is called.
*
* @param string $hookname
* @param array $args [$templateMgr, $template, $sendContentType, $charset, $output]
*/
public function modifyTemplateData($hookName, $args) {
if ($template != 'dashboard/index.tpl') {
return;
}
// Retrieve the TemplateManager
$templateMgr = $args[0];
// Attach a custom piece of data to the TemplateManager
$activeListData = $templateMgr->getTemplateVars('activeListData');
$activeListData['getParams']['isIncomplete'] = false;
$templateMgr->assign('activeListData', $activeListData);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment