mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +03:00
Plugin system improvements
+ piwik analytics plugin (not tested)
This commit is contained in:
parent
4c38993c26
commit
085095b717
11 changed files with 137 additions and 11 deletions
|
|
@ -295,7 +295,7 @@ class Manager
|
|||
$aMap = $oPlugin->ConfigMap();
|
||||
if (\is_array($aMap))
|
||||
{
|
||||
foreach ($aMap as /* @var $oPluginProperty \RainLoop\Plugins\Property */$oPluginProperty)
|
||||
foreach ($aMap as /* @var $oPluginProperty \RainLoop\Plugins\Property */ $oPluginProperty)
|
||||
{
|
||||
if ($oPluginProperty && $oPluginProperty->AllowedInJs())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,6 +33,11 @@ class Property
|
|||
* @var mixed
|
||||
*/
|
||||
private $mDefaultValue;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $sPlaceholder;
|
||||
|
||||
private function __construct($sName)
|
||||
{
|
||||
|
|
@ -42,6 +47,7 @@ class Property
|
|||
$this->sLabel = '';
|
||||
$this->sDesc = '';
|
||||
$this->bAllowedInJs = false;
|
||||
$this->sPlaceholder = '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -77,6 +83,18 @@ class Property
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sPlaceholder
|
||||
*
|
||||
* @return \RainLoop\Plugins\Property
|
||||
*/
|
||||
public function SetPlaceholder($sPlaceholder)
|
||||
{
|
||||
$this->sPlaceholder = $sPlaceholder;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sLabel
|
||||
|
|
@ -160,6 +178,14 @@ class Property
|
|||
{
|
||||
return $this->mDefaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function Placeholder()
|
||||
{
|
||||
return $this->sPlaceholder;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
|
|
@ -172,7 +198,8 @@ class Property
|
|||
$this->iType,
|
||||
$this->sLabel,
|
||||
$this->mDefaultValue,
|
||||
$this->sDesc
|
||||
$this->sDesc,
|
||||
$this->sPlaceholder
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,13 +4,16 @@
|
|||
</label>
|
||||
<div class="controls">
|
||||
<!-- ko if: 0 === Type || 1 === Type -->
|
||||
<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" data-bind="value: value" />
|
||||
<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
|
||||
data-bind="value: value, attr: {placeholder: placeholder}" />
|
||||
<!-- /ko -->
|
||||
<!-- ko if: 3 === Type -->
|
||||
<input type="password" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" data-bind="value: value" />
|
||||
<input type="password" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
|
||||
data-bind="value: value, attr: {placeholder: placeholder}" />
|
||||
<!-- /ko -->
|
||||
<!-- ko if: 2 === Type -->
|
||||
<textarea autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" data-bind="value: value"></textarea>
|
||||
<textarea autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
|
||||
data-bind="value: value, attr: {placeholder: placeholder}"></textarea>
|
||||
<!-- /ko -->
|
||||
<!-- ko if: 4 === Type -->
|
||||
<select data-bind="options: Default, value: value"></select>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue