From 491167554f918547dd38f1b772bf74b5be994b6f Mon Sep 17 00:00:00 2001 From: ahwelp Date: Tue, 24 Jan 2023 20:42:21 +0000 Subject: [PATCH] Plugin to help on datables creation --- app/core/datatables/Datatables.php | 110 +++++++++++++++++++ app/core/datatables/DatatablesController.php | 11 ++ app/core/datatables/DatatablesInterface.php | 9 ++ app/core/datatables/lang/en.php | 2 + app/core/datatables/lang/pt_br.php | 2 + app/core/datatables/routes.php | 8 ++ app/core/datatables/views/index.mustache | 4 + 7 files changed, 146 insertions(+) create mode 100644 app/core/datatables/Datatables.php create mode 100644 app/core/datatables/DatatablesController.php create mode 100644 app/core/datatables/DatatablesInterface.php create mode 100644 app/core/datatables/lang/en.php create mode 100644 app/core/datatables/lang/pt_br.php create mode 100644 app/core/datatables/routes.php create mode 100644 app/core/datatables/views/index.mustache diff --git a/app/core/datatables/Datatables.php b/app/core/datatables/Datatables.php new file mode 100644 index 0000000..2b4a92e --- /dev/null +++ b/app/core/datatables/Datatables.php @@ -0,0 +1,110 @@ +".\Lang::getString($element, $baseUrl)."\n"; + } + $content = ""; + + if($list){ + $content = << + + + $header + + + + EOL; + }else{ + $content = << + + + $header + + + + EOL; + } + return $content; + } + + public static function getActionMenu($id, $urlBase, $actions = []) { + + $content = ""; + + if($actions){ + $content = << + +