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';