Uploading and preparing the repository to the dev version.

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
This commit is contained in:
RainLoop Team 2013-11-16 02:21:12 +04:00
parent afad45137e
commit 4cc2207513
846 changed files with 99453 additions and 2123 deletions

View file

@ -0,0 +1,74 @@
<?php
namespace MailSo\Log\Drivers;
/**
* @category MailSo
* @package Log
* @subpackage Drivers
*/
class Callback extends \MailSo\Log\Driver
{
/**
* @var mixed
*/
private $fWriteCallback;
/**
* @var mixed
*/
private $fClearCallback;
/**
* @access protected
*
* @param mixed $fWriteCallback
* @param mixed $fClearCallback
*/
protected function __construct($fWriteCallback, $fClearCallback)
{
parent::__construct();
$this->fWriteCallback = \is_callable($fWriteCallback) ? $fWriteCallback : null;
$this->fClearCallback = \is_callable($fClearCallback) ? $fClearCallback : null;
}
/**
* @param mixed $fWriteCallback
* @param mixed $fClearCallback = null
*
* @return \MailSo\Log\Drivers\Callback
*/
public static function NewInstance($fWriteCallback, $fClearCallback = null)
{
return new self($fWriteCallback, $fClearCallback);
}
/**
* @param string|array $sDesc
*
* @return bool
*/
protected function writeImplementation($sDesc)
{
if ($this->fWriteCallback)
{
\call_user_func_array($this->fWriteCallback, array($sDesc));
}
return true;
}
/**
* @return bool
*/
protected function clearImplementation()
{
if ($this->fClearCallback)
{
\call_user_func($this->fClearCallback);
}
return true;
}
}

View file

@ -0,0 +1,87 @@
<?php
namespace MailSo\Log\Drivers;
/**
* @category MailSo
* @package Log
* @subpackage Drivers
*/
class File extends \MailSo\Log\Driver
{
/**
* @var string
*/
private $sLoggerFileName;
/**
* @var string
*/
private $sCrLf;
/**
* @access protected
*
* @param string $sLoggerFileName
* @param string $sCrLf = "\r\n"
*/
protected function __construct($sLoggerFileName, $sCrLf = "\r\n")
{
parent::__construct();
$this->sLoggerFileName = $sLoggerFileName;
$this->sCrLf = $sCrLf;
}
/**
* @param string $sLoggerFileName
*/
public function SetLoggerFileName($sLoggerFileName)
{
$this->sLoggerFileName = $sLoggerFileName;
}
/**
* @param string $sLoggerFileName
* @param string $sCrLf = "\r\n"
*
* @return \MailSo\Log\Drivers\File
*/
public static function NewInstance($sLoggerFileName, $sCrLf = "\r\n")
{
return new self($sLoggerFileName, $sCrLf);
}
/**
* @param string|array $mDesc
*
* @return bool
*/
protected function writeImplementation($mDesc)
{
return $this->writeToLogFile($mDesc);
}
/**
* @return bool
*/
protected function clearImplementation()
{
return \unlink($this->sLoggerFileName);
}
/**
* @param string|array $mDesc
*
* @return bool
*/
private function writeToLogFile($mDesc)
{
if (is_array($mDesc))
{
$mDesc = \implode($this->sCrLf, $mDesc);
}
return \error_log($mDesc.$this->sCrLf, 3, $this->sLoggerFileName);
}
}

View file

@ -0,0 +1,85 @@
<?php
namespace MailSo\Log\Drivers;
/**
* @category MailSo
* @package Log
* @subpackage Drivers
*/
class Inline extends \MailSo\Log\Driver
{
/**
* @var string
*/
private $sNewLine;
/**
* @var bool
*/
private $bHtmlEncodeSpecialChars;
/**
* @access protected
*
* @param string $sNewLine = "\r\n"
* @param bool $bHtmlEncodeSpecialChars = false
*/
protected function __construct($sNewLine = "\r\n", $bHtmlEncodeSpecialChars = false)
{
parent::__construct();
$this->sNewLine = $sNewLine;
$this->bHtmlEncodeSpecialChars = $bHtmlEncodeSpecialChars;
}
/**
* @param string $sNewLine = "\r\n"
* @param bool $bHtmlEncodeSpecialChars = false
*
* @return \MailSo\Log\Drivers\Inline
*/
public static function NewInstance($sNewLine = "\r\n", $bHtmlEncodeSpecialChars = false)
{
return new self($sNewLine, $bHtmlEncodeSpecialChars);
}
/**
* @param string $mDesc
*
* @return bool
*/
protected function writeImplementation($mDesc)
{
if (is_array($mDesc))
{
if ($this->bHtmlEncodeSpecialChars)
{
$mDesc = array_map(function ($sItem) {
$sItem = \htmlspecialchars($mDesc);
}, $mDesc);
}
$mDesc = \implode($this->sNewLine, $mDesc);
}
else
{
echo ($this->bHtmlEncodeSpecialChars) ? \htmlspecialchars($mDesc).$this->sNewLine : $mDesc.$this->sNewLine;
}
return true;
}
/**
* @return bool
*/
protected function clearImplementation()
{
if (\defined('PHP_SAPI') && 'cli' === PHP_SAPI)
{
\system('clear');
}
return true;
}
}