From c881caff999cdcebefb5a4a8eaa45152c70d278e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20Ducoudr=C3=A9?= Date: Thu, 8 Aug 2024 11:54:23 +0200 Subject: [PATCH] S 6 - Setup plugin API routes --- module_setup.php | 44 ++++++++++++++++++++++++++++++++++++++++++++ reporter.php | 23 +++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 module_setup.php create mode 100644 reporter.php diff --git a/module_setup.php b/module_setup.php new file mode 100644 index 0000000..c74f0e2 --- /dev/null +++ b/module_setup.php @@ -0,0 +1,44 @@ +moduleInstall(array + ( + 'application' => 'eisge_api', + 'module' => 'Kalifast-Bug-Reporter', + 'module_desc' => 'A module to let the user create KALIFAST tickets', + 'libraries' => array( + array( + "lib_name" => "Reporter", + "lib_desc" => "Contains the rest functions to report a bug on the website", + ), + ), + 'modes' => array('DISPLAY', 'EDIT') + )); +} + +/* Unregister the module */ +function uninstall_kalifast_bug_reporter() { + $instance = new EISGE_Module_Core(); + $instance->moduleUninstall(array('application' => 'eisge_api', 'module'=>'Kalifast-Bug-Reporter')); +} + +/* Setup hooks */ +add_action( 'activate_Kalifast-Bug-Reporter/module_setup.php', 'install_kalifast_bug_reporter' ); +add_action( 'deactivate_Kalifast-Bug-Reporter/module_setup.php', 'uninstall_kalifast_bug_reporter' ); diff --git a/reporter.php b/reporter.php new file mode 100644 index 0000000..2e77adf --- /dev/null +++ b/reporter.php @@ -0,0 +1,23 @@ + array( + "mode" => "EDIT", + "guest_mod" => true, + "desc" => "Send a ticket to the Kalifast Application", + "args" => "no_args" + ) + ); + } + + public function post_kalifast_ticket(){ + return $this->functionFailed("not_implemented", "Not implemented yet!"); + } +} \ No newline at end of file