Skip to content

Commit

Permalink
V402.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Mar 30, 2024
1 parent 554766f commit 17abefd
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fail-fast: true
matrix:
php: ['8.0', '8.2']
moodle-branch: ['MOODLE_403_STABLE']
moodle-branch: ['MOODLE_402_STABLE', 'main']
database: [mariadb]

steps:
Expand Down
6 changes: 6 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Version Information
===================

Version 402.1.0 - TBR
--------------------------
1. Improve settings UI.
2. Minimal version is now M4.2 - due to changes in core external API and to make use of tabs for settings.

Version 39.1.2 - 08/10/23
--------------------------
1. Add missing 'pluginname' from language file.
Expand Down
19 changes: 12 additions & 7 deletions classes/output/external.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@

namespace filter_synhi\output;

use core_external\external_api;
use core_external\external_function_parameters;
use core_external\external_single_structure;
use core_external\external_value;

/**
* SynHi filter.
*
Expand All @@ -33,7 +38,7 @@
* @author G J Barnard - {@link http://moodle.org/user/profile.php?id=442195}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
*/
class external extends \core\output\external {
class external extends external_api {
/**
* Return generated markup.
*
Expand Down Expand Up @@ -66,11 +71,11 @@ public static function setting_highlight_example($engine, $style) {
* @return external_function_parameters
*/
public static function setting_highlight_example_parameters() {
return new \external_function_parameters(
return new external_function_parameters(
[
'engine' => new \external_value(PARAM_TEXT, 'Engine', VALUE_REQUIRED, null, NULL_NOT_ALLOWED),
'style' => new \external_value(PARAM_TEXT, 'Style', VALUE_REQUIRED, null, NULL_NOT_ALLOWED),
]
'engine' => new external_value(PARAM_TEXT, 'Engine', VALUE_REQUIRED, null, NULL_NOT_ALLOWED),
'style' => new external_value(PARAM_TEXT, 'Style', VALUE_REQUIRED, null, NULL_NOT_ALLOWED),
]
);
}

Expand All @@ -80,9 +85,9 @@ public static function setting_highlight_example_parameters() {
* @return external_description
*/
public static function setting_highlight_example_returns() {
return new \external_single_structure(
return new external_single_structure(
[
'markup' => new \external_value(PARAM_RAW, 'Markup'),
'markup' => new external_value(PARAM_RAW, 'Markup'),
],
'Mustache template'
);
Expand Down
30 changes: 14 additions & 16 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,22 @@
*/
defined('MOODLE_INTERNAL') || die;

$settings = null;
$ADMIN->add('filtersettings', new admin_category('filter_synhi', get_string('filtername', 'filter_synhi')));

// Information.
$page = new admin_settingpage(
'filter_synhi_information',
get_string('information', 'filter_synhi')
);

if ($ADMIN->fulltree) {
$settings = new theme_boost_admin_settingspage_tabs('filtersettingsynhi', get_string('filtername', 'filter_synhi'));

// Information.
$page = new admin_settingpage(
'filter_synhi_information',
get_string('information', 'filter_synhi')
);
$page->add(new admin_setting_heading(
'filter_synhi_information',
'',
format_text(get_string('informationsettingsdesc', 'filter_synhi'), FORMAT_MARKDOWN)
));

// Information.
$page->add(new \filter_synhi\admin_setting_information('filter_synhi/formatinformation', '', '', 39, 403));
$page->add(new \filter_synhi\admin_setting_information('filter_synhi/formatinformation', '', '', 402, 404));

// Readme.md.
$page->add(new \filter_synhi\admin_setting_markdown('filter_synhi/filterreadme', '', '', 'Readme.md', 'filter/synhi'));
Expand All @@ -54,12 +52,11 @@
'Changes.md',
'filter/synhi'
));
}
$ADMIN->add('filter_synhi', $page);

// Settings.
$page = new admin_settingpage('filter_synhi_settings', get_string('settings', 'filter_synhi'));
if ($ADMIN->fulltree) {
$settings->add($page);

// Settings.
$page = new admin_settingpage('filter_synhi_settings', get_string('settings', 'filter_synhi'));
// Engine.
$name = 'filter_synhi/engine';
$title = get_string('engine', 'filter_synhi');
Expand Down Expand Up @@ -144,5 +141,6 @@
'syntaxhighlighterinformation',
'<p>' . get_string('syntaxhighlighterinformation', 'filter_synhi') . '</p>'
));

$settings->add($page);
}
$ADMIN->add('filter_synhi', $page);
8 changes: 4 additions & 4 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

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

$plugin->version = 2020073108;
$plugin->requires = 2020061500.00; // M3.9 (Build: 20200615).
$plugin->supported = [39, 403];
$plugin->version = 2024033000;
$plugin->requires = 2023042400.00; // 4.2 (Build: 20230424).
$plugin->supported = [402, 404];
$plugin->component = 'filter_synhi';
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '39.1.2';
$plugin->release = '402.1.0';

0 comments on commit 17abefd

Please sign in to comment.