Plugin system improvements

+ piwik analytics plugin (not tested)
This commit is contained in:
RainLoop Team 2014-09-25 19:37:11 +04:00
parent 4c38993c26
commit 085095b717
11 changed files with 137 additions and 11 deletions

View file

@ -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())
{

View file

@ -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
);
}
}

View file

@ -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>