Skip to content
Extraits de code Groupes Projets
Valider e6607932 rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

fix tests

parent 52d0f24e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -26,7 +26,7 @@ class WidgetsList extends Singleton ...@@ -26,7 +26,7 @@ class WidgetsList extends Singleton
* *
* @var array * @var array
*/ */
static protected $widgets = null; static protected $widgets = array();
/** /**
* Indicates whether the hook was posted or not * Indicates whether the hook was posted or not
...@@ -80,10 +80,11 @@ class WidgetsList extends Singleton ...@@ -80,10 +80,11 @@ class WidgetsList extends Singleton
Piwik::postEvent('WidgetsList.addWidgets'); Piwik::postEvent('WidgetsList.addWidgets');
/** @var \Piwik\Plugin\Widgets[] $widgets */ /** @var \Piwik\Plugin\Widgets[] $widgets */
$widgets = PluginManager::getInstance()->findComponents('Widgets', 'Piwik\\Plugin\\Widgets'); $widgets = PluginManager::getInstance()->findComponents('Widgets', 'Piwik\\Plugin\\Widgets');
$widgetsList = self::getInstance();
foreach ($widgets as $widget) { foreach ($widgets as $widget) {
$widget->configure(WidgetsList::getInstance()); $widget->configure($widgetsList);
} }
} }
} }
...@@ -145,6 +146,11 @@ class WidgetsList extends Singleton ...@@ -145,6 +146,11 @@ class WidgetsList extends Singleton
} }
$widgetUniqueId .= $name . $value; $widgetUniqueId .= $name . $value;
} }
if (!array_key_exists($widgetCategory, self::$widgets)) {
self::$widgets[$widgetCategory] = array();
}
self::$widgets[$widgetCategory][] = array( self::$widgets[$widgetCategory][] = array(
'name' => $widgetName, 'name' => $widgetName,
'uniqueId' => $widgetUniqueId, 'uniqueId' => $widgetUniqueId,
...@@ -209,7 +215,7 @@ class WidgetsList extends Singleton ...@@ -209,7 +215,7 @@ class WidgetsList extends Singleton
*/ */
public static function _reset() public static function _reset()
{ {
self::$widgets = null; self::$widgets = array();
self::$hookCalled = false; self::$hookCalled = false;
} }
} }
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
* *
*/ */
namespace Piwik\Plugins\ExampleRssWidget; namespace Piwik\Plugins\ExamplePlugin;
use Piwik\WidgetsList; use Piwik\WidgetsList;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter