mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-11 09:18:07 +08:00
4cc2207513
Original unminified source code (dev folder - js, css, less) (fixes #6) Grunt build system Multiple identities correction (fixes #9) Compose html editor (fixes #12) New general settings - Loading Description New warning about default admin password Split general and login screen settings
59 lines
No EOL
1.1 KiB
PHP
59 lines
No EOL
1.1 KiB
PHP
<?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;
|
|
}
|
|
} |