Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

abort pending api fetch if new search phrase entered; avoid too many api requests while typing #16

Open
wants to merge 9 commits into
base: stable-3_4_0
Choose a base branch
from
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ROR Plugin is shipped with the OJS Plugin gallery up from OJS 3.2. For Installat

* Allows auto-suggesting organization names
* Pre-fills affiliations in multilingual context
* If a language is not found in Ror, then English is used with falling back to the main name in Ror
* Subsequent alteration of the ROR-suggested organization name is also possible by maintaining the ROR Plugin,
which can be helpful in special cases e.g. adding a institute name for a research organization.
* OJS 3.3 compatibility
Expand Down
9 changes: 8 additions & 1 deletion classes/Workflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,16 @@ public function execute(string $hookName, array &$args): void
/* @var TemplateManager $templateMgr */
$templateMgr = &$args[1];
$request = Application::get()->getRequest();
$context = $request->getContext();
$submission = $templateMgr->getTemplateVars('submission');

$locale = $submission->getLocale();
if (empty($locale)) $locale = $context->getPrimaryLocale();
if (strlen($locale) > 2) $locale = substr($locale, 0, 2);

$templateMgr->assign([
'stylePath' => $request->getBaseUrl() . '/' . $this->plugin->getPluginPath() . '/' . Constants::stylePath
'stylePath' => $request->getBaseUrl() . '/' . $this->plugin->getPluginPath() . '/' . Constants::stylePath,
'locale' => $locale
]);

$templateMgr->display($this->plugin->getTemplateResource(Constants::templateContributor));
Expand Down
File renamed without changes.
Loading