Example plugin that add a simple function
package | Default |
---|
__construct(\LimeSurvey\PluginManager\PluginManager $manager,integer $id)
todo | Add proper type hint in 3.0 |
---|---|
integer
The id for storage
checkActive(\Plugin $pluginModel): void
configIsNewVersion(): boolean
Assumes $this->config is set.
boolean
get(string $key = null,string $model = null,integer $id = null,mixed $default = null): boolean
string
string
integer
mixed
The default value to use when not was set
boolean
getDescription()
getDir(): string|null
Solution copied from http://stackoverflow.com/questions/18100689/php-dir-evaluated-runtime-late-binding
string|null
getEvent(): \LimeSurvey\PluginManager\PluginEvent
getId(): integer
Used by storage model to find settings specific to this plugin
integer
getName(): string
string
Plugin name, max length: 20.
getPluginSettings(boolean $getValues = true): array
This does not include enable / disable; a disabled plugin is never loaded.
boolean
Set to false to not get the current value for each plugin setting.
array
getStore(): \LimeSurvey\PluginManager\iPluginStorage
gT(string $sToTranslate,string $sEscapeMode = 'html',string $sLanguage = null): string
string
The message that are being translated
string
string
string
init()
log(string $message,string $level = \CLogger::LEVEL_TRACE): void
string
string
From CLogger, defaults to CLogger::LEVEL_TRACE
newValidFunctions()
publish( $fileName): string
string
readConfigFile(): boolean
todo | Could this be moved to plugin model? |
---|---|
boolean
registerCss(string $relativePathToCss,string $parentPlugin = null): void
string
string
registerScript(string $relativePathToScript,string $parentPlugin = null): void
string
string
registerSetting(string $name,array $options = array('type' => 'string'))
string
Name of the setting. The type of the setting is either a basic type or choice. The choice type is either a single or a multiple choice setting.
array
Contains parameters for the setting. The 'type' key contains the parameter type. The type is one of: string, int, float, choice. Supported keys per type: String: max-length(int), min-length(int), regex(string). Int: max(int), min(int). Float: max(float), min(float). Choice: choices(array containing values as keys and names as values), multiple(bool) Note that the values for choice will be translated.
renderPartial(string $viewfile,array $data,boolean $return = false,boolean $processOutput = false): \LimeSurvey\PluginManager\string;
string
Filename of view in views/ folder
array
boolean
boolean
\LimeSurvey\PluginManager\string;
saveNewVersion(): void
saveSettings( $settings): void
Assumes an array with valid key/value pairs is passed.
set(string $key,mixed $data,string $model = null,integer $id = null): boolean
string
mixed
string
integer
boolean
setEvent(\LimeSurvey\PluginManager\PluginEvent $event): \LimeSurvey\PluginManager\PluginBase
setLocaleComponent(): void
showConfigErrorNotification(): void
subscribe(string $event,string $function = null)
string
string
unsubscribe(string $event)
string
description :string
var |
---|
string
name :string
var |
---|
string
api :\LimeSurvey\PluginManager\LimesurveyApi
event :\LimeSurvey\PluginManager\PluginEvent
id :integer
var |
---|
integer
storage :string
var |
---|
string
store :\LimeSurvey\PluginManager\?
var |
---|
\LimeSurvey\PluginManager\?
settings :array<mixed,array>
var |
---|
array<mixed,array>
pluginManager :\LimeSurvey\PluginManager\PluginManager
config :\SimpleXMLElement|null
todo | Use ExtensionConfig |
---|---|
var |
\SimpleXMLElement|null
allowedPublicMethods :array<mixed,string>|null
Else method must be in the list. Used in public controller :
var |
---|
array<mixed,string>|null
encryptedSettings :array<mixed,string>
var |
---|
array<mixed,string>