-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathScreeningForm.php
64 lines (56 loc) · 1.75 KB
/
ScreeningForm.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
* @file classes/components/form/context/ScreeningForm.php
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2000-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class ScreeningForm
* @ingroup classes_controllers_form
*
* @brief A preset form for configuring author screening options
*/
namespace APP\components\forms\context;
use PKP\components\forms\FieldHTML;
use PKP\components\forms\FormComponent;
use PKP\plugins\Hook;
define('FORM_SCREENING', 'screening');
class ScreeningForm extends FormComponent
{
/** @copydoc FormComponent::$id */
public $id = FORM_SCREENING;
/** @copydoc FormComponent::$method */
public $method = 'PUT';
/**
* Constructor
*
* @param string $action URL to submit the form to
* @param array $locales Supported locales
* @param Context $context to change settings for
*/
public function __construct($action, $locales, $context)
{
$this->action = $action;
$rules = [];
Hook::call('Settings::Workflow::listScreeningPlugins', [&$rules]);
if (!empty($rules)) {
$screeningPluginRules = "<table class=\"pkpTable\">\n";
foreach ($rules as $rule) {
$screeningPluginRules .= '<tr><td>' . $rule . "</td></tr>\n";
}
$screeningPluginRules .= "</table>\n";
}
$this->addPage([
'id' => 'default',
]);
$this->addGroup([
'id' => 'default',
'pageId' => 'default',
])
->addField(new FieldHTML('screening', [
'description' => $screeningPluginRules ?? null,
'groupId' => 'default',
]));
}
}