Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-polaris-gateway-plugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Polaris
moodle
moodle-polaris-gateway-plugin
Commits
ac952d71
Commit
ac952d71
authored
2 years ago
by
Benjamin Ledel
Browse files
Options
Downloads
Patches
Plain Diff
* add sample service
parent
f43c35a3
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
classes/external/collect_groups.php
+48
-0
48 additions, 0 deletions
classes/external/collect_groups.php
db/services.php
+44
-0
44 additions, 0 deletions
db/services.php
with
92 additions
and
0 deletions
classes/external/collect_groups.php
0 → 100644
+
48
−
0
View file @
ac952d71
<?php
namespace
local_polaris_gateway\external
;
use
external_function_parameters
;
use
external_multiple_structure
;
use
external_single_structure
;
use
external_value
;
class
create_groups
extends
\core_external\external_api
{
/**
* Returns description of method parameters
* @return external_function_parameters
*/
public
static
function
execute_parameters
()
{
return
new
external_function_parameters
([
'groups'
=>
new
external_multiple_structure
(
new
external_single_structure
([
'courseid'
=>
new
external_value
(
PARAM_INT
,
'id of course'
),
'name'
=>
new
external_value
(
PARAM_TEXT
,
'multilang compatible name, course unique'
),
'description'
=>
new
external_value
(
PARAM_RAW
,
'group description text'
),
'enrolmentkey'
=>
new
external_value
(
PARAM_RAW
,
'group enrol secret phrase'
),
])
)
]);
}
public
static
function
execute_returns
()
{
return
new
external_multiple_structure
(
new
external_single_structure
([
'id'
=>
new
external_value
(
PARAM_INT
,
'group record id'
),
'courseid'
=>
new
external_value
(
PARAM_INT
,
'id of course'
),
'name'
=>
new
external_value
(
PARAM_TEXT
,
'multilang compatible name, course unique'
),
'description'
=>
new
external_value
(
PARAM_RAW
,
'group description text'
),
'enrolmentkey'
=>
new
external_value
(
PARAM_RAW
,
'group enrol secret phrase'
),
])
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
db/services.php
0 → 100644
+
44
−
0
View file @
ac952d71
<?php
$functions
=
[
// The name of your web service function, as discussed above.
'local_polaris_gateway_collect_groups'
=>
[
// The name of the namespaced class that the function is located in.
'classname'
=>
'local_polaris_gateway\external\collect_groups'
,
// A brief, human-readable, description of the web service function.
'description'
=>
'Collects information about courses members to show them in polaris'
,
// Options include read, and write.
'type'
=>
'read'
,
// Whether the service is available for use in AJAX calls from the web.
'ajax'
=>
true
,
// An optional list of services where the function will be included.
'services'
=>
[
]
],
];
$services
=
[
'Polaris Gateway'
=>
[
'functions'
=>
[
'local_polaris_gateway_collect_groups'
,
'local_o365_get_onenoteassignment'
,
'local_o365_update_onenoteassignment'
,
'local_o365_delete_onenoteassignment'
,
'local_o365_get_teachercourses'
,
'local_o365_get_course_users'
,
'local_o365_get_assignments'
,
'local_o365_get_bot_message'
,
'local_o365_update_grade'
,
'mod_assign_get_assignments'
,
'mod_assign_get_grades'
,
'mod_assign_save_grade'
,
],
'restrictedusers'
=>
0
,
'enabled'
=>
0
,
'shortname'
=>
'polaris_gateway'
,
]
];
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment