Export
extends SurveyCommonAction
in package
Export Action
This controller performs export actions
Tags
Table of Contents
Methods
- __construct() : mixed
- Export Constructor.
- downloadZip() : mixed
- Download an archive file
- dumplabel() : mixed
- Dump Label
- exportMultipleArchiveSurveys() : mixed
- Export multiple surveys archives. Called via ajax from surveys list massive action
- exportMultiplePrintableSurveys() : mixed
- Export multiple surveys structure. Called via ajax from surveys list massive action
- exportMultipleStructureSurveys() : mixed
- Export multiple surveys structure. Called via ajax from surveys list massive action
- exportMultipleSurveys() : array<string|int, mixed>
- Export Multiple Surveys
- exportresults() : mixed
- Export Results
- exportspss() : mixed
- The SPSS DATA LIST / BEGIN DATA parser is rather simple minded, the number after the type specifier identifies the field width (maximum number of characters to scan) It will stop short of that number of characters, honouring quote delimited space separated strings, however if the width is too small the remaining data in the current line becomes part of the next column. Since we want to restrict this script to ONE scan of the data (scan & output at same time), the information needed to construct the DATA LIST is held in the $fields array, while the actual data is written to a to a temporary location, updating length (size) values in the $fields array as the tmp file is generated (uses @fwrite's return value rather than strlen).
- group() : mixed
- Export Group
- index() : void
- question() : mixed
- Export Question
- questionbar() : mixed
- Shows admin menu for question
- quexml() : void
- Generate a queXML PDF document with provided styles/settings
- quexmlclear() : void
- Clear queXML settings from settings table
- renderInternal() : mixed
- resources() : mixed
- Resources Export
- run() : mixed
- Action classes require them to have a run method. We reroute it to index if called.
- runWithParams() : bool
- Override runWithParams() implementation in CAction to help us parse requests with subactions.
- survey() : mixed
- Export Survey
- surveyarchives() : mixed
- This function exports a ZIP archives of several ZIP archives - it is used in the listSurvey controller The SIDs are read from session flashdata.
- surveybar() : mixed
- Shows admin menu for surveys
- vvexport() : mixed
- VV Export
- beforeSideMenuRender() : string
- Returns content from event beforeSideMenuRender
- fetchExtraMenus() : array<string|int, ExtraMenu>
- Get extra menus from plugins that are using event beforeAdminMenuRender
- filterImportedResources() : array<string|int, mixed>
- listquestiongroups() : mixed
- REFACTORED in LayoutHelper
- listquestions() : mixed
- REFACTORED in LayoutHelper
- notifications() : mixed
- Display notifications
- nsurveysummary() : mixed
- REFACTORED in LayoutHelper
- organizequestionbar() : mixed
- Render the save/cancel bar for Organize question groups/questions
- renderCentralContents() : string
- Rendering the subviews and views of renderWrappedTemplate
- renderJSON() : void
- Method to render an array as a json document
- renderQuickmenu() : string
- Render the quick-menu that is shown when side-menu is hidden.
- renderWrappedTemplate() : mixed
- Renders template(s) wrapped in header and footer
- requirePostRequest() : mixed
- Validates that the request method is POST.
- route() : mixed
- Routes the action into correct subaction
- showadminmenu() : string
- showadminmenu() function returns html text for the administration button bar
- showHeaders() : mixed
- Header
- surveysidemenu() : mixed
- Show side menu for survey view
- titlebar() : mixed
- REFACTORED in LayoutHelper.php
- updatenotification() : mixed
- Display the update notification
- addHeaders() : void
- Add Headers
- addPseudoParams() : array<string|int, mixed>
- Some functions have different parameters, which are just an alias of the usual parameters we're getting in the url. This function just populates those variables so that we don't end up in an error.
- addToZip() : mixed
- Add to zip
- exportarchive() : string
- Exports a archive (ZIP) of the current survey (structure, responses, timings, tokens)
- exportPrintableHtml() : string
- Get a the printable html questionnaire in specified language and store the file in the specified directory
- exportPrintableHtmls() : string
- Get a Zipped version of survey print version in all languages (including the template html assets)
- exporttsv() : void
- Generate an TSV (tab-separated value) file for the survey structure
- surveyexport() : void
- Survey export
- xmlToJson() : string
- XML to JSON
Methods
__construct()
Export Constructor.
public
__construct(mixed $controller, int $id) : mixed
Parameters
- $controller : mixed
-
Controller
- $id : int
downloadZip()
Download an archive file
public
downloadZip(string $sZip) : mixed
Parameters
- $sZip : string
-
name of zip file to download (will be downloaded as "surveys_archive.zip")
dumplabel()
Dump Label
public
dumplabel() : mixed
exportMultipleArchiveSurveys()
Export multiple surveys archives. Called via ajax from surveys list massive action
public
exportMultipleArchiveSurveys() : mixed
exportMultiplePrintableSurveys()
Export multiple surveys structure. Called via ajax from surveys list massive action
public
exportMultiplePrintableSurveys() : mixed
exportMultipleStructureSurveys()
Export multiple surveys structure. Called via ajax from surveys list massive action
public
exportMultipleStructureSurveys() : mixed
exportMultipleSurveys()
Export Multiple Surveys
public
exportMultipleSurveys(string $sSurveys, string $sExportType) : array<string|int, mixed>
Parameters
- $sSurveys : string
- $sExportType : string
Return values
array<string|int, mixed>exportresults()
Export Results
public
exportresults() : mixed
exportspss()
The SPSS DATA LIST / BEGIN DATA parser is rather simple minded, the number after the type specifier identifies the field width (maximum number of characters to scan) It will stop short of that number of characters, honouring quote delimited space separated strings, however if the width is too small the remaining data in the current line becomes part of the next column. Since we want to restrict this script to ONE scan of the data (scan & output at same time), the information needed to construct the DATA LIST is held in the $fields array, while the actual data is written to a to a temporary location, updating length (size) values in the $fields array as the tmp file is generated (uses @fwrite's return value rather than strlen).
public
exportspss() : mixed
Final output renders $fields to a DATA LIST, and then stitches in the tmp file data.
Optimization opportunities remain in the VALUE LABELS section, which runs a query / column
group()
Export Group
public
group() : mixed
index()
public
index() : void
question()
Export Question
public
question() : mixed
questionbar()
Shows admin menu for question
public
questionbar(array<string|int, mixed> $aData) : mixed
Parameters
- $aData : array<string|int, mixed>
Tags
quexml()
Generate a queXML PDF document with provided styles/settings
public
quexml(int $iSurveyID) : void
Parameters
- $iSurveyID : int
quexmlclear()
Clear queXML settings from settings table
public
quexmlclear(int $iSurveyID) : void
Parameters
- $iSurveyID : int
renderInternal()
public
renderInternal(string $_viewFile_[, mixed $_data_ = null ][, mixed $_return_ = false ]) : mixed
Parameters
- $_viewFile_ : string
- $_data_ : mixed = null
- $_return_ : mixed = false
Tags
resources()
Resources Export
public
resources() : mixed
run()
Action classes require them to have a run method. We reroute it to index if called.
public
run() : mixed
runWithParams()
Override runWithParams() implementation in CAction to help us parse requests with subactions.
public
runWithParams(array<string|int, mixed> $params) : bool
Parameters
- $params : array<string|int, mixed>
-
URL Parameters
Return values
boolsurvey()
Export Survey
public
survey() : mixed
surveyarchives()
This function exports a ZIP archives of several ZIP archives - it is used in the listSurvey controller The SIDs are read from session flashdata.
public
surveyarchives() : mixed
surveybar()
Shows admin menu for surveys
public
surveybar(array<string|int, mixed> $aData) : mixed
Parameters
- $aData : array<string|int, mixed>
Tags
vvexport()
VV Export
public
vvexport() : mixed
beforeSideMenuRender()
Returns content from event beforeSideMenuRender
protected
beforeSideMenuRender(array<string|int, mixed> $aData) : string
REFACTORED in LayoutHelper
Parameters
- $aData : array<string|int, mixed>
Return values
stringfetchExtraMenus()
Get extra menus from plugins that are using event beforeAdminMenuRender
protected
fetchExtraMenus(array<string|int, mixed> $aData) : array<string|int, ExtraMenu>
Parameters
- $aData : array<string|int, mixed>
Return values
array<string|int, ExtraMenu>filterImportedResources()
protected
filterImportedResources(string $extractdir, string $destdir) : array<string|int, mixed>
Parameters
- $extractdir : string
- $destdir : string
Tags
Return values
array<string|int, mixed>listquestiongroups()
REFACTORED in LayoutHelper
protected
listquestiongroups(array<string|int, mixed> $aData) : mixed
listquestion groups
Parameters
- $aData : array<string|int, mixed>
listquestions()
REFACTORED in LayoutHelper
protected
listquestions( $aData) : mixed
Parameters
Tags
notifications()
Display notifications
protected
notifications() : mixed
- REFACTORED (in LayoutHelper.php)
nsurveysummary()
REFACTORED in LayoutHelper
protected
nsurveysummary(array<string|int, mixed> $aData) : mixed
Survey summary
Parameters
- $aData : array<string|int, mixed>
organizequestionbar()
Render the save/cancel bar for Organize question groups/questions
protected
organizequestionbar(array<string|int, mixed> $aData) : mixed
REFACTORED in LayoutHelper
Parameters
- $aData : array<string|int, mixed>
Tags
renderCentralContents()
Rendering the subviews and views of renderWrappedTemplate
protected
renderCentralContents(string $sAction, array<string|int, mixed>|string $aViewUrls[, array<string|int, mixed> $aData = [] ]) : string
Parameters
- $sAction : string
- $aViewUrls : array<string|int, mixed>|string
- $aData : array<string|int, mixed> = []
Return values
stringrenderJSON()
Method to render an array as a json document
protected
renderJSON(array<string|int, mixed> $aData[, mixed $success = true ]) : void
REFACTORED in LSBaseController (this one called by a lot of actions in different controllers)
Parameters
- $aData : array<string|int, mixed>
- $success : mixed = true
renderQuickmenu()
Render the quick-menu that is shown when side-menu is hidden.
protected
renderQuickmenu(array<string|int, mixed> $aData) : string
REFACTORED in LayoutHelper
Only show home-icon for now.
Add support for plugin to attach icon elements using event afterQuickMenuLoad
Parameters
- $aData : array<string|int, mixed>
Tags
Return values
stringrenderWrappedTemplate()
Renders template(s) wrapped in header and footer
protected
renderWrappedTemplate([string $sAction = 'export' ][, string $aViewUrls = array() ][, array<string|int, mixed> $aData = array() ][, bool $sRenderFile = false ]) : mixed
Parameters
- $sAction : string = 'export'
-
Current action, the folder to fetch views from
- $aViewUrls : string = array()
-
View url(s)
- $aData : array<string|int, mixed> = array()
-
Data to be passed on. Optional.
- $sRenderFile : bool = false
requirePostRequest()
Validates that the request method is POST.
protected
requirePostRequest() : mixed
This is intended to be used on subactions. When possible (eg. when refactoring a SurveyCommonAction into an actual controller), use 'postOnly' filter instead.
Tags
route()
Routes the action into correct subaction
protected
route(string $sa, array<string|int, string> $get_vars) : mixed
Parameters
- $sa : string
- $get_vars : array<string|int, string>
Tags
showadminmenu()
showadminmenu() function returns html text for the administration button bar
protected
showadminmenu( $aData) : string
REFACTORED (in LayoutHelper.php)
Parameters
Tags
Return values
stringshowHeaders()
Header
protected
showHeaders(array<string|int, mixed> $aData[, mixed $sendHTTPHeader = true ]) : mixed
- REFACTORED (in LayoutHelper.php)
Parameters
- $aData : array<string|int, mixed>
- $sendHTTPHeader : mixed = true
surveysidemenu()
Show side menu for survey view
protected
surveysidemenu(array<string|int, mixed> $aData) : mixed
REFACTORED in LayoutHelper.php
Parameters
- $aData : array<string|int, mixed>
-
all the needed data
titlebar()
REFACTORED in LayoutHelper.php
protected
titlebar( $aData) : mixed
Parameters
Tags
updatenotification()
Display the update notification
protected
updatenotification() : mixed
REFACTORED (in LayoutHelper.php)
Tags
addHeaders()
Add Headers
private
addHeaders(string $filename, string $content_type, string $expires) : void
Parameters
- $filename : string
- $content_type : string
- $expires : string
addPseudoParams()
Some functions have different parameters, which are just an alias of the usual parameters we're getting in the url. This function just populates those variables so that we don't end up in an error.
private
addPseudoParams(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
-
Parameters to parse and populate
Tags
Return values
array<string|int, mixed> —Populated parameters
addToZip()
Add to zip
private
addToZip(PclZip $zip, string $name, string $full_name) : mixed
Parameters
- $zip : PclZip
- $name : string
- $full_name : string
exportarchive()
Exports a archive (ZIP) of the current survey (structure, responses, timings, tokens)
private
exportarchive(int $iSurveyID[, bool $bSendToBrowser = true ]) : string
Parameters
- $iSurveyID : int
-
The ID of the survey to export
- $bSendToBrowser : bool = true
-
If TRUE (default) then the ZIP file is sent to the browser
Return values
string —Full path of the ZIP filename if $bSendToBrowser is set to TRUE, otherwise no return value
exportPrintableHtml()
Get a the printable html questionnaire in specified language and store the file in the specified directory
private
exportPrintableHtml(Survey $oSurvey, string $language, string $tempdir) : string
Parameters
- $oSurvey : Survey
- $language : string
- $tempdir : string
-
the directory the file will be stored in
Return values
string —File name where the data is stored
exportPrintableHtmls()
Get a Zipped version of survey print version in all languages (including the template html assets)
private
exportPrintableHtmls(int $iSurveyID[, bool $readFile = true ]) : string
Parameters
- $iSurveyID : int
-
Survey ID
- $readFile : bool = true
-
Whether we read the file for direct download (or not as in massive actions)
Return values
stringexporttsv()
Generate an TSV (tab-separated value) file for the survey structure
private
exporttsv(int $surveyid) : void
Parameters
- $surveyid : int
surveyexport()
Survey export
private
surveyexport(string $action, int $iSurveyID) : void
Parameters
- $action : string
- $iSurveyID : int
xmlToJson()
XML to JSON
private
xmlToJson(string $fileContents) : string
Parameters
- $fileContents : string