SurveyAdmin

Extends \Survey_Common_Action

survey

This controller contains common functions for survey related views.

package

LimeSurvey

author

The LimeSurvey Project team

copyright

2011

version

$Id: surveyaction.php 12301 2012-02-02 08:51:43Z c_schmitz $

access

public

Methods

__construct

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

Arguments

$controller

$id

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
inherited

This is also used while rendering wrapped template Survey_Common_Action::_renderWrappedTemplate()

Throws
\CHttpException

Arguments

$params

array

Parameters to parse and populate

Response

array

Populated parameters

Browse Menu Bar

_browsemenubar(array $aData) 
inherited

Arguments

$aData

array

This private function creates a sample group

_createSampleGroup(integer $iSurveyID) 

Arguments

$iSurveyID

integer

The survey ID that the sample group will belong to

This private function creates a sample question

_createSampleQuestion(integer $iSurveyID, mixed $iGroupID) 

Arguments

$iSurveyID

integer

The survey ID that the sample question will belong to

$iGroupID

mixed

The group ID that the sample question will belong to

survey::_fetchSurveyInfo() Load survey information based on $action.

_fetchSurveyInfo(string $action, mixed $iSurveyID = null) : 
deprecated

use Survey objects instead

Arguments

$action

string

$iSurveyID

mixed

Response

_filterImportedResources

_filterImportedResources(string $extractdir, string $destdir) : array
inherited

Arguments

$extractdir

string

$destdir

string

Response

array

_fullpagebar

_fullpagebar( $aData) 
inherited

Arguments

$aData

survey::_generalTabEditSurvey() Load "General" tab of edit survey screen.

_generalTabEditSurvey(\Survey $survey) : mixed

Arguments

$survey

\Survey

Response

mixed

survey::_generalTabNewSurvey() Load "General" tab of new survey screen.

_generalTabNewSurvey() : array

Response

array

_getGeneralTemplateData

_getGeneralTemplateData(integer $iSurveyID) : array

Arguments

$iSurveyID

integer

Response

array

_getTextEditData

_getTextEditData(\Survey $survey) : array

Arguments

$survey

\Survey

Response

array

listquestion groups

_listquestiongroups(array $aData) 
inherited

Arguments

$aData

array

_listquestions

_listquestions( $aData) 
inherited

Arguments

$aData

Display notifications

_notifications() 
inherited

Show admin menu for question group view

_nquestiongroupbar(array $aData) 
inherited

Arguments

$aData

array

?

Survey summary

_nsurveysummary(array $aData) 
inherited

Arguments

$aData

array

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

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

Olle Haerstedt

Arguments

$aData

array

survey::_pluginTabSurvey() Load "Simple Plugin" page in specific survey.

_pluginTabSurvey(\Survey $survey) : mixed
SuppressWarnings

(PHPMD.UnusedPrivateMethod)

Arguments

$survey

\Survey

Response

mixed

This method is called via call_user_func in self::rendersidemenulink()

Shows admin menu for question

_questionbar(array $aData) 
inherited

Arguments

$aData

array

Executes registerScriptFile for all needed script/style files

_registerScriptFiles() : void

Renders template(s) wrapped in header and footer

_renderWrappedTemplate(string $sAction = '', array|string $aViewUrls = array(), array $aData = array(), string|boolean $sRenderFile = false) 
inherited

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

array|string

View url(s)

$aData

array

Data to be passed on. Optional.

$sRenderFile

string|boolean

File to be rendered as a layout. Optional.

Reorder groups and questions

_reorderGroup(integer $iSurveyID) : void

Arguments

$iSurveyID

integer

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

_showadminmenu( $aData) : string
inherited
access

public

global

string $homedir

string $scriptname

string $surveyid

string $setfont

string $imageurl

int $surveyid

Arguments

$aData

Response

string

Header

_showHeaders(array $aData,  $sendHTTPHeader = true) 
inherited

Arguments

$aData

array

$sendHTTPHeader

Show the form for Organize question groups/questions

_showReorderForm(integer $iSurveyID) : void
todo

Change function name to _showOrganizeGroupsAndQuestions?

Arguments

$iSurveyID

integer

Shows admin menu for surveys

_surveybar( $aData) 
inherited

Arguments

$aData

Show side menu for survey view

_surveysidemenu(array $aData) 
inherited

Arguments

$aData

array

all the needed data

Show survey summary

_surveysummary(array $aData) 
inherited

Arguments

$aData

array

survey::_tabNotificationDataManagement() Load "Notification & data management" tab.

_tabNotificationDataManagement(mixed $esrow) : array

Arguments

$esrow

mixed

Response

array

_tabPanelIntegration

_tabPanelIntegration(\Survey $survey) : array

Arguments

$survey

\Survey

Response

array

survey::_tabPresentationNavigation() Load "Presentation & navigation" tab.

_tabPresentationNavigation(mixed $esrow) : array

Arguments

$esrow

mixed

Response

array

survey::_tabPublicationAccess() Load "Publication * access control" tab.

_tabPublicationAccess(\Survey $survey) : 

Arguments

$survey

\Survey

Response

survey::_tabResourceManagement() Load "Resources" tab.

_tabResourceManagement( $oSurvey) : mixed

Arguments

$oSurvey

Response

mixed

survey::_tabTokens() Load "Tokens" tab.

_tabTokens(mixed $esrow) : array

Arguments

$esrow

mixed

Response

array

Creates a temporary directory

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

protected

Arguments

$dir

string

$prefix

string

$mode

integer

Response

string

_titlebar

_titlebar( $aData) 
inherited

Arguments

$aData

_tokenbar

_tokenbar( $aData) 
inherited

Arguments

$aData

Display the update notification

_updatenotification() 
inherited

Load menu bar of user group controller.

_userGroupBar(array $aData) : void
inherited

Arguments

$aData

array

Function responsible to activate survey.

activate(integer $iSurveyID) : void
access

public

Arguments

$iSurveyID

integer

Returns content from event beforeSideMenuRender

beforeSideMenuRender(array $aData) : string
inherited

Arguments

$aData

array

Response

string

Called via ajax request from survey summary quick action "Show questions group by group"

changeFormat( $iSurveyID,  $format) 

Arguments

$iSurveyID

$format

changetemplate

changetemplate( $iSurveyID,  $template) 
todo

Arguments

$iSurveyID

$template

Function responsible to import/copy a survey based on $action.

copy() : void
access

public

datetimesettings

datetimesettings() 
todo

Function responsible to deactivate a survey.

deactivate(integer $iSurveyID = null) : void
access

public

Arguments

$iSurveyID

integer

Function responsible to delete a survey.

delete(integer $iSurveyID) : string
access

public

Arguments

$iSurveyID

integer

Response

string

Delete multiple survey

deleteMultiple() : void

Load editing of local settings of a survey screen.

editlocalsettings(integer $iSurveyID) : void
access

public

Arguments

$iSurveyID

integer

Takes the edit call from the detailed survey view, which either deletes the survey information

editSurvey_json() 

This function prepares the view for editing a survey

editsurveysettings( $iSurveyID) 

Arguments

$iSurveyID

expire

expire( $iSurveyID) 
todo

Arguments

$iSurveyID

Action to set expiry date to multiple surveys

expireMultipleSurveys() 

fakebrowser

fakebrowser() 
todo

Document me

Get extra menus from plugins that are using event beforeAdminMenuRender

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

Arguments

$aData

array

Response

\array

Ajaxified get MenuItems with containing questions

getAjaxMenuArray( $surveyid,  $position = '') 
todo

Arguments

$surveyid

$position

Ajaxified get questiongroup with containing questions

getAjaxQuestionGroupArray( $surveyid) 
todo

Arguments

$surveyid

Get the new question organization from the post data.

getOrgdata() : array

This function replaces parse_str, since parse_str is bound by max_input_vars.

Response

array

getUrlParamsJSON

getUrlParamsJSON( $iSurveyID) 
todo

Arguments

$iSurveyID

Function responsible to import survey resources from a '.zip' file.

importsurveyresources() : void
access

public

index

index() : void
inherited

Loads list of surveys and its few quick properties.

index() : void
access

public

Saves the new survey after the creation screen is submitted

insert(integer $iSurveyID = null) : string

Arguments

$iSurveyID

integer

The survey id to be used for the new survey. If already taken a new random one will be used.

Response

string

Load list question groups view for a specified by $iSurveyID

listquestiongroups(mixed $surveyid) : void
access

public

Arguments

$surveyid

mixed

The survey ID

Load list questions view for a specified survey by $surveyid

listquestions(mixed $surveyid) : string
access

public

Arguments

$surveyid

mixed

Response

string

listsurveys

listsurveys() 
todo

This function prepares the view for a new survey

newsurvey() 

questiongroup::organize() Load ordering of question group screen.

organize(integer $iSurveyID) : void

Arguments

$iSurveyID

integer

Remove files not deleted properly.

purge(integer $purge_sid) : void

Purge is only available for surveys that were already deleted but for some reason left files behind.

Arguments

$purge_sid

integer

regenquestioncodes

regenquestioncodes( $iSurveyID,  $sSubAction) 
todo

Arguments

$iSurveyID

$sSubAction

Rendering the subviews and views of _renderWrappedTemplate

renderCentralContents(string $sAction, array|string $aViewUrls, array $aData = array()) : string
inherited

Arguments

$sAction

string

$aViewUrls

array|string

$aData

array

Response

string

renderInternal

renderInternal(string $_viewFile_,  $_data_ = null,  $_return_ = false) 
inherited
inheritdoc

Arguments

$_viewFile_

string

$_data_

$_return_

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

renderQuickmenu(array $aData) : string
inherited

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

Routes the action into correct subaction

route(string $sa, array<mixed,string> $get_vars) : mixed
inherited
access

protected

Arguments

$sa

string

$get_vars

array<mixed,string>

Response

mixed

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

run() 
inherited

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

runWithParams(array $params) : boolean
inherited

Arguments

$params

array

URL Parameters

Response

boolean

Edit surveytexts and general settings

surveygeneralsettings( $iSurveyID) 

Arguments

$iSurveyID

togglequickaction

togglequickaction() 
todo

Load complete view of survey properties and actions specified by $iSurveyID

view(mixed $iSurveyID, mixed $gid = null, mixed $qid = null) : void
access

public

Arguments

$iSurveyID

mixed

$gid

mixed

$qid

mixed