LimeSurvey API - Master branch

AdminController extends LSYii_Controller
in package

Table of Contents

Properties

$aAdminModulesClasses  : mixed
$layout  : mixed
$navData  : array<string|int, mixed>
This array contains the survey / group / question id used by the menu widget.
$sTemplate  : mixed
$aOverridenCoreActions  : mixed
$currentModuleAction  : mixed
$user_id  : mixed

Methods

__construct()  : mixed
Basic initialiser to the base controller class
actions()  : array<string|int, mixed>
Routes all the actions to their respective places
createAbsoluteUrl()  : string
Returns an absolute URL based on the given controller and action information.
error()  : void
Shows a nice error message to the world
getActionClasses()  : mixed
getAdminFooter()  : string|null
Prints Admin Footer
getAdminHeader()  : string|null
Prints Admin Header
getAdminModulesActionClasses()  : mixed
This function returns an array similar to getActionClasses() It will generate it by reading the directories names inside of lsadminmodulesrootdir So, by convention, admin module action class must be indentical to directory name
getModulesActions()  : array<string|int, mixed>
This function is very similiar to AdminController::actions() Routes all the modules actions to their respective places
loadEndScripts()  : bool|string
REFACTORED (in LayoutHelper.php)
loadHelper()  : void
Loads a helper
loadLibrary()  : void
Loads a library
renderPartial()  : string
If a module override the views of a controller, renderPartial needs to check module view directories.
run()  : bool|null
Checks for action specific authorization and then executes an action
showMessageBox()  : string|null
Shows a message box
_checkInstallation()  : void
Check that installation was already done by looking for config.php Will redirect to the installer script if not exists.
customInit()  : void
Initialises this controller, does some basic checks and setups
getOverridenCoreAction()  : array<string|int, mixed>
Return the list of overridden actions from modules, and generate it if needed
loadPageStates()  : array<string|int, mixed>
Loads page states from a hidden input.
runModuleController()  : mixed
Starting with LS4, 3rd party developer can extends any of the LimeSurve controllers.
sessioncontrol()  : void
Load and set session vars

Properties

$navData

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

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

$aOverridenCoreActions

protected mixed $aOverridenCoreActions = array()

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

actions()

Routes all the actions to their respective places

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

todo REFACTORING we don't have to refactore this method ...

Tags
access

public

Return values
array<string|int, mixed>

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

error()

Shows a nice error message to the world

public error(string $message[, mixed $sURL = array() ]) : void

todo REFACTORING is this still in use? can't find any call in an action or a view ... todo its used multiple times getController->error, all calls should be replaceable by setFlashMessage

Parameters
$message : string

The error message

$sURL : mixed = array()
Tags
access

public

getAdminFooter()

Prints Admin Footer

public getAdminFooter(string $url, string $explanation[, bool $return = false ]) : string|null

REFACTORED (in LayoutHelper)

Parameters
$url : string
$explanation : string
$return : bool = false
Tags
access

protected

Return values
string|null

getAdminHeader()

Prints Admin Header

public getAdminHeader([bool $meta = false ][, bool $return = false ]) : string|null

REFACTORED (in LayoutHelper.php)

Parameters
$meta : bool = false
$return : bool = false
Tags
access

protected

Return values
string|null

getAdminModulesActionClasses()

This function returns an array similar to getActionClasses() It will generate it by reading the directories names inside of lsadminmodulesrootdir So, by convention, admin module action class must be indentical to directory name

public getAdminModulesActionClasses() : mixed

getModulesActions()

This function is very similiar to AdminController::actions() Routes all the modules actions to their respective places

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

todo REFACTORING we don't have to refactore this method ...

Tags
access

public

Return values
array<string|int, mixed>

loadEndScripts()

REFACTORED (in LayoutHelper.php)

public loadEndScripts() : bool|string
Tags
throws
CException
Return values
bool|string

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

renderPartial()

If a module override the views of a controller, renderPartial needs to check module view directories.

public renderPartial(string $view[, array<string|int, mixed> $data = null ][, bool $return = false ][, bool $processOutput = false ]) : string

This work recusively with infinite depth of subdirectories.

Parameters
$view : string

name of the view to be rendered. See for details about how the view script is resolved.

$data : array<string|int, mixed> = null

data to be extracted into PHP variables and made available to the view script

$return : bool = false

whether the rendering result should be returned instead of being displayed to end users

$processOutput : bool = false

whether the rendering result should be postprocessed using .

Tags
throws
CException

if the view does not exist

see
getViewFile
see
processOutput
see
render
Return values
string

the rendering result. Null if the rendering result is not required.

run()

Checks for action specific authorization and then executes an action

public run(string $action) : bool|null

REFACTORED ( in LSBaseController)

Parameters
$action : string
Tags
access

public

Return values
bool|null

showMessageBox()

Shows a message box

public showMessageBox(string $title, string $message[, string $class = "message-box-error" ][, bool $return = false ]) : string|null

REFACTORED ( in LayoutHelper.php )

Parameters
$title : string
$message : string
$class : string = "message-box-error"
$return : bool = false
Tags
access

public

Return values
string|null

_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

customInit()

Initialises this controller, does some basic checks and setups

protected customInit() : void

REFACTORED ( in LSBaseController )

Tags
access

protected

getOverridenCoreAction()

Return the list of overridden actions from modules, and generate it if needed

protected getOverridenCoreAction() : array<string|int, mixed>

REFACTORED ( in LSYiiController)

Return values
array<string|int, mixed>

loadPageStates()

Loads page states from a hidden input.

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

the loaded page states

runModuleController()

Starting with LS4, 3rd party developer can extends any of the LimeSurve controllers.

protected runModuleController(mixed $action) : mixed

REFACTORED ( in LSBaseController)

Parameters
$action : mixed

sessioncontrol()

Load and set session vars

protected sessioncontrol() : void

REFACTORED (in LSBaseController)

Tags
access

protected


        
On this page

Search results