SRC Directory Files
While the SubmissionExportScheduler handles the bulk of the work and has its own document page, the other classes in this folder are small enough that their documentation can be condensed. Only classes needed clarification will be included, and we will add details based on inquiries, so if things aren't as clear as we thought they were, just ask and we can update the documentation accordingly.
Admin
AddSubmenuPage
Creates the submenu page displaying the consolidated export schedules for all forms. The output is generated in two objects - ModifyExportTimingMarkup
, which handles the UI to set the time and date for exports, and ExistingExportTableMarkup
, which handles the list table output of existing schedules.
FormSettings
Constructs data structures providing options such as format and delivery options to the form action. These values can be modified at run time inside this class.
Common
Common contains shared/similar classes intended to be built into a library. Currently, each plugin has its own version of these helper classes. Once stable, we can look to consolidate these classes.
DateTimeConverter
This class has knowledge of WordPress as it retrieves the stored timezone setting from the WP dashboard. With this knowlege, it can convert any timestamp into the localized time. Because of its awareness of WP, any method using this class cannot be unit tested. If this becomes a problem, we can add an interface and factory to disassociate the two.
WpListTable
This is a direct copy of WordPress' WP_List_Table. WP's recommendation is to not use this directly but rather to copy it; they reserve the right to change it at any time. It is used here to build the list of schedule exports on the Scheduled Exports submenu page.
WordPressSettingsElementBuilder
This class constructs HTML elements for output on a WP settings page. It standardizes the structure, enabling implementations to pass the variables needed for output.
Config
The config folder holds configuration arrays that create the export settings, which is the scheduled exports for any given form, and the plugin settings, which holds the plugin's debug log functionality on the NF settings page.
Entities
This plugin has only one entity, the ScheduleExportParameters, which provides the export parameters for each scheduled export.
Handlers
Handlers are given parameters and requests and return responses. It is a bit of a catch-all name; as we develop further, we will be classifying these classes with finer detail.
ModifyCronTiming
This class is given an array of keyed values - dailytime, weeklytime, hourlytime,dayofweek,timezonestring and constructs the next cron times based on those parameters.