2121import ('plugins.generic.thoth.classes.api.ThothEndpoint ' );
2222import ('plugins.generic.thoth.classes.components.forms.config.CatalogEntryFormConfig ' );
2323import ('plugins.generic.thoth.classes.components.forms.config.PublishFormConfig ' );
24- import ('plugins.generic.thoth.classes.templateFilters.ThothSectionTemplateFilter ' );
24+ import ('plugins.generic.thoth.classes.formModifiers.AuthorFormModifier ' );
2525import ('plugins.generic.thoth.classes.listeners.PublicationEditListener ' );
2626import ('plugins.generic.thoth.classes.listeners.PublicationPublishListener ' );
2727import ('plugins.generic.thoth.classes.notification.ThothNotification ' );
2828import ('plugins.generic.thoth.classes.schema.ThothSchema ' );
29+ import ('plugins.generic.thoth.classes.templateFilters.ThothSectionTemplateFilter ' );
2930
3031class ThothPlugin extends GenericPlugin
3132{
@@ -41,6 +42,7 @@ public function register($category, $path, $mainContextId = null)
4142
4243 $ this ->addToSchema ();
4344 $ this ->addFormConfig ();
45+ $ this ->addFormModifiers ();
4446 $ this ->addEndpoints ();
4547 $ this ->addListeners ();
4648 }
@@ -130,8 +132,10 @@ public function addTemplateFilters($hookName, $args)
130132 public function addToSchema ()
131133 {
132134 $ thothSchema = new ThothSchema ();
135+ HookRegistry::register ('Schema::get::author ' , [$ thothSchema , 'addToAuthorSchema ' ]);
133136 HookRegistry::register ('Schema::get::submission ' , [$ thothSchema , 'addWorkIdToSchema ' ]);
134137 HookRegistry::register ('Schema::get::publication ' , [$ thothSchema , 'addToPublicationSchema ' ]);
138+ HookRegistry::register ('authordao::getAdditionalFieldNames ' , [$ thothSchema , 'addToAdditionalFieldNames ' ]);
135139 HookRegistry::register ('Submission::getBackendListProperties::properties ' , [$ thothSchema , 'addToBackendProps ' ]);
136140 }
137141
@@ -144,6 +148,14 @@ public function addFormConfig()
144148 HookRegistry::register ('Form::config::before ' , [$ catalogEntryFormConfig , 'addConfig ' ]);
145149 }
146150
151+ public function addFormModifiers ()
152+ {
153+ $ authorFormModifier = new AuthorFormModifier ($ this );
154+ HookRegistry::register ('authorform::Constructor ' , [$ authorFormModifier , 'handleFormConstructor ' ]);
155+ HookRegistry::register ('authorform::display ' , [$ authorFormModifier , 'handleFormDisplay ' ]);
156+ HookRegistry::register ('authorform::execute ' , [$ authorFormModifier , 'handleFormExecute ' ]);
157+ }
158+
147159 public function addEndpoints ()
148160 {
149161 $ thothEndpoint = new ThothEndpoint ();
0 commit comments