AdminController

Extends\LSYii_Controller

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

Prints Admin Footer

_getAdminFooter(string $url,string $explanation,boolean $return = false): string|null

REFACTORED (in LayoutHelper)

access

protected

Arguments

$url

string

$explanation

string

$return

boolean

Response

string|null

Prints Admin Header

_getAdminHeader(boolean $meta = false,boolean $return = false): string|null

REFACTORED (in LayoutHelper.php)

access

protected

Arguments

$meta

boolean

$return

boolean

Response

string|null

_init

_init()
inherited

REFACTORED (in LayoutHelper.php)

_loadEndScripts(): boolean|string
Throws
\CException

Response

boolean|string

Load and set session vars

_sessioncontrol(): void

REFACTORED (in LSBaseController)

access

protected

Shows a message box

_showMessageBox(string $title,string $message,string $class = "message-box-error",boolean $return = false): string|null

REFACTORED ( in LayoutHelper.php )

access

public

Arguments

$title

string

$message

string

$class

string

$return

boolean

Response

string|null

Routes all the actions to their respective places

actions(): array

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

access

public

Response

array

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

Shows a nice error message to the world

error(string $message, $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

access

public

Arguments

$message

string

The error message

$sURL

getActionClasses

getActionClasses()

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

getAdminModulesActionClasses()

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

getModulesActions(): array

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

access

public

Response

array

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

getOverridenCoreAction(): array

REFACTORED ( in LSYiiController)

Response

array

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

Loads page states from a hidden input.

loadPageStates(): array
inherited

Response

array

the loaded page states

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

renderPartial(string $view,array $data = null,boolean $return = false,boolean $processOutput = false): string

This work recusively with infinite depth of subdirectories.

see \getViewFile\processOutput\render
Throws
\CException

if the view does not exist

Arguments

$view

string

name of the view to be rendered. See {@link getViewFile} for details about how the view script is resolved.

$data

array

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

$return

boolean

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

$processOutput

boolean

whether the rendering result should be postprocessed using {@link processOutput}.

Response

string

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

Checks for action specific authorization and then executes an action

run(string $action): boolean|null

REFACTORED ( in LSBaseController)

access

public

Arguments

$action

string

Response

boolean|null

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

runModuleController( $action)

REFACTORED ( in LSBaseController)

Arguments

$action

Properties

sTemplate

sTemplate :

Type(s)

layout

layout :

Type(s)

aAdminModulesClasses

aAdminModulesClasses :

Type(s)

user_id

user_id :

Type(s)

aOverridenCoreActions

aOverridenCoreActions :

Type(s)

currentModuleAction

currentModuleAction :

Type(s)

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

navData :array
inherited
var

Type(s)

array