Survey_Common_Action

Extends \CAction

Survey Common Action

This controller contains common functions for survey related views.

package

LimeSurvey

subpackage

Backend

author

Shitiz Garg

Methods

__construct

__construct($controller = null, $id = null) 

Arguments

$controller

$id

Override runWithParams() implementation in CAction to help us parse requests with subactions.

runWithParams(array $params) 

Arguments

$params

array

URL Parameters

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.

_addPseudoParams(array $params) : array

This is also used while rendering wrapped template {@link Survey_Common_Action::_renderWrappedTemplate()}

Arguments

$params

array

Parameters to parse and populate

Response

array

Populated parameters

Action classes require them to have a run method. We reroute it to index if called.

run() 

Routes the action into correct subaction

route(string $sa, string[] $get_vars) : void
access

protected

Arguments

$sa

string

$get_vars

string[]

Renders template(s) wrapped in header and footer

_renderWrappedTemplate(string $sAction = '', string|array $aViewUrls = array(), array $aData = array()) 

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

Arguments

$sAction

string

Current action, the folder to fetch views from

$aViewUrls

string|array

View url(s)

$aData

array

Data to be passed on. Optional.

Display the update notification

_updatenotification() 

Display notifications

_notifications() 

Survey summary

_nsurveysummary($aData) 

Arguments

$aData

Header

_showHeaders($aData) 

Arguments

$aData

_showadminmenu() function returns html text for the administration button bar

_showadminmenu($aData) : string
access

public

global

string $homedir

string $scriptname

string $surveyid

string $setfont

string $imageurl

int $surveyid

Arguments

$aData

Response

string

$adminmenu

_titlebar

_titlebar($aData) 

Arguments

$aData

_tokenbar

_tokenbar($aData) 

Arguments

$aData

Render the save/cancel bar for Organize question groups/questions

_organizequestionbar(array $aData) 
since 2014-09-30
author

Olle Haerstedt

Arguments

$aData

array

Shows admin menu for question

_questionbar($aData) 

Arguments

$aData

Show admin menu for question group view

_nquestiongroupbar(array $aData) 

Arguments

$aData

array

?

_fullpagebar

_fullpagebar($aData) 

Arguments

$aData

Shows admin menu for surveys

_surveybar($aData) 

Arguments

$aData

Show side menu for survey view

_surveysidemenu(array $aData) 

Arguments

$aData

array

all the needed data

Render the quick-menu that is shown when side-menu is hidden.

renderQuickmenu(array $aData) : string

Only show home-icon for now.

Add support for plugin to attach icon elements using event afterQuickMenuLoad

todo

Make quick-menu user configurable

Arguments

$aData

array

Response

string

listquestion groups

_listquestiongroups($aData) 

Arguments

$aData

_listquestions

_listquestions($aData) 

Arguments

$aData

Show survey summary

_surveysummary($aData) 

Arguments

$aData

Browse Menu Bar

_browsemenubar($aData) 

Arguments

$aData

Load menu bar of user group controller.

_userGroupBar($aData) : void

Arguments

$aData

This function will register a script file, and will choose if it should use the asset manager or not

registerScriptFile(string $cPATH, string $sFile) 

Arguments

$cPATH

string

: the CONSTANT name of the path of the script file (need to be converted in url if asset manager is not used)

$sFile

string

: the file to publish

This function will register a script file, and will choose if it should use the asset manager or not

registerCssFile(string $sPath, string $sFile) 

Arguments

$sPath

string

: the type the path of the css file to publish ( public, template, etc)

$sFile

string

: the file to publish

_filterImportedResources

_filterImportedResources(string $extractdir, string $destdir) 

Arguments

$extractdir

string

$destdir

string

Creates a temporary directory

_tempdir(string $dir, string $prefix = '', int $mode = 448) : string
access

protected

Arguments

$dir

string

$prefix

string

$mode

int

Response

string

Get extra menus from plugins that are using event beforeAdminMenuRender

fetchExtraMenus(array $aData) : \array<ExtraMenu>

Arguments

$aData

array

Response

\array