PluginManagerController
extends SurveyCommonAction
in package
Survey Common Action
Tags
Table of Contents
Methods
- __construct() : mixed
- abortUploadedPlugin() : void
- activate() : void
- Activate a plugin
- configure() : mixed
- Configure for plugin
- deactivate() : void
- Deactivate plugin.
- deleteFiles() : mixed
- Delete files
- index() : void
- index() : mixed
- Overview for plugins Copied from PluginsController 2015-10-02
- init() : mixed
- Init
- installPluginFromFile() : void
- Install a plugin that has been discovered in the file system.
- installUploadedPlugin() : void
- After clicking "Install" on upload confirm page, run this action and then redirect to plugin manager start page.
- questionbar() : mixed
- Shows admin menu for question
- renderInternal() : mixed
- resetLoadError() : void
- Set load_error to 0 for plugin with id $pluginId.
- 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.
- scanFiles() : void
- Scan files in plugin folder and add them to the database.
- surveybar() : mixed
- Shows admin menu for surveys
- uninstallPlugin() : void
- Run when user click button to uninstall plugin.
- upload() : void
- Upload a plugin ZIP file.
- uploadConfirm() : void
- Show confirm page after a plugin zip archive was successfully uploaded.
- beforeSideMenuRender() : string
- Returns content from event beforeSideMenuRender
- checkDemoMode() : void
- Redirects if demo mode is set.
- checkDestDir() : void
- Redirect back if $destdir is not writable or already exists.
- checkUpdatePermission() : void
- Blocks action if user has no setting update permission.
- checkUploadEnabled() : void
- Blocks action if plugin upload is disabled.
- errorAndRedirect() : void
- Sets an error flash message and redirects to plugin manager start page.
- fetchExtraMenus() : array<string|int, ExtraMenu>
- Get extra menus from plugins that are using event beforeAdminMenuRender
- filterImportedResources() : array<string|int, mixed>
- getExtraMenus() : array<string|int, Menu>
- getInstaller() : PluginInstaller
- getPluginManagerUrl() : string
- Return URL to plugin manager index.
- 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() : string
- Rendering the subviews and views of renderWrappedTemplate
- 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
- surveysidemenu() : mixed
- Show side menu for survey view
- titlebar() : mixed
- REFACTORED in LayoutHelper.php
- updatenotification() : mixed
- Display the update notification
- 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.
Methods
__construct()
public
__construct([mixed $controller = null ][, mixed $id = null ]) : mixed
Parameters
- $controller : mixed = null
- $id : mixed = null
abortUploadedPlugin()
public
abortUploadedPlugin() : void
activate()
Activate a plugin
public
activate() : void
Tags
configure()
Configure for plugin
public
configure(int $id) : mixed
Parameters
- $id : int
deactivate()
Deactivate plugin.
public
deactivate() : void
deleteFiles()
Delete files
public
deleteFiles( $plugin) : mixed
Parameters
index()
public
index() : void
index()
Overview for plugins Copied from PluginsController 2015-10-02
public
index() : mixed
init()
Init
public
init() : mixed
installPluginFromFile()
Install a plugin that has been discovered in the file system.
public
installPluginFromFile() : void
installUploadedPlugin()
After clicking "Install" on upload confirm page, run this action and then redirect to plugin manager start page.
public
installUploadedPlugin() : void
questionbar()
Shows admin menu for question
public
questionbar(array<string|int, mixed> $aData) : mixed
Parameters
- $aData : array<string|int, mixed>
Tags
renderInternal()
public
renderInternal(string $_viewFile_[, mixed $_data_ = null ][, mixed $_return_ = false ]) : mixed
Parameters
- $_viewFile_ : string
- $_data_ : mixed = null
- $_return_ : mixed = false
Tags
resetLoadError()
Set load_error to 0 for plugin with id $pluginId.
public
resetLoadError(int $pluginId) : void
This makes it possible to try to load the plugin again, if a fix for previous load error has been implemented.
Parameters
- $pluginId : int
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
boolscanFiles()
Scan files in plugin folder and add them to the database.
public
scanFiles() : void
surveybar()
Shows admin menu for surveys
public
surveybar(array<string|int, mixed> $aData) : mixed
Parameters
- $aData : array<string|int, mixed>
Tags
uninstallPlugin()
Run when user click button to uninstall plugin.
public
uninstallPlugin() : void
upload()
Upload a plugin ZIP file.
public
upload() : void
uploadConfirm()
Show confirm page after a plugin zip archive was successfully uploaded.
public
uploadConfirm() : void
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
stringcheckDemoMode()
Redirects if demo mode is set.
protected
checkDemoMode() : void
Tags
checkDestDir()
Redirect back if $destdir is not writable or already exists.
protected
checkDestDir(string $destdir, string $sNewDirectoryName) : void
Parameters
- $destdir : string
- $sNewDirectoryName : string
Tags
checkUpdatePermission()
Blocks action if user has no setting update permission.
protected
checkUpdatePermission() : void
checkUploadEnabled()
Blocks action if plugin upload is disabled.
protected
checkUploadEnabled() : void
errorAndRedirect()
Sets an error flash message and redirects to plugin manager start page.
protected
errorAndRedirect(string $msg) : void
Parameters
- $msg : string
-
Error message.
fetchExtraMenus()
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>filterImportedResources()
protected
filterImportedResources(string $extractdir, string $destdir) : array<string|int, mixed>
Parameters
- $extractdir : string
- $destdir : string
Tags
Return values
array<string|int, mixed>getExtraMenus()
protected
getExtraMenus() : array<string|int, Menu>
Return values
array<string|int, Menu>getInstaller()
protected
getInstaller() : PluginInstaller
Tags
Return values
PluginInstallergetPluginManagerUrl()
Return URL to plugin manager index.
protected
getPluginManagerUrl([string $sa = null ][, mixed $extraParams = [] ]) : string
.
Parameters
- $sa : string = null
-
Controller subaction.
- $extraParams : mixed = []
Return values
stringlistquestiongroups()
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()
Rendering the subviews and views of renderWrappedTemplate
protected
renderCentralContents(string $sAction, array<string|int, mixed>|string $aViewUrls[, array<string|int, mixed> $aData = [] ]) : string
Parameters
- $sAction : string
- $aViewUrls : array<string|int, mixed>|string
- $aData : array<string|int, mixed> = []
Return values
stringrenderJSON()
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 = 'pluginmanager' ][, string $aViewUrls = [] ][, array<string|int, mixed> $aData = [] ][, mixed $sRenderFile = false ]) : mixed
Parameters
- $sAction : string = 'pluginmanager'
-
Current action, the folder to fetch views from
- $aViewUrls : string = []
-
View url(s)
- $aData : array<string|int, mixed> = []
-
Data to be passed on. Optional.
- $sRenderFile : mixed = false
-
File to be rendered as a layout. Optional.
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
surveysidemenu()
Show side menu for survey view
protected
surveysidemenu(array<string|int, mixed> $aData) : mixed
REFACTORED in LayoutHelper.php
Parameters
- $aData : array<string|int, mixed>
-
all the needed data
titlebar()
REFACTORED in LayoutHelper.php
protected
titlebar( $aData) : mixed
Parameters
Tags
updatenotification()
Display the update notification
protected
updatenotification() : mixed
REFACTORED (in LayoutHelper.php)
Tags
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