-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.php
More file actions
57 lines (48 loc) · 1.83 KB
/
Copy pathsettings.php
File metadata and controls
57 lines (48 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
// Copyright (C) 2017 Learning Stacks LLC https://learningstacks.com/
//
// This file is a part of the IMIS Integration Components developed by
// Learning Stacks LLC - https://learningstacks.com/
//
// This file cannot be copied or distributed without the express permission
// of Learning Stacks LLC.
/**
*
*
* @package local_imisbridge
* @copyright 2017 Learning Stacks LLC {@link https://learningstacks.com/}
* @license All Rights Reserved
*/
global $ADMIN;
// Ensure the configurations for this site are set
if ($hassiteconfig) {
$yesno = array(
'0' => new lang_string('no'),
'1' => new lang_string('yes'),
);
// Create the new settings page
// - in a local plugin this is not defined as standard, so normal $settings->methods will throw an error as
// $settings will be NULL
$settings = new admin_settingpage('local_imisbridge', 'IMIS Bridge Settings');
// Create
$ADMIN->add('localplugins', $settings);
// Add a setting field to the settings for this page
$settings->add(new admin_setting_configtext(
'local_imisbridge/base_api_url',
new lang_string('imis_endpoint_field_label', 'local_imisbridge'),
new lang_string('imis_endpoint_field_desc', 'local_imisbridge'),
'',
PARAM_URL));
$settings->add(new admin_setting_configselect('local_imisbridge/send_completion_event',
new lang_string('send_completion_event_field_label', 'local_imisbridge'),
new lang_string('send_completion_event_field_desc', 'local_imisbridge'),
0,
$yesno));
$settings->add(new admin_setting_configcheckbox(
'local_imisbridge/decrypt_token',
new lang_string('decrypt_token_field_label', 'local_imisbridge'),
new lang_string('decrypt_token_field_desc', 'local_imisbridge'),
'0',
'1',
'0'));
}