Goal of the redesign is a new structure that makes the post.php more readable and that encapsulates functions that work with posts that were previously in the locallib.
The redesign is structured as followed:
There are new classes post and discussion, that represent their component and provide functions to read and manipulate them.
There is a new class post_control, that administrates the workflow of the post.php. The Controller detects the interaction (create/edit/answer/delete), builds the post_form and executes the interaction while securing that everything is being correctly executed.
The post.php now only calls the post_control and the controller handles everything.
Goal of the redesign is a new structure that makes the post.php more readable and that encapsulates functions that work with posts that were previously in the locallib.
The redesign is structured as followed: