templates
This controller contains common functions for survey related views.
package | LimeSurvey |
---|---|
author | |
copyright | 2011 |
__construct( $controller = null, $id = null)
addPseudoParams(array $params): array
This is also used while rendering wrapped template SurveyCommonAction::renderWrappedTemplate()
Throws |
|
---|
array
Parameters to parse and populate
array
Populated parameters
beforeSideMenuRender(array $aData): string
REFACTORED in LayoutHelper
array
string
brokentemplatezip(string $templatename): void
access | public |
---|
string
checkDemoMode(): void
checkDestDir(string $destdir,string $sNewDirectoryName,string $themeType): void
string
string
string
*
checkFileSizeError( $uploadName = 'the_file'): void
delete(): void
access | public |
---|
deleteAvailableTheme()
deleteBrokenTheme()
deprecatedtemplatezip(string $templatename): void
access | public |
---|
string
fetchExtraMenus(array $aData): \array<ExtraMenu>
array
\array
filterImportedResources(string $extractdir,string $destdir): array
deprecated | use ServiceClass FilterImportedResources instead ... (models/services/) |
---|
string
string
array
findConfigXml(\ZipArchive $zip): string|null
\ZipArchive
string|null
folderzip(string $templatename, $templatePath): void
access | public |
---|
string
getNewDirectoryName(string $themeType,string $src): string
todo | Move to service class Same logic for survey theme |
---|---|
Throws |
|
string
'question' or 'survey'
string
string
getQuestionThemeInstaller(): \LimeSurvey\ExtensionInstaller\QuestionThemeInstaller
index(): void
index(string $editfile = '',string $screenname = 'welcome',string $templatename = ''): void
access | public |
---|
string
string
string
initialise(string $templatename,string $screenname,string $editfile,boolean $showsummary = true):
access | protected |
---|
string
string
string
boolean
listquestiongroups(array $aData)
listquestion groups
array
listquestions( $aData)
Throws |
|
---|
notifications()
nsurveysummary(array $aData)
Survey summary
array
renderCentralContents(string $sAction,array|string $aViewUrls,array $aData = array()): string
string
array|string
array
string
renderInternal(string $_viewFile_, $_data_ = null, $_return_ = false)
inheritdoc | |
---|---|
string
renderJSON(array $aData, $success = true): void
REFACTORED in LSBaseController (this one called by a lot of actions in different controllers)
array
renderWrappedTemplate(string $sAction = '',array|string $aViewUrls = array(),array $aData = array(),string|boolean $sRenderFile = false)
Addition of parameters should be avoided if they can be added to $aData
NOTE FROM LOUIS : We want to remove this function, which doesn't respect MVC pattern. The work it's doing should be handle by layout files, and subviews inside views. Eg : for route "admin/survey/sa/listquestiongroups/surveyid/282267" the Group controller should use a main layout (with admin menu bar as a widget), then render the list view, in which the question group bar is called as a subview.
So for now, we try to evacuate all the renderWrappedTemplate logic (if statements, etc.) to subfunctions, then it will be easier to remove. Comments starting with //// indicate how it should work in the future
Throws |
|
---|
string
Current action, the folder to fetch views from
array|string
View url(s)
array
Data to be passed on. Optional.
string|boolean
File to be rendered as a layout. Optional.
requirePostRequest()
This is intended to be used on subactions. When possible (eg. when refactoring a SurveyCommonAction into an actual controller), use 'postOnly' filter instead.
Throws |
|
---|
route(string $sa,array<mixed,string> $get_vars): mixed
access | protected |
---|
string
array<mixed,string>
mixed
run()
runWithParams(array $params): boolean
array
URL Parameters
boolean
showHeaders(array $aData, $sendHTTPHeader = true)
array
showIntroNotification(): void
stripExt(string $name): string
access | protected |
---|---|
todo | Used? Previous name: _strip_ext |
string
string
surveyManagerBar(array $aData)
todo | Needs to be removed later. Duplication in LayoutHelper. |
---|---|
array
templatecopy(): void
access | public |
---|---|
templatefiledelete(): void
access | public |
---|---|
templaterename(): void
access | public |
---|---|
templatesavechanges(): void
access | public |
---|---|
templatesummary(string $templatename,string $screenname,string $editfile, $relativePathEditfile,string $templates,string $files,string $cssfiles, $jsfiles,array $otherfiles,array $myoutput): array
access | protected |
---|
string
string
string
string
string
string
array
array
array
templatezip(string $templatename): void
access | public |
---|
string
tmp(mixed $id)
mixed
ID of the template file
updatenotification()
REFACTORED (in LayoutHelper.php)
upload(): void
access | public |
---|---|
uploadfile(): void
access | public |
---|---|
uploadTemplate(): array
array
$aData
uploadTemplateImageFile(string $sTemplateName): boolean
string
boolean
userGroupBar(array $aData): void
REFACTORED (it's in UserGroupController and uses function from Layouthelper->renderMenuBar())
array