An option named "replace" has been added to the same
template form so user can choose to overwrite an existing
template (i.e. modify and save an existing template).
This file is barely accessed in Moodle, if it all. However, it is
required in order to upload this module to the plugin database as
it is needed to pass validation.
The elements for each page are listed in a table below the other page settings, meaning each page has a separate table for listing their elements. Each element is now edited in a pop-up, rather than having all the element settings displayed at once on the form causing it to look overcrowded. There is also no longer any need for the function add_element to add default values for the elements when they are added, as a a form is shown when you click to add an element where you can enter the values before it is created.
Note: I did not create a db/upgrade.php script to add the new database columns as this module should not be currently used by anyone.
Rather than using grouped elements which can span across multiple lines on a small screen, the elements are now generated within a header element, keeping them separated and making the form more manageable. The base class was also changed to accomodate this by making it easier for elements to utilise common features.
Elements are sub-plugins that have the same abilities as a core plugin, such as creating tables, capabilities and performing upgrades.
Currently elements can define -
* What additional form elements are rendered when adding the element to the customcert customisation page.
* How the data from the additional form elements is validated and saved.
* How the element is rendered on the PDF.
* How the element handles removing data when it is deleted.