Skip to content

Commit 795ba91

Browse files
committed
first commit
1 parent 637ff5a commit 795ba91

File tree

6 files changed

+186
-0
lines changed

6 files changed

+186
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

amd/src/index.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// This file is part of Moodle - http://moodle.org/
2+
//
3+
// Moodle is free software: you can redistribute it and/or modify
4+
// it under the terms of the GNU General Public License as published by
5+
// the Free Software Foundation, either version 3 of the License, or
6+
// (at your option) any later version.
7+
//
8+
// Moodle is distributed in the hope that it will be useful,
9+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
// GNU General Public License for more details.
12+
//
13+
// You should have received a copy of the GNU General Public License
14+
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
15+
16+
/**
17+
* Example module for the plugintype_pluginname plugin.
18+
*
19+
* @module plugintype_pluginname/example
20+
* @copyright Year, You Name <[email protected]>
21+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22+
*/
23+
24+
// THIS DOES NOTHING AT THE MOMENT

lang/en/vatsim.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
// This file is part of Moodle - http://moodle.org/
3+
//
4+
// Moodle is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// Moodle is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16+
17+
/**
18+
* Version metadata for the local-vatsim plugin.
19+
*
20+
* @package local_vatsim
21+
* @copyright 2024, VATSIM Technology Team [email protected]
22+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23+
*/
24+
25+
$string['pluginname'] = 'VATSIM API Connector';

lib.php

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
// This file is part of Moodle - http://moodle.org/
3+
//
4+
// Moodle is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// Moodle is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16+
17+
/**
18+
* Plugin functions for the local_[pluginname] plugin.
19+
*
20+
* @package local_[pluginname]
21+
* @copyright Year, You Name <[email protected]>
22+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23+
*/
24+
25+
function local_vatsim_extend_settings_navigation($settingsnav, $context) {
26+
global $CFG, $PAGE;
27+
28+
// Only add this settings item on non-site course pages.
29+
if (!$PAGE->course or $PAGE->course->id == 1) {
30+
return;
31+
}
32+
33+
// Only let users with the appropriate capability see this settings item.
34+
if (!has_capability('moodle/backup:backupcourse', context_course::instance($PAGE->course->id))) {
35+
return;
36+
}
37+
38+
if ($settingnode = $settingsnav->find('courseadmin', navigation_node::TYPE_COURSE)) {
39+
$strfoo = get_string('foo', 'local_vatsim');
40+
$url = new moodle_url('/local/vatsim/foo.php', array('id' => $PAGE->course->id));
41+
$foonode = navigation_node::create(
42+
$strfoo,
43+
$url,
44+
navigation_node::NODETYPE_LEAF,
45+
'vatsim',
46+
'vatsim',
47+
new pix_icon('t/addcontact', $strfoo)
48+
);
49+
if ($PAGE->url->compare($url, URL_MATCH_BASE)) {
50+
$foonode->make_active();
51+
}
52+
$settingnode->add_node($foonode);
53+
}
54+
}

settings.php

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
// This file is part of Moodle - http://moodle.org/
3+
//
4+
// Moodle is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// Moodle is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16+
17+
/**
18+
* Plugin settings for the local_[pluginname] plugin.
19+
*
20+
* @package local_[pluginname]
21+
* @copyright Year, You Name <[email protected]>
22+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23+
*/
24+
25+
// Ensure the configurations for this site are set
26+
if ($hassiteconfig) {
27+
28+
// Create the new settings page
29+
// - in a local plugin this is not defined as standard, so normal $settings->methods will throw an error as
30+
// $settings will be null
31+
$settings = new admin_settingpage('local_vatsim', 'VATSIM API Helper');
32+
33+
// Create
34+
$ADMIN->add('localplugins', $settings);
35+
36+
// Add a setting field to the settings for this page
37+
$settings->add(new admin_setting_configtext(
38+
// This is the reference you will use to your configuration
39+
'local_vatsim/apikey',
40+
41+
// This is the friendly title for the config, which will be displayed
42+
'External API: Key',
43+
44+
// This is helper text for this config field
45+
'This is the key used to access the External API',
46+
47+
// This is the default value
48+
'No Key Defined',
49+
50+
// This is the type of Parameter this config is
51+
PARAM_TEXT
52+
));
53+
}

version.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
// This file is part of Moodle - http://moodle.org/
3+
//
4+
// Moodle is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// Moodle is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16+
17+
/**
18+
* Session Booking Plugin
19+
*
20+
* @package local_booking
21+
* @author Mustafa Hajjar ([email protected])
22+
* @copyright BAVirtual.co.uk © 2021
23+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24+
*/
25+
26+
$plugin->version = 2024120100;
27+
$plugin->component = 'local_vatsim';
28+
$plugin->maturity = MATURITY_STABLE;
29+
$plugin->release = '1.0.0';

0 commit comments

Comments
 (0)