mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 22:47:03 +03:00
Privacy/GDPR friendly version (removed: Social, Gravatar, Facebook, Google, Twitter, DropBox, OwnCloud)
Also removed: POP3, OAuth2 and update feature Added: admin password_hash/password_verify Requires: PHP 7.3+ Replaced: CRLF with LF Replaced: pclZip with ZipArchive
This commit is contained in:
parent
15ceddc202
commit
2cada68f41
293 changed files with 23728 additions and 85420 deletions
|
|
@ -85,73 +85,50 @@ abstract class AbstractPlugin
|
|||
return $this->oPluginManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function Path()
|
||||
public function Path() : string
|
||||
{
|
||||
return $this->sPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function Name()
|
||||
public function Name() : string
|
||||
{
|
||||
return $this->sName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function Version()
|
||||
public function Version() : string
|
||||
{
|
||||
return $this->sVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool | null $bLangs = null
|
||||
* @return bool
|
||||
*/
|
||||
public function UseLangs($bLangs = null)
|
||||
public function UseLangs(?bool $bLangs = null) : bool
|
||||
{
|
||||
if (null !== $bLangs)
|
||||
{
|
||||
$this->bLangs = (bool) $bLangs;
|
||||
$this->bLangs = $bLangs;
|
||||
}
|
||||
|
||||
return $this->bLangs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function configMapping()
|
||||
protected function configMapping() : array
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function Hash()
|
||||
public function Hash() : string
|
||||
{
|
||||
return \md5($this->sName.'@'.$this->sVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function Supported()
|
||||
public function Supported() : string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @final
|
||||
* @return array
|
||||
*/
|
||||
final public function ConfigMap()
|
||||
final public function ConfigMap() : array
|
||||
{
|
||||
if (null === $this->aConfigMap)
|
||||
{
|
||||
|
|
@ -165,36 +142,21 @@ abstract class AbstractPlugin
|
|||
return $this->aConfigMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sPath
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function SetPath($sPath)
|
||||
public function SetPath(string $sPath) : self
|
||||
{
|
||||
$this->sPath = $sPath;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sName
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function SetName($sName)
|
||||
public function SetName(string $sName) : self
|
||||
{
|
||||
$this->sName = $sName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sVersion
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function SetVersion($sVersion)
|
||||
public function SetVersion(string $sVersion) : self
|
||||
{
|
||||
if (0 < \strlen($sVersion))
|
||||
{
|
||||
|
|
@ -204,24 +166,14 @@ abstract class AbstractPlugin
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \RainLoop\Plugins\Manager $oPluginManager
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function SetPluginManager(\RainLoop\Plugins\Manager $oPluginManager)
|
||||
public function SetPluginManager(\RainLoop\Plugins\Manager $oPluginManager) : self
|
||||
{
|
||||
$this->oPluginManager = $oPluginManager;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \RainLoop\Config\Plugin $oPluginConfig
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function SetPluginConfig(\RainLoop\Config\Plugin $oPluginConfig)
|
||||
public function SetPluginConfig(\RainLoop\Config\Plugin $oPluginConfig) : self
|
||||
{
|
||||
$this->oPluginConfig = $oPluginConfig;
|
||||
|
||||
|
|
@ -245,24 +197,14 @@ abstract class AbstractPlugin
|
|||
}
|
||||
|
||||
/**
|
||||
* @param bool $bAdmin
|
||||
* @param bool $bAuth
|
||||
* @param array $aConfig
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function FilterAppDataPluginSection($bAdmin, $bAuth, &$aConfig)
|
||||
public function FilterAppDataPluginSection(bool $bAdmin, bool $bAuth, array &$aConfig)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sHookName
|
||||
* @param string $sFunctionName
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
protected function addHook($sHookName, $sFunctionName)
|
||||
protected function addHook(string $sHookName, string $sFunctionName) : self
|
||||
{
|
||||
if ($this->oPluginManager)
|
||||
{
|
||||
|
|
@ -272,13 +214,7 @@ abstract class AbstractPlugin
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sFile
|
||||
* @param bool $bAdminScope = false
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
protected function addJs($sFile, $bAdminScope = false)
|
||||
protected function addJs(string $sFile, bool $bAdminScope = false) : self
|
||||
{
|
||||
if ($this->oPluginManager)
|
||||
{
|
||||
|
|
@ -288,13 +224,7 @@ abstract class AbstractPlugin
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sFile
|
||||
* @param bool $bAdminScope = false
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
protected function addTemplate($sFile, $bAdminScope = false)
|
||||
protected function addTemplate(string $sFile, bool $bAdminScope = false) : self
|
||||
{
|
||||
if ($this->oPluginManager)
|
||||
{
|
||||
|
|
@ -304,13 +234,7 @@ abstract class AbstractPlugin
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sFile
|
||||
* @param bool $bAdminScope = false
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
protected function replaceTemplate($sFile, $bAdminScope = false)
|
||||
protected function replaceTemplate(string $sFile, bool $bAdminScope = false) : self
|
||||
{
|
||||
if ($this->oPluginManager)
|
||||
{
|
||||
|
|
@ -320,13 +244,7 @@ abstract class AbstractPlugin
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sActionName
|
||||
* @param string $sFunctionName
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
protected function addPartHook($sActionName, $sFunctionName)
|
||||
protected function addPartHook(string $sActionName, string $sFunctionName) : self
|
||||
{
|
||||
if ($this->oPluginManager)
|
||||
{
|
||||
|
|
@ -336,13 +254,7 @@ abstract class AbstractPlugin
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sActionName
|
||||
* @param string $sFunctionName
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
protected function addAjaxHook($sActionName, $sFunctionName)
|
||||
protected function addAjaxHook(string $sActionName, string $sFunctionName) : self
|
||||
{
|
||||
if ($this->oPluginManager)
|
||||
{
|
||||
|
|
@ -352,15 +264,7 @@ abstract class AbstractPlugin
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sName
|
||||
* @param string $sPlace
|
||||
* @param string $sHtml
|
||||
* @param bool $bPrepend = false
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
protected function addTemplateHook($sName, $sPlace, $sLocalTemplateName, $bPrepend = false)
|
||||
protected function addTemplateHook(string $sName, string $sPlace, string $sLocalTemplateName, bool $bPrepend = false) : self
|
||||
{
|
||||
if ($this->oPluginManager)
|
||||
{
|
||||
|
|
@ -371,15 +275,7 @@ abstract class AbstractPlugin
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sName
|
||||
* @param string $sPlace
|
||||
* @param string $sHtml
|
||||
* @param bool $bPrepend = false
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
protected function ajaxResponse($sFunctionName, $aData)
|
||||
protected function ajaxResponse(string $sFunctionName, array $aData) : self
|
||||
{
|
||||
if ($this->oPluginManager)
|
||||
{
|
||||
|
|
@ -391,12 +287,11 @@ abstract class AbstractPlugin
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $sKey
|
||||
* @param mixed $mDefault = null
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function ajaxParam($sKey, $mDefault = null)
|
||||
public function ajaxParam(string $sKey, $mDefault = null)
|
||||
{
|
||||
if ($this->oPluginManager)
|
||||
{
|
||||
|
|
@ -406,10 +301,7 @@ abstract class AbstractPlugin
|
|||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getUserSettings()
|
||||
public function getUserSettings() : array
|
||||
{
|
||||
if ($this->oPluginManager)
|
||||
{
|
||||
|
|
@ -419,12 +311,7 @@ abstract class AbstractPlugin
|
|||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $aSettings
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function saveUserSettings($aSettings)
|
||||
public function saveUserSettings(array $aSettings) : bool
|
||||
{
|
||||
if ($this->oPluginManager && \is_array($aSettings))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,17 +11,10 @@ class Helper
|
|||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sString
|
||||
* @param string $sWildcardValues
|
||||
* @param string $sFoundedValue = ''
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
static public function ValidateWildcardValues($sString, $sWildcardValues, &$sFoundedValue = '')
|
||||
static public function ValidateWildcardValues(string $sString, string $sWildcardValues, string &$sFoundedValue) : bool
|
||||
{
|
||||
$sFoundedValue = '';
|
||||
|
||||
|
||||
$sString = \trim($sString);
|
||||
if ('' === $sString)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -64,9 +64,6 @@ class Manager
|
|||
*/
|
||||
private $oLogger;
|
||||
|
||||
/**
|
||||
* @param \RainLoop\Actions $oActions
|
||||
*/
|
||||
public function __construct(\RainLoop\Actions $oActions)
|
||||
{
|
||||
$this->oLogger = null;
|
||||
|
|
@ -112,12 +109,7 @@ class Manager
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sName
|
||||
*
|
||||
* @return \RainLoop\Plugins\AbstractPlugin|null
|
||||
*/
|
||||
public function CreatePluginByName($sName)
|
||||
public function CreatePluginByName(string $sName) : ?\RainLoop\Plugins\AbstractPlugin
|
||||
{
|
||||
$oPlugin = null;
|
||||
if (\preg_match('/^[a-z0-9\-]+$/', $sName) &&
|
||||
|
|
@ -154,10 +146,7 @@ class Manager
|
|||
return $oPlugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function InstalledPlugins()
|
||||
public function InstalledPlugins() : array
|
||||
{
|
||||
$aList = array();
|
||||
|
||||
|
|
@ -187,12 +176,7 @@ class Manager
|
|||
return $aList;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sFolderName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function convertPluginFolderNameToClassName($sFolderName)
|
||||
public function convertPluginFolderNameToClassName(string $sFolderName) : string
|
||||
{
|
||||
$aParts = \array_map('ucfirst', \array_map('strtolower',
|
||||
\explode(' ', \preg_replace('/[^a-z0-9]+/', ' ', $sFolderName))));
|
||||
|
|
@ -200,18 +184,12 @@ class Manager
|
|||
return \implode($aParts).'Plugin';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \RainLoop\Actions
|
||||
*/
|
||||
public function Actions()
|
||||
public function Actions() : \RainLoop\Actions
|
||||
{
|
||||
return $this->oActions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function Hash()
|
||||
public function Hash() : string
|
||||
{
|
||||
$sResult = \md5(APP_VERSION);
|
||||
foreach ($this->aPlugins as $oPlugin)
|
||||
|
|
@ -222,12 +200,7 @@ class Manager
|
|||
return $sResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $bAdminScope = false
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function HaveJs($bAdminScope = false)
|
||||
public function HaveJs(bool $bAdminScope = false) : bool
|
||||
{
|
||||
$bResult = false;
|
||||
|
||||
|
|
@ -239,12 +212,7 @@ class Manager
|
|||
return $bResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $bAdminScope = false
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function CompileJs($bAdminScope = false)
|
||||
public function CompileJs(bool $bAdminScope = false) : string
|
||||
{
|
||||
$aResult = array();
|
||||
if ($this->bIsEnabled)
|
||||
|
|
@ -264,21 +232,13 @@ class Manager
|
|||
|
||||
/**
|
||||
* @todo
|
||||
* @param bool $bAdminScope = false
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function CompileCss($bAdminScope = false)
|
||||
public function CompileCss(bool $bAdminScope = false) : string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $aList
|
||||
* @param bool $bAdminScope = false
|
||||
* @return string
|
||||
*/
|
||||
public function CompileTemplate(&$aList, $bAdminScope = false)
|
||||
public function CompileTemplate(array &$aList, bool $bAdminScope = false) : string
|
||||
{
|
||||
if ($this->bIsEnabled)
|
||||
{
|
||||
|
|
@ -294,14 +254,7 @@ class Manager
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $bAdmin
|
||||
* @param array $aAppData
|
||||
* @param \RainLoop\Model\Account|null $oAccount = null
|
||||
*
|
||||
* @return \RainLoop\Plugins\Manager
|
||||
*/
|
||||
public function InitAppData($bAdmin, &$aAppData, $oAccount = null)
|
||||
public function InitAppData(bool $bAdmin, array &$aAppData, ?\RainLoop\Model\Account $oAccount = null) : self
|
||||
{
|
||||
if ($this->bIsEnabled && isset($aAppData['Plugins']) && \is_array($aAppData['Plugins']))
|
||||
{
|
||||
|
|
@ -348,12 +301,9 @@ class Manager
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $sHookName
|
||||
* @param mixed $mCallbak
|
||||
*
|
||||
* @return \RainLoop\Plugins\Manager
|
||||
*/
|
||||
public function AddHook($sHookName, $mCallbak)
|
||||
public function AddHook(string $sHookName, $mCallbak) : self
|
||||
{
|
||||
if ($this->bIsEnabled && \is_callable($mCallbak))
|
||||
{
|
||||
|
|
@ -368,13 +318,7 @@ class Manager
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sFile
|
||||
* @param bool $bAdminScope = false
|
||||
*
|
||||
* @return \RainLoop\Plugins\Manager
|
||||
*/
|
||||
public function AddJs($sFile, $bAdminScope = false)
|
||||
public function AddJs(string $sFile, bool $bAdminScope = false) : self
|
||||
{
|
||||
if ($this->bIsEnabled)
|
||||
{
|
||||
|
|
@ -391,13 +335,7 @@ class Manager
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sFile
|
||||
* @param bool $bAdminScope = false
|
||||
*
|
||||
* @return \RainLoop\Plugins\Manager
|
||||
*/
|
||||
public function AddTemplate($sFile, $bAdminScope = false)
|
||||
public function AddTemplate(string $sFile, bool $bAdminScope = false) : self
|
||||
{
|
||||
if ($this->bIsEnabled)
|
||||
{
|
||||
|
|
@ -414,14 +352,7 @@ class Manager
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sHookName
|
||||
* @param array $aArg = array()
|
||||
* @param bool $bLogHook = true
|
||||
*
|
||||
* @return \RainLoop\Plugins\Manager
|
||||
*/
|
||||
public function RunHook($sHookName, $aArg = array(), $bLogHook = true)
|
||||
public function RunHook(string $sHookName, array $aArg = array(), bool $bLogHook = true) : self
|
||||
{
|
||||
if ($this->bIsEnabled)
|
||||
{
|
||||
|
|
@ -443,12 +374,9 @@ class Manager
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $sActionName
|
||||
* @param mixed $mCallbak
|
||||
*
|
||||
* @return \RainLoop\Plugins\Manager
|
||||
*/
|
||||
public function AddAdditionalPartAction($sActionName, $mCallbak)
|
||||
public function AddAdditionalPartAction(string $sActionName, $mCallbak) : self
|
||||
{
|
||||
if ($this->bIsEnabled && \is_callable($mCallbak))
|
||||
{
|
||||
|
|
@ -464,13 +392,7 @@ class Manager
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sActionName
|
||||
* @param array $aParts = array()
|
||||
*
|
||||
* @return \RainLoop\Plugins\Manager
|
||||
*/
|
||||
public function RunAdditionalPart($sActionName, $aParts = array())
|
||||
public function RunAdditionalPart(string $sActionName, array $aParts = array()) : self
|
||||
{
|
||||
$bResult = false;
|
||||
if ($this->bIsEnabled)
|
||||
|
|
@ -492,15 +414,7 @@ class Manager
|
|||
return $bResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sName
|
||||
* @param string $sPlace
|
||||
* @param string $sHtml
|
||||
* @param bool $bPrepend = false
|
||||
*
|
||||
* @return \RainLoop\Plugins\Manager
|
||||
*/
|
||||
public function AddProcessTemplateAction($sName, $sPlace, $sHtml, $bPrepend = false)
|
||||
public function AddProcessTemplateAction(string $sName, string $sPlace, string $sHtml, bool $bPrepend = false) : self
|
||||
{
|
||||
if ($this->bIsEnabled)
|
||||
{
|
||||
|
|
@ -528,12 +442,9 @@ class Manager
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $sActionName
|
||||
* @param mixed $mCallback
|
||||
*
|
||||
* @return \RainLoop\Plugins\Manager
|
||||
*/
|
||||
public function AddAdditionalAjaxAction($sActionName, $mCallback)
|
||||
public function AddAdditionalAjaxAction(string $sActionName, $mCallback) : self
|
||||
{
|
||||
if ($this->bIsEnabled && \is_callable($mCallback) && 0 < \strlen($sActionName))
|
||||
{
|
||||
|
|
@ -548,22 +459,15 @@ class Manager
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sActionName
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function HasAdditionalAjax($sActionName)
|
||||
public function HasAdditionalAjax(string $sActionName) : bool
|
||||
{
|
||||
return $this->bIsEnabled && isset($this->aAdditionalAjax[$sActionName]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sActionName
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function RunAdditionalAjax($sActionName)
|
||||
public function RunAdditionalAjax(string $sActionName)
|
||||
{
|
||||
if ($this->bIsEnabled)
|
||||
{
|
||||
|
|
@ -577,22 +481,16 @@ class Manager
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $sFunctionName
|
||||
* @param mixed $mData
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function AjaxResponseHelper($sFunctionName, $mData)
|
||||
public function AjaxResponseHelper(string $sFunctionName, $mData)
|
||||
{
|
||||
return $this->oActions->DefaultResponse($sFunctionName, $mData);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sPluginName
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function GetUserPluginSettings($sPluginName)
|
||||
public function GetUserPluginSettings(string $sPluginName) : array
|
||||
{
|
||||
$oAccount = $this->oActions->GetAccount();
|
||||
if ($oAccount)
|
||||
|
|
@ -611,13 +509,7 @@ class Manager
|
|||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sPluginName
|
||||
* @param array $aSettings
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function SaveUserPluginSettings($sPluginName, $aSettings)
|
||||
public function SaveUserPluginSettings(string $sPluginName, array $aSettings) : bool
|
||||
{
|
||||
$oAccount = $this->oActions->GetAccount();
|
||||
if ($oAccount && \is_array($aSettings))
|
||||
|
|
@ -652,13 +544,7 @@ class Manager
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sLang
|
||||
* @param array $sActionName
|
||||
*
|
||||
* @return \RainLoop\Plugins\Manager
|
||||
*/
|
||||
public function ReadLang($sLang, &$aLang)
|
||||
public function ReadLang(string $sLang, array &$aLang) : self
|
||||
{
|
||||
if ($this->bIsEnabled)
|
||||
{
|
||||
|
|
@ -680,13 +566,7 @@ class Manager
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sName
|
||||
* @param string $sHtml
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function ProcessTemplate($sName, $sHtml)
|
||||
public function ProcessTemplate(string $sName, string $sHtml) : string
|
||||
{
|
||||
if (isset($this->aProcessTemplate[$sName]))
|
||||
{
|
||||
|
|
@ -705,18 +585,12 @@ class Manager
|
|||
return $sHtml;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function bIsEnabled()
|
||||
public function bIsEnabled() : bool
|
||||
{
|
||||
return $this->bIsEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function Count()
|
||||
public function Count() : int
|
||||
{
|
||||
return $this->bIsEnabled ? \count($this->aPlugins) : 0;
|
||||
}
|
||||
|
|
@ -724,11 +598,9 @@ class Manager
|
|||
/**
|
||||
* @param \MailSo\Log\Logger $oLogger
|
||||
*
|
||||
* @return \RainLoop\Plugins\Manager
|
||||
*
|
||||
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
|
||||
*/
|
||||
public function SetLogger($oLogger)
|
||||
public function SetLogger($oLogger) : self
|
||||
{
|
||||
if (!($oLogger instanceof \MailSo\Log\Logger))
|
||||
{
|
||||
|
|
@ -741,12 +613,9 @@ class Manager
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $sDesc
|
||||
* @param int $iType = \MailSo\Log\Enumerations\Type::INFO
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function WriteLog($sDesc, $iType = \MailSo\Log\Enumerations\Type::INFO)
|
||||
public function WriteLog(string $sDesc, int $iType = \MailSo\Log\Enumerations\Type::INFO)
|
||||
{
|
||||
if ($this->oLogger)
|
||||
{
|
||||
|
|
@ -755,12 +624,9 @@ class Manager
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $sDesc
|
||||
* @param int $iType = \MailSo\Log\Enumerations\Type::INFO
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function WriteException($sDesc, $iType = \MailSo\Log\Enumerations\Type::INFO)
|
||||
public function WriteException(string $sDesc, int $iType = \MailSo\Log\Enumerations\Type::INFO)
|
||||
{
|
||||
if ($this->oLogger)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ class Property
|
|||
* @var string
|
||||
*/
|
||||
private $sName;
|
||||
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
|
|
@ -18,7 +18,7 @@ class Property
|
|||
* @var string
|
||||
*/
|
||||
private $sDesc;
|
||||
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
@ -28,7 +28,7 @@ class Property
|
|||
* @var bool
|
||||
*/
|
||||
private $bAllowedInJs;
|
||||
|
||||
|
||||
/**
|
||||
* @var mixed
|
||||
*/
|
||||
|
|
@ -38,8 +38,8 @@ class Property
|
|||
* @var string
|
||||
*/
|
||||
private $sPlaceholder;
|
||||
|
||||
private function __construct($sName)
|
||||
|
||||
private function __construct(string $sName)
|
||||
{
|
||||
$this->sName = $sName;
|
||||
$this->iType = \RainLoop\Enumerations\PluginPropertyType::STRING;
|
||||
|
|
@ -49,128 +49,82 @@ class Property
|
|||
$this->bAllowedInJs = false;
|
||||
$this->sPlaceholder = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sName
|
||||
*
|
||||
* @return \RainLoop\Plugins\Property
|
||||
*/
|
||||
public static function NewInstance($sName)
|
||||
|
||||
public static function NewInstance(string $sName) : self
|
||||
{
|
||||
return new self($sName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $iType
|
||||
*
|
||||
* @return \RainLoop\Plugins\Property
|
||||
*/
|
||||
public function SetType($iType)
|
||||
|
||||
public function SetType(int $iType) : self
|
||||
{
|
||||
$this->iType = (int) $iType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $mDefaultValue
|
||||
*
|
||||
* @return \RainLoop\Plugins\Property
|
||||
*/
|
||||
public function SetDefaultValue($mDefaultValue)
|
||||
{
|
||||
$this->mDefaultValue = $mDefaultValue;
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sPlaceholder
|
||||
*
|
||||
* @return \RainLoop\Plugins\Property
|
||||
* @param mixed $mDefaultValue
|
||||
*/
|
||||
public function SetPlaceholder($sPlaceholder)
|
||||
public function SetDefaultValue($mDefaultValue) : self
|
||||
{
|
||||
$this->mDefaultValue = $mDefaultValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function SetPlaceholder(string $sPlaceholder) : self
|
||||
{
|
||||
$this->sPlaceholder = $sPlaceholder;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sLabel
|
||||
*
|
||||
* @return \RainLoop\Plugins\Property
|
||||
*/
|
||||
public function SetLabel($sLabel)
|
||||
|
||||
public function SetLabel(string $sLabel) : self
|
||||
{
|
||||
$this->sLabel = $sLabel;
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sDesc
|
||||
*
|
||||
* @return \RainLoop\Plugins\Property
|
||||
*/
|
||||
public function SetDescription($sDesc)
|
||||
public function SetDescription(string $sDesc) : self
|
||||
{
|
||||
$this->sDesc = $sDesc;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $bValue = true
|
||||
* @return \RainLoop\Plugins\Property
|
||||
*/
|
||||
public function SetAllowedInJs($bValue = true)
|
||||
public function SetAllowedInJs(bool $bValue = true) : self
|
||||
{
|
||||
$this->bAllowedInJs = !!$bValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function Name()
|
||||
|
||||
public function Name() : string
|
||||
{
|
||||
return $this->sName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function AllowedInJs()
|
||||
public function AllowedInJs() : bool
|
||||
{
|
||||
return $this->bAllowedInJs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function Description()
|
||||
|
||||
public function Description() : string
|
||||
{
|
||||
return $this->sDesc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function Label()
|
||||
public function Label() : string
|
||||
{
|
||||
return $this->sLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function Type()
|
||||
|
||||
public function Type() : int
|
||||
{
|
||||
return $this->iType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
|
@ -179,18 +133,12 @@ class Property
|
|||
return $this->mDefaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function Placeholder()
|
||||
public function Placeholder() : string
|
||||
{
|
||||
return $this->sPlaceholder;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function ToArray()
|
||||
|
||||
public function ToArray() : array
|
||||
{
|
||||
return array(
|
||||
'',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue