getById($submission->getSectionId()); return !$section->getAbstractsNotRequired(); } /** * * @copydoc PKPSubmissionMetadataFormImplementation::addChecks() */ function addChecks($submission) { parent::addChecks($submission); $sectionDao = DAORegistry::getDAO('SectionDAO'); $section = $sectionDao->getById($submission->getSectionId()); $wordCount = $section->getAbstractWordCount(); if (isset($wordCount) && $wordCount > 0) { $this->_parentForm->addCheck(new FormValidatorCustom($this->_parentForm, 'abstract', 'required', 'submission.submit.form.wordCountAlert', function($abstract) use($wordCount) { foreach ($abstract as $localizedAbstract) { if (count(preg_split('/\s+/', trim(str_replace(' ', ' ', strip_tags($localizedAbstract))))) > $wordCount) { return false; } } return true; })); } } } ?>