ThemeOptionsController

Extends\LSBaseController

Class LSBaseController

this controller will have all the necessary methods from the old AdminController

class

ThemeOptionsController

package

Default

Methods

Basic initialiser to the base controller class

__construct(string $id,\CWebModule $module = null)
inherited
access

public

Arguments

$id

string

$module

\CWebModule

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

_checkInstallation(): void
inherited
access

protected

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

accessRules(): array

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

Response

array

Preview Tag.

actionGetPreviewTag(): string

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

Throws
\CException

Response

string

| string[] | null

Import or install the Theme Configuration into the database.

actionImportManifest(): void

for survey theme and question theme

Throws
\Exception

Lists all models.

actionIndex(): void

Resets the theme.

actionReset(integer $gsid): void
Throws
\Exception

Arguments

$gsid

integer

ID

Renders selected Items for massive action modal.

actionSelectedItems(): void
Throws
\CException
\CHttpException

Sets admin theme.

actionSetAdminTheme(string $sAdminThemeName): void

Arguments

$sAdminThemeName

string

Admin theme Name

Uninstalls the theme.

actionUninstall(): void

Uninstalls all selected themes from massive action.

actionUninstallMultiple(): void
Throws
\Exception

Updates a particular model (globally).

actionUpdate(integer $id): void

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

Throws
\CException
\CHttpException

Arguments

$id

integer

ID of the model

Updates a particular model.

actionUpdateSurvey(): void

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

Updates particular model.

actionUpdateSurveyGroup(integer $id = null,integer $gsid,null $l = null): void

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

Arguments

$id

integer

ID of model.

$gsid

integer

id of survey group

$l

null

?

Displayed a particular Model.

actionViewModel(integer $id): void

Arguments

$id

integer

ID of model.

This part comes from renderWrappedTemplate (not the best way to refactoring, but a temporary solution)

beforeRender(string $view): boolean
inherited

todo REFACTORING find all actions that set $aData['surveyid'] and change the layout directly in the action

Arguments

$view

string

Response

boolean

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

createAbsoluteUrl(string $route,array $params = array(),string $schema = '',string $ampersand = '&'): string
inherited

Arguments

$route

string

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

$params

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.

Response

string

the constructed URL

customInit

customInit()
inherited

Try to get the get-parameter from request.

getSurveyIdFromGetRequest(): integer

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.

todo

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

Response

integer

| null

Loads a helper

loadHelper(string $helper): void
inherited
access

public

Arguments

$helper

string

Loads a library

loadLibrary(string $library): void
inherited
access

public

Arguments

$library

string

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

loadModel(integer $id,integer|string $gridid = null): \QuestionTheme

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

Throws
\CHttpException

Arguments

$id

integer

ID

$gridid

integer|string

Grid ID

Response

\QuestionTheme

| TemplateConfiguration | null

Loads page states from a hidden input.

loadPageStates(): array
inherited

Response

array

the loaded page states

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

renderJSON(array $aData, $success = true): void
inherited

Arguments

$aData

array

$success

Checks for action specific authorization and then executes an action

run(string $action): void
inherited

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

access

public

Throws
\CException
\CHttpException

Arguments

$action

string

Load and set session vars

sessionControl(): void
inherited

todo REFACTORING see comments in mehtod

access

protected

This method turns ajaxmode off as default.

turnAjaxmodeOffAsDefault(\TemplateConfiguration $templateConfiguration): \TemplateConfiguration

Arguments

$templateConfiguration

\TemplateConfiguration

Configuration of Template

Response

\TemplateConfiguration

Updates Common.

updateCommon(\TemplateConfiguration $model,integer|null $sid = null,integer|null $gsid = null): void

Arguments

$model

\TemplateConfiguration

Template Configuration

$sid

integer|null

Survey ID

$gsid

integer|null

Survey Group ID

Properties

this is needed for the preview rendering inside the questioneditor

sTemplate :null
inherited
var

this is needed for the preview rendering inside the questioneditor

Type(s)

null

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

aData :array
inherited
var

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

Type(s)

array

userId of the logged in user

userId :integer
inherited
var

userId of the logged in user

Type(s)

integer

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

navData :array
inherited
var

Type(s)

array