diff --git a/html/plugins/Test/Test.inc.php b/html/plugins/Test/Test.inc.php index 6f8b0b7b33..3f38b73e13 100644 --- a/html/plugins/Test/Test.inc.php +++ b/html/plugins/Test/Test.inc.php @@ -1,3 +1,3 @@ Test'; + $name = self::className(); + echo view(self::viewPath(), compact('name')); } - //end menu() - public function device_overview_container($device) { - echo '
' . get_class() . ' Plugin
'; - echo ' Example plugin in "Device - Overview" tab
'; - echo '
'; + $name = self::className() . ' Plugin'; + $device = Device::find($device['device_id']); + echo view(self::viewPath(), compact('name','device')); } public function port_container($device, $port) { - echo '
' . get_class() . ' plugin in "Port" tab
'; - echo 'Example display in Port tab
'; - echo '
'; + $name = self::className() . ' Plugin'; + $port = Port::find($port['port_id']); + echo view(self::viewPath(), compact('name','port')); + } + + private static function viewPath() + { + return 'plugins.' . strtolower(self::className()) . '.' . debug_backtrace()[1]['function']; + } + + private static function className() + { + return str_replace(__NAMESPACE__ . '\\', '', self::class); } } diff --git a/resources/views/plugins/test/device_overview_container.blade.php b/resources/views/plugins/test/device_overview_container.blade.php new file mode 100644 index 0000000000..2db37a53f2 --- /dev/null +++ b/resources/views/plugins/test/device_overview_container.blade.php @@ -0,0 +1,13 @@ +
+
+
+
+
+ {{ $name }} +
+ Example plugin in "Device - Overview" tab
+ {{ $device->hostname }} +
+
+
+
diff --git a/resources/views/plugins/test/menu.blade.php b/resources/views/plugins/test/menu.blade.php new file mode 100644 index 0000000000..bf6e269a24 --- /dev/null +++ b/resources/views/plugins/test/menu.blade.php @@ -0,0 +1,3 @@ +
  • + {{ $name }} +
  • diff --git a/resources/views/plugins/test/plugin.blade.php b/resources/views/plugins/test/plugin.blade.php new file mode 100644 index 0000000000..94bd00e31a --- /dev/null +++ b/resources/views/plugins/test/plugin.blade.php @@ -0,0 +1 @@ +

    Well done, the plugin system is up and running

    diff --git a/resources/views/plugins/test/port_container.blade.php b/resources/views/plugins/test/port_container.blade.php new file mode 100644 index 0000000000..d330a74692 --- /dev/null +++ b/resources/views/plugins/test/port_container.blade.php @@ -0,0 +1,13 @@ +
    +
    +
    +
    +
    + {{ $name }} plugin in "Port" tab +
    + Example display in Port tab
    + {{ $port->device->hostname }} +
    +
    +
    +