mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:15 +01:00
only check vfs for templates, if /etemplates is mounted
This commit is contained in:
parent
50f362c5e3
commit
da32666df9
@ -143,6 +143,7 @@ class Template extends Etemplate\Widget
|
|||||||
*/
|
*/
|
||||||
public static function relPath($name, $template_set=null, $version='')
|
public static function relPath($name, $template_set=null, $version='')
|
||||||
{
|
{
|
||||||
|
static $prefixes = null;
|
||||||
unset($version); // not used currently
|
unset($version); // not used currently
|
||||||
list($app, $rest) = explode('.', $name, 2);
|
list($app, $rest) = explode('.', $name, 2);
|
||||||
|
|
||||||
@ -153,7 +154,17 @@ class Template extends Etemplate\Widget
|
|||||||
$template_path = '/'.$app.'/templates/'.$template_set.'/'.$rest.'.xet';
|
$template_path = '/'.$app.'/templates/'.$template_set.'/'.$rest.'.xet';
|
||||||
$default_path = '/'.$app.'/templates/default/'.$rest.'.xet';
|
$default_path = '/'.$app.'/templates/default/'.$rest.'.xet';
|
||||||
|
|
||||||
foreach(array(Api\Vfs::PREFIX.self::VFS_TEMPLATE_PATH, EGW_SERVER_ROOT) as $prefix)
|
// check if /etemplates is mounted in VFS and prefer it in that case over phy. file-system
|
||||||
|
if (!isset($prefixes))
|
||||||
|
{
|
||||||
|
$prefixes = array(EGW_SERVER_ROOT);
|
||||||
|
$fs_tab = Api\Vfs::mount();
|
||||||
|
if (isset($fs_tab[self::VFS_TEMPLATE_PATH]))
|
||||||
|
{
|
||||||
|
array_unshift($prefixes, Api\Vfs::PREFIX.self::VFS_TEMPLATE_PATH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach($prefixes as $prefix)
|
||||||
{
|
{
|
||||||
if (file_exists($prefix.$template_path))
|
if (file_exists($prefix.$template_path))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user