GlobalSettings
extends GlobalSettings
in package
GlobalSettings Controller
Table of Contents
Properties
- $myNewParam : mixed
Methods
- __construct() : mixed
- clearAssetsAndCache() : void
- Clears assets and cache directories.
- getCreateMenu() : Menu
- REFACTORED in LayoutHelper (necessary to have it here, until all controllers have been refactored...)
- getStorageData() : void
- Loaded by Ajax when user clicks "Calculate storage".
- HelloWorld() : array<string|int, mixed>
- A brand new helloworld function for GlobalSettings !
- index() : void
- Shows the index page
- index() : void
- renderInternal() : mixed
- resetFailedLoginParticipants() : void
- Resets (deletes) failed login attempts for participants
- run() : mixed
- Action classes require them to have a run method. We reroute it to index if called.
- runWithParams() : bool
- Override runWithParams() implementation in CAction to help us parse requests with subactions.
- sendTestEmail() : mixed
- Send Test Email
- sendTestEmailConfirmation() : mixed
- Send Test Email Confirmation
- showphpinfo() : mixed
- Show PHP Info
- surveysettingmenues() : mixed
- Survey Setting Menus
- surveySettings() : mixed
- Update global survey settings
- beforeSideMenuRender() : string
- Returns content from event beforeSideMenuRender
- fetchExtraMenus() : array<string|int, ExtraMenu>
- Get extra menus from plugins that are using event beforeAdminMenuRender
- getSurveyFolderStorage() : array<string|int, mixed>
- Get storage of folder storage.
- getTemplateFolderStorage() : array<string|int, mixed>
- Get storage of template folders.
- listquestiongroups() : mixed
- REFACTORED in LayoutHelper
- listquestions() : mixed
- REFACTORED in LayoutHelper
- notifications() : mixed
- Display notifications
- nsurveysummary() : mixed
- REFACTORED in LayoutHelper
- organizequestionbar() : mixed
- Render the save/cancel bar for Organize question groups/questions
- renderCentralContents() : mixed
- Override Survey_Common_Action::renderCentralContents
- renderJSON() : void
- Method to render an array as a json document
- renderQuickmenu() : string
- Render the quick-menu that is shown when side-menu is hidden.
- renderWrappedTemplate() : mixed
- Renders template(s) wrapped in header and footer
- requirePostRequest() : mixed
- Validates that the request method is POST.
- route() : mixed
- Routes the action into correct subaction
- showadminmenu() : string
- showadminmenu() function returns html text for the administration button bar
- showHeaders() : mixed
- Header
- titlebar() : mixed
- REFACTORED in LayoutHelper.php
- updatenotification() : string|void
- Display the update notification
- validateIpAddresses() : array<string, string>
- Splits list of IP addresses into lists of valid and invalid addresses
- addPseudoParams() : array<string|int, mixed>
- 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.
- checkSettings() : mixed
- Check Settings
- displaySettings() : mixed
- Displays the settings.
- saveSettings() : mixed
- Save Settings
- sendEmailAndShowResult() : mixed
- Send Email and show result
Properties
$myNewParam
public
mixed
$myNewParam
= "This was not in global setting core controller"
Methods
__construct()
public
__construct([mixed $controller = null ][, mixed $id = null ]) : mixed
Parameters
- $controller : mixed = null
- $id : mixed = null
clearAssetsAndCache()
Clears assets and cache directories.
public
clearAssetsAndCache() : void
This function is used to refresh the assets and cache directories when necessary. It should only be accessible to people who have at least the permission to create or update themes.
Tags
getCreateMenu()
REFACTORED in LayoutHelper (necessary to have it here, until all controllers have been refactored...)
public
getCreateMenu() : Menu
Returns extra menu for the new create process (including create, copy, and import survey).
Return values
MenugetStorageData()
Loaded by Ajax when user clicks "Calculate storage".
public
getStorageData() : void
HelloWorld()
A brand new helloworld function for GlobalSettings !
public
HelloWorld([string $sWho = "World" ]) : array<string|int, mixed>
You can reach it via: index.php?r=admin/globalsettings/sa/HelloWorld/
Parameters
- $sWho : string = "World"
-
who to say hello
Return values
array<string|int, mixed> —Populated parameters ready to be rendered inside the admin interface
index()
Shows the index page
public
index() : void
Tags
index()
public
index() : void
renderInternal()
public
renderInternal(string $_viewFile_[, mixed $_data_ = null ][, mixed $_return_ = false ]) : mixed
Parameters
- $_viewFile_ : string
- $_data_ : mixed = null
- $_return_ : mixed = false
Tags
resetFailedLoginParticipants()
Resets (deletes) failed login attempts for participants
public
resetFailedLoginParticipants() : void
run()
Action classes require them to have a run method. We reroute it to index if called.
public
run() : mixed
runWithParams()
Override runWithParams() implementation in CAction to help us parse requests with subactions.
public
runWithParams(array<string|int, mixed> $params) : bool
Parameters
- $params : array<string|int, mixed>
-
URL Parameters
Return values
boolsendTestEmail()
Send Test Email
public
sendTestEmail() : mixed
sendTestEmailConfirmation()
Send Test Email Confirmation
public
sendTestEmailConfirmation() : mixed
showphpinfo()
Show PHP Info
public
showphpinfo() : mixed
surveysettingmenues()
Survey Setting Menus
public
surveysettingmenues() : mixed
surveySettings()
Update global survey settings
public
surveySettings() : mixed
beforeSideMenuRender()
Returns content from event beforeSideMenuRender
protected
beforeSideMenuRender(array<string|int, mixed> $aData) : string
REFACTORED in LayoutHelper
Parameters
- $aData : array<string|int, mixed>
Return values
stringfetchExtraMenus()
Get extra menus from plugins that are using event beforeAdminMenuRender
protected
fetchExtraMenus(array<string|int, mixed> $aData) : array<string|int, ExtraMenu>
Parameters
- $aData : array<string|int, mixed>
Return values
array<string|int, ExtraMenu>getSurveyFolderStorage()
Get storage of folder storage.
protected
getSurveyFolderStorage(string $uploaddir, int $decimals) : array<string|int, mixed>
Parameters
- $uploaddir : string
- $decimals : int
Return values
array<string|int, mixed>getTemplateFolderStorage()
Get storage of template folders.
protected
getTemplateFolderStorage(string $uploaddir, int $decimals) : array<string|int, mixed>
Parameters
- $uploaddir : string
- $decimals : int
Return values
array<string|int, mixed>listquestiongroups()
REFACTORED in LayoutHelper
protected
listquestiongroups(array<string|int, mixed> $aData) : mixed
listquestion groups
Parameters
- $aData : array<string|int, mixed>
listquestions()
REFACTORED in LayoutHelper
protected
listquestions( $aData) : mixed
Parameters
Tags
notifications()
Display notifications
protected
notifications() : mixed
- REFACTORED (in LayoutHelper.php)
nsurveysummary()
REFACTORED in LayoutHelper
protected
nsurveysummary(array<string|int, mixed> $aData) : mixed
Survey summary
Parameters
- $aData : array<string|int, mixed>
organizequestionbar()
Render the save/cancel bar for Organize question groups/questions
protected
organizequestionbar(array<string|int, mixed> $aData) : mixed
REFACTORED in LayoutHelper
Parameters
- $aData : array<string|int, mixed>
Tags
renderCentralContents()
Override Survey_Common_Action::renderCentralContents
protected
renderCentralContents(mixed $sAction, mixed $aViewUrls[, mixed $aData = [] ]) : mixed
If you don't understand what it does, just copy / paste it in your own admin module We let it here just in case you're trying to do something different
NOTE: you just need to copy/paste here any view called by the core GlobalSettings to override it.
Parameters
- $sAction : mixed
- $aViewUrls : mixed
- $aData : mixed = []
renderJSON()
Method to render an array as a json document
protected
renderJSON(array<string|int, mixed> $aData[, mixed $success = true ]) : void
REFACTORED in LSBaseController (this one called by a lot of actions in different controllers)
Parameters
- $aData : array<string|int, mixed>
- $success : mixed = true
renderQuickmenu()
Render the quick-menu that is shown when side-menu is hidden.
protected
renderQuickmenu(array<string|int, mixed> $aData) : string
REFACTORED in LayoutHelper
Only show home-icon for now.
Add support for plugin to attach icon elements using event afterQuickMenuLoad
Parameters
- $aData : array<string|int, mixed>
Tags
Return values
stringrenderWrappedTemplate()
Renders template(s) wrapped in header and footer
protected
renderWrappedTemplate([string $sAction = '' ][, string $aViewUrls = array() ][, array<string|int, mixed> $aData = array() ][, mixed $sRenderFile = false ]) : mixed
Parameters
- $sAction : string = ''
-
Current action, the folder to fetch views from
- $aViewUrls : string = array()
-
View url(s)
- $aData : array<string|int, mixed> = array()
-
Data to be passed on. Optional.
- $sRenderFile : mixed = false
requirePostRequest()
Validates that the request method is POST.
protected
requirePostRequest() : mixed
This is intended to be used on subactions. When possible (eg. when refactoring a SurveyCommonAction into an actual controller), use 'postOnly' filter instead.
Tags
route()
Routes the action into correct subaction
protected
route(string $sa, array<string|int, string> $get_vars) : mixed
Parameters
- $sa : string
- $get_vars : array<string|int, string>
Tags
showadminmenu()
showadminmenu() function returns html text for the administration button bar
protected
showadminmenu( $aData) : string
REFACTORED (in LayoutHelper.php)
Parameters
Tags
Return values
stringshowHeaders()
Header
protected
showHeaders(array<string|int, mixed> $aData[, mixed $sendHTTPHeader = true ]) : mixed
- REFACTORED (in LayoutHelper.php)
Parameters
- $aData : array<string|int, mixed>
- $sendHTTPHeader : mixed = true
titlebar()
REFACTORED in LayoutHelper.php
protected
titlebar( $aData) : mixed
Parameters
Tags
updatenotification()
Display the update notification
protected
updatenotification() : string|void
REFACTORED (in LayoutHelper.php)
Passes security_update_available and stability_labels to the notification view.
Tags
Return values
string|void —Rendered notification HTML, or void if no update
validateIpAddresses()
Splits list of IP addresses into lists of valid and invalid addresses
protected
validateIpAddresses(string $ipList) : array<string, string>
Parameters
- $ipList : string
-
list of IP addresses to validate, separated by comma or new line
Return values
array<string, string> —an array of the form ['valid' => validlist, 'invalid' => invalidlist] where each list is a comma separated string.
addPseudoParams()
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.
private
addPseudoParams(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
-
Parameters to parse and populate
Tags
Return values
array<string|int, mixed> —Populated parameters
checkSettings()
Check Settings
private
checkSettings() : mixed
displaySettings()
Displays the settings.
private
displaySettings() : mixed
Tags
saveSettings()
Save Settings
private
saveSettings() : mixed
sendEmailAndShowResult()
Send Email and show result
private
sendEmailAndShowResult(string $body, string $sSubject, string $sTo, string $sFrom) : mixed
Parameters
- $body : string
- $sSubject : string
- $sTo : string
- $sFrom : string