Last active
February 27, 2019 11:18
-
-
Save NateWr/eecdfc38c819ee92d6da121d1ec1598e to your computer and use it in GitHub Desktop.
Remove incomplete submissions from the active submissions list in OJS/OMP.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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