From 7c353bde15b763d03d010c048cbf3c6e21844056 Mon Sep 17 00:00:00 2001 From: Matheus Garcia Date: Mon, 27 Sep 2021 14:58:54 -0300 Subject: [PATCH] =?UTF-8?q?In=C3=ADcio=20de=20desenvolvimento=20do=20plugi?= =?UTF-8?q?n=20de=20integra=C3=A7=C3=A3o=20com=20o=20SGA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/services.php | 42 ++++++++++++++++++++++++++++++++++++++++++ externallib.php | 42 ++++++++++++++++++++++++++++++++++++++++++ lang/en/mod_sga.php | 6 ++++++ lang/pt/mod_sga.php | 6 ++++++ lang/pt_BR/mod_sga.php | 6 ++++++ version.php | 4 ++++ 6 files changed, 106 insertions(+) create mode 100644 db/services.php create mode 100644 externallib.php create mode 100644 lang/en/mod_sga.php create mode 100644 lang/pt/mod_sga.php create mode 100644 lang/pt_BR/mod_sga.php create mode 100644 version.php diff --git a/db/services.php b/db/services.php new file mode 100644 index 0000000..b7e1025 --- /dev/null +++ b/db/services.php @@ -0,0 +1,42 @@ +. + +/** + * External functions and service definitions. + */ +/* +// We define the services to install as pre-build services. A pre-build service is not editable by administrator. +$services = array( + 'Escola Modelo Service' => array( + 'functions' => array ( + 'block_escola_modelo_get_usage_statistics' + ), + 'restrictedusers' => 0, + 'enabled'=>1, + ) +); + +// We defined the web service functions to install. +$functions = array( + 'block_escola_modelo_get_usage_statistics' => array( + 'classname' => 'block_escola_modelo_external', + 'methodname' => 'get_usage_statistics', + 'classpath' => 'block/escola_modelo/externallib.php', + 'description' => 'Returns user statistics from this moodle installation', + 'type' => 'read', + ), +); + */ + diff --git a/externallib.php b/externallib.php new file mode 100644 index 0000000..78da0d2 --- /dev/null +++ b/externallib.php @@ -0,0 +1,42 @@ +. + +/** + * + */ +require_once($CFG->libdir . "/externallib.php"); + +class mod_sga_external extends external_api { + + /* public static function get_usage_statistics() { + global $USER; + + return '{"cursos": "10", "alunos":"20", "certificados":"12"}'; + } + + public static function get_usage_statistics_parameters() { + return new external_function_parameters( + array() + ); + } + + public static function get_usage_statistics_returns() { + return new external_value(PARAM_TEXT, 'JSON with statistics of this installation'); + } + + */ + +} + diff --git a/lang/en/mod_sga.php b/lang/en/mod_sga.php new file mode 100644 index 0000000..ac2c75d --- /dev/null +++ b/lang/en/mod_sga.php @@ -0,0 +1,6 @@ +version = 2021092701; +$plugin->requires = 2017110800; +$plugin->component = 'mod_sga';