Survey Common Action
This controller contains common functions for survey related views.
package | Default |
---|
__construct( $controller = null, $id = null)
_addPseudoParams(array $params): array
This is also used while rendering wrapped template Survey_Common_Action::_renderWrappedTemplate()
Throws |
|
---|
array
Parameters to parse and populate
array
Populated parameters
_filterImportedResources(string $extractdir,string $destdir): array
string
string
array
_listquestiongroups(array $aData)
listquestion groups
array
_listquestions( $aData)
Throws |
|
---|
_notifications()
_nsurveysummary(array $aData)
Survey summary
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, wich 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 wich 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.
_showHeaders(array $aData, $sendHTTPHeader = true)
array
_surveysummary(array $aData)
Show survey summary
array
_updatenotification()
REFACTORED (in LayoutHelper.php)
_userGroupBar(array $aData): void
REFACTORED (it's in UserGroupController and uses function from Layouthelper->renderMenuBar())
array
applyedit(): string|array<mixed,string>|null
Throws |
|
---|
string|array<mixed,string>|null
applyPermissionFromArray(integer $iRoleId,array $aPermissionArray): array
integer
array
array
applyPermissionFromXML( $iRoleId, $oPermissionObject)
batchDelete()
batchExport()
beforeSideMenuRender(array $aData): string
REFACTORED in LayoutHelper
array
string
delete()
If deletion is successful, the browser will be redirected to the 'admin' page.
edit( $ptid = null)
If creation is successful, the browser will be redirected to the 'view' page.
editrolemodal( $ptid = null)
fetchExtraMenus(array $aData): \array<ExtraMenu>
array
\array
importXML()
index()
index(): void
loadModel(integer $ptid): \Permissiontemplates
If the data model is not found, an HTTP exception will be raised.
Throws |
|
---|
integer
the ID of the model to be loaded
\Permissiontemplates
the loaded model
renderCentralContents(string $sAction,array|string $aViewUrls,array $aData = array()): string
string
array|string
array
string
renderErrors(array $errors): string
array
string
$errorDiv
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
route(string $sa,array<mixed,string> $get_vars): mixed
access | protected |
---|
string
array<mixed,string>
mixed
run()
runexport( $ptid)
runWithParams(array $params): boolean
array
URL Parameters
boolean
showImportXML()
viewrole(integer $ptid)
integer
the ID of the model to be displayed