From 308d686294e3e256b35e671d5da94e4a9ae5fc6f Mon Sep 17 00:00:00 2001 From: Runar Borge Date: Mon, 22 Jun 2015 21:12:57 +0200 Subject: [PATCH 1/4] Added plugin hook to create a custom container under device->overview. Container apears over "Overall traffic" on the left phane --- html/pages/device/overview.inc.php | 2 ++ html/plugins/Test/Test.php | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/html/pages/device/overview.inc.php b/html/pages/device/overview.inc.php index f414dd4e5b..1d7ee68677 100644 --- a/html/pages/device/overview.inc.php +++ b/html/pages/device/overview.inc.php @@ -26,6 +26,8 @@ echo('
'); include("includes/dev-overview-data.inc.php"); +Plugins::call('device_overview_container',array($device)); + include("overview/ports.inc.php"); echo('
diff --git a/html/plugins/Test/Test.php b/html/plugins/Test/Test.php index dd11344388..06d20d28c6 100644 --- a/html/plugins/Test/Test.php +++ b/html/plugins/Test/Test.php @@ -4,6 +4,14 @@ class Test { public function menu() { echo('
  • '.get_class().'
  • '); } + + public function device_overview_container($device) { + echo('
    Test Plugin
    i"ve just added a plugin :)
    '); + echo('
    ');
    +    var_dump($device);
    +    echo('
    '); + echo('
    '); + } } ?> From 07e996094c805f87e04e88eb97d83663f645b192 Mon Sep 17 00:00:00 2001 From: Runar Borge Date: Mon, 22 Jun 2015 21:53:35 +0200 Subject: [PATCH 2/4] Removed var_dump and updated text in Example plugin --- html/plugins/Test/Test.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/html/plugins/Test/Test.php b/html/plugins/Test/Test.php index 06d20d28c6..f6817bd312 100644 --- a/html/plugins/Test/Test.php +++ b/html/plugins/Test/Test.php @@ -6,10 +6,8 @@ class Test { } public function device_overview_container($device) { - echo('
    Test Plugin
    i"ve just added a plugin :)
    '); - echo('
    ');
    -    var_dump($device);
    -    echo('
    '); + echo('
    '.get_class().' Plugin
    '); + echo(' Example plugin i "Device - Overview" tab
    '); echo('
    '); } } From 170030c7865913c51b65067e544302d711598031 Mon Sep 17 00:00:00 2001 From: Runar Borge Date: Mon, 22 Jun 2015 21:55:54 +0200 Subject: [PATCH 3/4] Fixed typo... --- html/plugins/Test/Test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/plugins/Test/Test.php b/html/plugins/Test/Test.php index f6817bd312..a2bd417442 100644 --- a/html/plugins/Test/Test.php +++ b/html/plugins/Test/Test.php @@ -7,7 +7,7 @@ class Test { public function device_overview_container($device) { echo('
    '.get_class().' Plugin
    '); - echo(' Example plugin i "Device - Overview" tab
    '); + echo(' Example plugin in "Device - Overview" tab
    '); echo('
    '); } } From 21cf6b2019753b0714c1f554468c4005c45bbb0a Mon Sep 17 00:00:00 2001 From: Runar Borge Date: Tue, 23 Jun 2015 13:15:33 +0200 Subject: [PATCH 4/4] Disabled from Test plugin, user have to manually enable the plugin in Test plugin file --- html/plugins/Test/Test.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/html/plugins/Test/Test.php b/html/plugins/Test/Test.php index a2bd417442..3447d42547 100644 --- a/html/plugins/Test/Test.php +++ b/html/plugins/Test/Test.php @@ -5,11 +5,13 @@ class Test { echo('
  • '.get_class().'
  • '); } + /* public function device_overview_container($device) { echo('
    '.get_class().' Plugin
    '); echo(' Example plugin in "Device - Overview" tab
    '); echo('
    '); } + */ } ?>