mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 23:00:56 +01:00
only scanning widget directory, not parent
This commit is contained in:
parent
901157242e
commit
3f3973af51
@ -14,7 +14,6 @@
|
|||||||
namespace EGroupware\Api\Etemplate;
|
namespace EGroupware\Api\Etemplate;
|
||||||
|
|
||||||
use EGroupware\Api;
|
use EGroupware\Api;
|
||||||
use EGroupware\Api\Cache;
|
|
||||||
use XMLReader;
|
use XMLReader;
|
||||||
use ReflectionMethod;
|
use ReflectionMethod;
|
||||||
|
|
||||||
@ -304,11 +303,11 @@ class Widget
|
|||||||
public static function scanForWidgets()
|
public static function scanForWidgets()
|
||||||
{
|
{
|
||||||
|
|
||||||
$widget_registry = Cache::getInstance('etemplate', 'widget_registry');
|
$widget_registry = Api\Cache::getInstance('etemplate', 'widget_registry');
|
||||||
|
|
||||||
if (!$widget_registry) // not in instance cache --> rescan from filesystem
|
if (!$widget_registry) // not in instance cache --> rescan from filesystem
|
||||||
{
|
{
|
||||||
foreach(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(__DIR__)) as $path)
|
foreach(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(__DIR__.'/Widget')) as $path)
|
||||||
{
|
{
|
||||||
if(substr($path, -4) == '.php')
|
if(substr($path, -4) == '.php')
|
||||||
{
|
{
|
||||||
@ -325,7 +324,7 @@ class Widget
|
|||||||
|
|
||||||
// Use hook to load custom widgets from other apps
|
// Use hook to load custom widgets from other apps
|
||||||
$widgets = $GLOBALS['egw']->hooks->process('etemplate2_register_widgets',array(),true);
|
$widgets = $GLOBALS['egw']->hooks->process('etemplate2_register_widgets',array(),true);
|
||||||
foreach($widgets as $app => $list)
|
foreach($widgets as $list)
|
||||||
{
|
{
|
||||||
if (is_array($list))
|
if (is_array($list))
|
||||||
{
|
{
|
||||||
@ -342,7 +341,7 @@ class Widget
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Cache::setInstance('etemplate', 'widget_registry', self::$widget_registry, 3600);
|
Api\Cache::setInstance('etemplate', 'widget_registry', self::$widget_registry, 3600);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user