File tree Expand file tree Collapse file tree
classes/components/forms/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424import ('plugins.generic.thoth.classes.api.ThothEndpoint ' );
2525import ('plugins.generic.thoth.classes.components.forms.config.CatalogEntryFormConfig ' );
2626import ('plugins.generic.thoth.classes.components.forms.config.PublishFormConfig ' );
27+ import ('plugins.generic.thoth.classes.components.forms.config.ContributorFormConfig ' );
2728import ('plugins.generic.thoth.classes.templateFilters.ThothSectionTemplateFilter ' );
2829import ('plugins.generic.thoth.classes.listeners.PublicationEditListener ' );
2930import ('plugins.generic.thoth.classes.listeners.PublicationPublishListener ' );
@@ -161,6 +162,9 @@ public function addFormConfig()
161162
162163 $ catalogEntryFormConfig = new CatalogEntryFormConfig ();
163164 HookRegistry::register ('Form::config::before ' , [$ catalogEntryFormConfig , 'addConfig ' ]);
165+
166+ $ contributorFormConfig = new ContributorFormConfig ();
167+ HookRegistry::register ('Form::config::before ' , [$ contributorFormConfig , 'addConfig ' ]);
164168 }
165169
166170 public function addListeners ()
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * @file plugins/generic/thoth/classes/components/forms/config/ContributorFormConfig.inc.php
5+ *
6+ * Copyright (c) 2024-2025 Lepidus Tecnologia
7+ * Copyright (c) 2024-2025 Thoth
8+ * Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
9+ *
10+ * @class ContributorFormConfig
11+ * @ingroup plugins_generic_thoth
12+ *
13+ * @brief Thoth configuration for contributor form
14+ */
15+
16+ use APP \facades \Repo ;
17+
18+ class ContributorFormConfig
19+ {
20+ public function addConfig ($ hookName , $ form )
21+ {
22+ if ($ form ->id !== 'contributor ' || !empty ($ form ->errors )) {
23+ return ;
24+ }
25+
26+ $ form ->addField (new \PKP \components \forms \FieldOptions ('mainContribution ' , [
27+ 'label ' => __ ('plugins.generic.thoth.field.mainContribution ' ),
28+ 'value ' => false ,
29+ 'options ' => [
30+ [
31+ 'value ' => true ,
32+ 'label ' => __ ('plugins.generic.thoth.field.mainContribution.label ' ),
33+ ],
34+ ],
35+ ]));
36+
37+ return false ;
38+ }
39+ }
Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ msgstr "Page Count"
4040msgid "plugins.generic.thoth.field.imageCount.label"
4141msgstr "Image Count"
4242
43+ msgid "plugins.generic.thoth.field.mainContribution"
44+ msgstr "Thoth Main Contribution"
45+
46+ msgid "plugins.generic.thoth.field.mainContribution.label"
47+ msgstr "Identify this contributor as main contribution in Thoth."
48+
4349msgid "plugins.generic.thoth.workType"
4450msgstr "Work Type"
4551
Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ msgstr "Número de Páginas"
4040msgid "plugins.generic.thoth.field.imageCount.label"
4141msgstr "Número de Imágenes"
4242
43+ msgid "plugins.generic.thoth.field.mainContribution"
44+ msgstr "Colaboración Principal de Thoth"
45+
46+ msgid "plugins.generic.thoth.field.mainContribution.label"
47+ msgstr "Identificar a este colaborador como colaboración principal en Thoth."
48+
4349msgid "plugins.generic.thoth.workType"
4450msgstr "Tipo de Trabajo"
4551
Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ msgstr "Número de Páginas"
4040msgid "plugins.generic.thoth.field.imageCount.label"
4141msgstr "Número de Imagens"
4242
43+ msgid "plugins.generic.thoth.field.mainContribution"
44+ msgstr "Contribuição Principal do Thoth"
45+
46+ msgid "plugins.generic.thoth.field.mainContribution.label"
47+ msgstr "Identificar este contribuidor como contribuição principal em Thoth."
48+
4349msgid "plugins.generic.thoth.workType"
4450msgstr "Tipo de Trabalho"
4551
You can’t perform that action at this time.
0 commit comments