mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-04 23:17:02 +03:00
ownCloud integration improvements
This commit is contained in:
parent
c0d016293d
commit
d30292d500
9 changed files with 170 additions and 59 deletions
|
|
@ -307,6 +307,57 @@ class Utils
|
|||
@\setcookie($sName, '', \time() - 3600 * 24 * 30, '/');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public static function IsOwnCloud()
|
||||
{
|
||||
return isset($_ENV['RAINLOOP_OWNCLOUD']) && $_ENV['RAINLOOP_OWNCLOUD'] &&
|
||||
\class_exists('\\OC');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function WebPath()
|
||||
{
|
||||
$sAppPath = '';
|
||||
if (\RainLoop\Utils::IsOwnCloud())
|
||||
{
|
||||
if (\class_exists('\\OC_App'))
|
||||
{
|
||||
$sAppPath = \rtrim(\trim(\OC_App::getAppWebPath('rainloop')), '\\/').'/app/';
|
||||
}
|
||||
|
||||
if (empty($sAppPath))
|
||||
{
|
||||
$sUrl = \MailSo\Base\Http::SingletonInstance()->GetUrl();
|
||||
if ($sUrl && \preg_match('/\/index\.php\/apps\/rainloop/', $sUrl))
|
||||
{
|
||||
$sAppPath = \preg_replace('/\/index\.php\/apps\/rainloop.+$/',
|
||||
'/apps/rainloop/app/', $sUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $sAppPath;
|
||||
}
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function WebVersionPath()
|
||||
{
|
||||
return self::WebPath().'rainloop/v/'.APP_VERSION.'/';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function WebStaticPath()
|
||||
{
|
||||
return self::WebVersionPath().'static/';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sFileName
|
||||
* @param bool $bProcessSections = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue