Skip to content

Commit

Permalink
MDL-79844 core_ltix: create admin settings node
Browse files Browse the repository at this point in the history
This change:
- adds category to top, so it'll appear under 'General' tab.
- creates a single 'manage tools' external settings page in that
category
- adds support for ltixsource plugin settings to be included inside
that category
  • Loading branch information
snake committed May 2, 2024
1 parent dce20ef commit c5597f2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
36 changes: 36 additions & 0 deletions admin/settings/ltix.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* LTI settings.
*
* @package core_ltix
* @copyright 2024 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

// Tool configure page, sitting under 'ltix' category.
$toolconfigurepage = new admin_externalpage('ltixtoolconfigure', get_string('manage_external_tools', 'core_ltix'),
new moodle_url('/ltix/toolconfigure.php'));
$ADMIN->add('ltix', $toolconfigurepage);

// Also include any ltixsource plugin settings under this same category.
foreach (core_plugin_manager::instance()->get_plugins_of_type('ltixsource') as $plugin) {
/** @var \core\plugininfo\ltixsource $plugin */
$plugin->load_settings($ADMIN, 'ltix', $hassiteconfig);
}
1 change: 1 addition & 0 deletions admin/settings/top.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
$ADMIN->add('root', new admin_category('competencies', new lang_string('competencies', 'core_competency')));
$ADMIN->add('root', new admin_category('badges', new lang_string('badges'), empty($CFG->enablebadges)));
$ADMIN->add('root', new admin_category('h5p', new lang_string('h5p', 'core_h5p')));
$ADMIN->add('root', new admin_category('ltix', new lang_string('ltix', 'core_ltix')));
$ADMIN->add('root', new admin_category('license', new lang_string('license')));
$ADMIN->add('root', new admin_category('location', new lang_string('location','admin')));
$ADMIN->add('root', new admin_category('language', new lang_string('language')));
Expand Down

0 comments on commit c5597f2

Please sign in to comment.