mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-05-04 18:08:42 +02:00
fix multiple calls of getCards hook
This commit is contained in:
parent
0b61ae3bdd
commit
4e98b5065b
@ -517,8 +517,11 @@ class PluginExampleExample extends CommonDBTM {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static function dashboardCards() {
|
static function dashboardCards($cards = []) {
|
||||||
return [
|
if (is_null($cards)) {
|
||||||
|
$cards = [];
|
||||||
|
}
|
||||||
|
$new_cards = [
|
||||||
'plugin_example_card' => [
|
'plugin_example_card' => [
|
||||||
'widgettype' => ["example"],
|
'widgettype' => ["example"],
|
||||||
'label' => __("Plugin Example card"),
|
'label' => __("Plugin Example card"),
|
||||||
@ -534,6 +537,8 @@ class PluginExampleExample extends CommonDBTM {
|
|||||||
'provider' => "PluginExampleExample::cardBigNumberProvider",
|
'provider' => "PluginExampleExample::cardBigNumberProvider",
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
return array_merge($cards, $new_cards);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user