mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 04:29:21 +03:00
v1.2.7.416
This commit is contained in:
parent
54e2645fcf
commit
3b27abbe9a
434 changed files with 51 additions and 72 deletions
|
|
@ -1,59 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace RainLoop\Config;
|
||||
|
||||
class Plugin extends \RainLoop\Config\AbstractConfig
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $aMap;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($sPluginName, $aMap = array())
|
||||
{
|
||||
$this->aMap = is_array($aMap) ? $this->convertConfigMap($aMap) : array();
|
||||
|
||||
parent::__construct('plugin-'.$sPluginName.'.ini', '; RainLoop Webmail plugin ('.$sPluginName.')');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $aMap
|
||||
* @return array
|
||||
*/
|
||||
private function convertConfigMap($aMap)
|
||||
{
|
||||
if (0 < count($aMap))
|
||||
{
|
||||
$aResultMap = array();
|
||||
foreach ($aMap as /* @var $oProperty \RainLoop\Plugins\Property */ $oProperty)
|
||||
{
|
||||
if ($oProperty)
|
||||
{
|
||||
$mValue = $oProperty->DefaultValue();
|
||||
$sValue = is_array($mValue) && isset($mValue[0]) ? $mValue[0] : $mValue;
|
||||
$aResultMap[$oProperty->Name()] = array($sValue, '');
|
||||
}
|
||||
}
|
||||
|
||||
if (0 < count($aResultMap))
|
||||
{
|
||||
return array(
|
||||
'plugin' => $aResultMap
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function defaultValues()
|
||||
{
|
||||
return $this->aMap;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue