PHP5 constructor function.
Prepares instance of ExpressionEngine for object scope, sets addon_id, prepares extension settings, loads date helper and prepares required file-system paths.
If there has been no 'report_path' directory set in the extension settings the 'reports' sub-directory in this add-on is used as a default location.
Tags:
string configure(
[bool|string
$preview_html = false], [bool|string
$error = false])
|
|
Generates the report summary and configuration form for the selected report.
Method also allows pre-generated report results and/or a report error to be passed as parameters. If a save_id has been added to the page request then the report will be configured to use the preset data and inform the user that a a preset is being used.
Tags:
Parameters:
mixed configure_submit(
)
|
|
Manages program flow for submitted data sent from method Nsm_reports_mcp::configure.
Form input 'action' determines what action should be taken next.
Tags:
mixed download_generated_report(
)
|
|
Security checkpoint for downloading generated reports.
First checks that user is logged in and is a member of can_download group (set in extension settings). Then gets all files in generated reports directory and iterates over files. On each file compare the requested file hash against the md5 hash of the file. If file hash is equal to the filename hash force file download.
Tags:
Generates a report result-set and performs an action depending on conditions
Actions that can happen include:
- renders results to browser by passing generated report as a parameter to Nsm_reports_mcp::configure
- saves report data as a zip-file and emails download link to selected email address
- forces a download of the report in the browser using the output format that has been chosen
This method will configure a report to use a preset if the id and key are set or configures report using post data.
Tags:
string|void save(
[bool
$save_as_new = false])
|
|
Saves a report configuration as a preset and stores options in the database.
If parameter 'save_as_new' is set to true the method will ignore update actions. Some basic form validation takes place in this method and if an error occurs then return the output of the Nsm_reports::configure method and pass the form validation error message as the $error parameter.
Tags:
Parameters:
Displays all saved report presets and displays them as a table.
Method checks that report exists before showing the associated presets.
Saved preset objects are converted into view-friendly arrays.
Form showed on page manages presets to be included in delete command.
Tags:
mixed _renderLayout(
string
$page, [string
$out = FALSE], [array
$page_replacements = array()])
|
|
Manages View display for Expression Engine control panel.
Uses parameters to build the control panel page and associated navigation items.
Tags:
Parameters: