LimeSurvey API - Master branch

ThemeOptionsController extends LSBaseController
in package

Class LSBaseController

Tags
class

ThemeOptionsController

Table of Contents

Properties

$aData  : array<string|int, mixed>
$navData  : array<string|int, mixed>
This array contains the survey / group / question id used by the menu widget.
$sTemplate  : null
$userId  : int

Methods

__construct()  : mixed
Basic initialiser to the base controller class
accessRules()  : array<string|int, mixed>
It's import to have the accessRules set (security issue).
actionGetPreviewTag()  : string
Preview Tag.
actionImportManifest()  : void
Import or install the Theme Configuration into the database.
actionIndex()  : void
Lists all models.
actionReset()  : void
Resets the theme.
actionSelectedItems()  : void
Renders selected Items for massive action modal.
actionSetAdminTheme()  : void
Sets admin theme.
actionUninstall()  : void
Uninstalls the theme.
actionUninstallMultiple()  : void
Uninstalls all selected themes from massive action.
actionUpdate()  : void
Updates a particular model (globally).
actionUpdateSurvey()  : void
Updates a particular model.
actionUpdateSurveyGroup()  : void
Updates particular model.
actionViewModel()  : void
Displayed a particular Model.
createAbsoluteUrl()  : string
Returns an absolute URL based on the given controller and action information.
loadHelper()  : void
Loads a helper
loadLibrary()  : void
Loads a library
loadModel()  : QuestionTheme
Returns the data model based on the primary key given in the GET variable.
run()  : void
Checks for action specific authorization and then executes an action
_checkInstallation()  : void
Check that installation was already done by looking for config.php Will redirect to the installer script if not exists.
beforeRender()  : bool
This part comes from renderWrappedTemplate
customInit()  : mixed
loadPageStates()  : array<string|int, mixed>
Loads page states from a hidden input.
renderJSON()  : void
Method to render an array as a json document (this one called by a lot of actions in different controllers)
sessionControl()  : void
Load and set session vars
getSurveyGroupIdFromGetRequest()  : mixed
getSurveyIdFromGetRequest()  : int
Try to get the get-parameter from request.
turnAjaxmodeOffAsDefault()  : TemplateConfiguration
This method turns ajaxmode off as default.
updateCommon()  : void
Updates Common.

Properties

$aData

public array<string|int, mixed> $aData = []

import for all new controllers/actions (REFACTORING) to pass data before rendering the content

$navData

This array contains the survey / group / question id used by the menu widget.

public array<string|int, mixed> $navData = array()

$sTemplate

public null $sTemplate = \null

this is needed for the preview rendering inside the questioneditor

Methods

__construct()

Basic initialiser to the base controller class

public __construct(string $id[, CWebModule $module = null ]) : mixed
Parameters
$id : string
$module : CWebModule = null
Tags
access

public

accessRules()

It's import to have the accessRules set (security issue).

public accessRules() : array<string|int, mixed>

Only logged in users should have access to actions. All other permissions should be checked in the action itself.

Return values
array<string|int, mixed>

actionGetPreviewTag()

Preview Tag.

public actionGetPreviewTag() : string

todo: maybe this action should be moved to surveyAdministrationController (it's used in 'General settings')

Tags
throws
CException
Return values
string

| string[] | null

actionImportManifest()

Import or install the Theme Configuration into the database.

public actionImportManifest() : void

for survey theme and question theme

Tags
throws
Exception

actionReset()

Resets the theme.

public actionReset(int $gsid) : void
Parameters
$gsid : int

ID

Tags
throws
Exception

actionSelectedItems()

Renders selected Items for massive action modal.

public actionSelectedItems() : void
Tags
throws
CException
throws
CHttpException

actionSetAdminTheme()

Sets admin theme.

public actionSetAdminTheme(string $sAdminThemeName) : void
Parameters
$sAdminThemeName : string

Admin theme Name

actionUninstallMultiple()

Uninstalls all selected themes from massive action.

public actionUninstallMultiple() : void
Tags
throws
Exception

actionUpdate()

Updates a particular model (globally).

public actionUpdate(int $id) : void

If update is successful, the browser will be redirected to the 'view' page.

Parameters
$id : int

ID of the model

Tags
throws
CException
throws
CHttpException

actionUpdateSurvey()

Updates a particular model.

public actionUpdateSurvey() : void

If update is successful, the browser will be redirected to the 'view' page.

actionUpdateSurveyGroup()

Updates particular model.

public actionUpdateSurveyGroup([int $id = null ], int $gsid[, null $l = null ]) : void

If update is successful, the browser will be redirected to the 'view' page.

Parameters
$id : int = null

ID of model.

$gsid : int

id of survey group

$l : null = null

?

actionViewModel()

Displayed a particular Model.

public actionViewModel(int $id) : void
Parameters
$id : int

ID of model.

createAbsoluteUrl()

Returns an absolute URL based on the given controller and action information.

public createAbsoluteUrl(string $route[, array<string|int, mixed> $params = array() ][, string $schema = '' ][, string $ampersand = '&' ]) : string

The functionalty was moved to \LSYii_Application::createPublicUrl, to be safe the function remains here.

Parameters
$route : string

the URL route. This should be in the format of 'ControllerID/ActionID'.

$params : array<string|int, mixed> = array()

additional GET parameters (name=>value). Both the name and value will be URL-encoded.

$schema : string = ''

schema to use (e.g. http, https). If empty, the schema used for the current request will be used.

$ampersand : string = '&'

the token separating name-value pairs in the URL.

Return values
string

the constructed URL

loadHelper()

Loads a helper

public loadHelper(string $helper) : void
Parameters
$helper : string
Tags
access

public

loadLibrary()

Loads a library

public loadLibrary(string $library) : void
Parameters
$library : string
Tags
access

public

loadModel()

Returns the data model based on the primary key given in the GET variable.

public loadModel(int $id[, int|string $gridid = null ]) : QuestionTheme

If the data model is not found, and HTTP exception will be raised.

Parameters
$id : int

ID

$gridid : int|string = null

Grid ID

Tags
throws
CHttpException
Return values
QuestionTheme

| TemplateConfiguration | null

run()

Checks for action specific authorization and then executes an action

public run(string $action) : void

TODO: check the dbupdate mechanism, do we really want to check db update before every action??

Parameters
$action : string
Tags
access

public

throws
CException
throws
CHttpException

_checkInstallation()

Check that installation was already done by looking for config.php Will redirect to the installer script if not exists.

protected _checkInstallation() : void
Tags
access

protected

beforeRender()

This part comes from renderWrappedTemplate

protected beforeRender(string $view) : bool
Parameters
$view : string

Name of View

Return values
bool

loadPageStates()

Loads page states from a hidden input.

protected loadPageStates() : array<string|int, mixed>
Return values
array<string|int, mixed>

the loaded page states

renderJSON()

Method to render an array as a json document (this one called by a lot of actions in different controllers)

protected renderJSON(array<string|int, mixed> $aData[, mixed $success = true ]) : void
Parameters
$aData : array<string|int, mixed>
$success : mixed = true

sessionControl()

Load and set session vars

protected sessionControl() : void

todo REFACTORING see comments in mehtod

Tags
access

protected

getSurveyIdFromGetRequest()

Try to get the get-parameter from request.

private getSurveyIdFromGetRequest() : int

At the moment there are three namings for a survey ID: 'sid' 'surveyid' 'iSurveyID'

Returns the id as integer or null if not exists any of them.

Tags
todo

While refactoring (at some point) this function should be removed and only one unique identifier should be used

Return values
int

| null


        
On this page

Search results