diff --git a/devel/grid_example/Makefile b/devel/grid_example/Makefile new file mode 100644 index 000000000..dfc4cf776 --- /dev/null +++ b/devel/grid_example/Makefile @@ -0,0 +1,6 @@ +PLUGIN_NAME= grid_example +PLUGIN_VERSION= 1.0 +PLUGIN_COMMENT= A sample framework application +PLUGIN_MAINTAINER= ad@opnsense.org + +.include "../../Mk/plugins.mk" diff --git a/devel/grid_example/pkg-descr b/devel/grid_example/pkg-descr new file mode 100644 index 000000000..6b92b42fb --- /dev/null +++ b/devel/grid_example/pkg-descr @@ -0,0 +1,4 @@ +The goal of the "grid_example" plugin is to showcase the capabilities +of the OPNsense plugin framework in relation to the grid/table system. + +WWW: https://docs.opnsense.org/development/examples/using_grids.html diff --git a/devel/grid_example/src/opnsense/mvc/app/controllers/OPNsense/GridExample/Api/SettingsController.php b/devel/grid_example/src/opnsense/mvc/app/controllers/OPNsense/GridExample/Api/SettingsController.php new file mode 100644 index 000000000..b0ec04b77 --- /dev/null +++ b/devel/grid_example/src/opnsense/mvc/app/controllers/OPNsense/GridExample/Api/SettingsController.php @@ -0,0 +1,71 @@ +searchBase("addresses.address", array('enabled', 'email'), "email"); + } + + public function setItemAction($uuid) + { + return $this->setBase("address", "addresses.address", $uuid); + } + + public function addItemAction() + { + return $this->addBase("address", "addresses.address"); + } + + public function getItemAction($uuid = null) + { + return $this->getBase("address", "addresses.address", $uuid); + } + + public function delItemAction($uuid) + { + return $this->delBase("addresses.address", $uuid); + } + + public function toggleItemAction($uuid, $enabled = null) + { + return $this->toggleBase("addresses.address", $uuid, $enabled); + } +} diff --git a/devel/grid_example/src/opnsense/mvc/app/controllers/OPNsense/GridExample/IndexController.php b/devel/grid_example/src/opnsense/mvc/app/controllers/OPNsense/GridExample/IndexController.php new file mode 100644 index 000000000..ac070c662 --- /dev/null +++ b/devel/grid_example/src/opnsense/mvc/app/controllers/OPNsense/GridExample/IndexController.php @@ -0,0 +1,42 @@ +view->pick('OPNsense/GridExample/index'); + $this->view->formDialogAddress = $this->getForm("dialogAddress"); + } +} diff --git a/devel/grid_example/src/opnsense/mvc/app/controllers/OPNsense/GridExample/forms/dialogAddress.xml b/devel/grid_example/src/opnsense/mvc/app/controllers/OPNsense/GridExample/forms/dialogAddress.xml new file mode 100644 index 000000000..9a65a91a7 --- /dev/null +++ b/devel/grid_example/src/opnsense/mvc/app/controllers/OPNsense/GridExample/forms/dialogAddress.xml @@ -0,0 +1,13 @@ +
diff --git a/devel/grid_example/src/opnsense/mvc/app/models/OPNsense/GridExample/ACL/ACL.xml b/devel/grid_example/src/opnsense/mvc/app/models/OPNsense/GridExample/ACL/ACL.xml new file mode 100644 index 000000000..6fb024088 --- /dev/null +++ b/devel/grid_example/src/opnsense/mvc/app/models/OPNsense/GridExample/ACL/ACL.xml @@ -0,0 +1,9 @@ +| {{ lang._('ID') }} | +{{ lang._('Enabled') }} | +{{ lang._('Email') }} | +{{ lang._('Commands') }} | +
|---|---|---|---|
| + | + + + | +