mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 19:06:41 +02:00
MDL-79802 tool_mobile: Support new setting in the mobile app
This commit is contained in:
parent
270326244b
commit
5e39876428
2 changed files with 20 additions and 0 deletions
|
@ -393,6 +393,14 @@ class api {
|
|||
$settings->tool_dataprivacy_showdataretentionsummary = get_config('tool_dataprivacy', 'showdataretentionsummary');
|
||||
}
|
||||
|
||||
if (empty($section) || $section === 'h5psettings') {
|
||||
\core_h5p\local\library\autoloader::register();
|
||||
$customcss = \core_h5p\file_storage::get_custom_styles();
|
||||
if (!empty($customcss)) {
|
||||
$settings->h5pcustomcssurl = $customcss['cssurl']->out() . '?ver=' . $customcss['cssversion'];
|
||||
}
|
||||
}
|
||||
|
||||
return $settings;
|
||||
}
|
||||
|
||||
|
|
|
@ -273,6 +273,18 @@ class externallib_test extends externallib_advanced_testcase {
|
|||
$this->assertCount(0, $result['warnings']);
|
||||
$this->assertEquals($expected, $result['settings']);
|
||||
|
||||
// H5P custom CSS.
|
||||
set_config('h5pcustomcss', '.debug { color: #fab; }', 'core_h5p');
|
||||
\core_h5p\local\library\autoloader::register();
|
||||
\core_h5p\file_storage::generate_custom_styles();
|
||||
$result = external::get_config();
|
||||
$result = external_api::clean_returnvalue(external::get_config_returns(), $result);
|
||||
|
||||
$customcss = \core_h5p\file_storage::get_custom_styles();
|
||||
$expected[] = ['name' => 'h5pcustomcssurl', 'value' => $customcss['cssurl']->out() . '?ver=' . $customcss['cssversion']];
|
||||
$this->assertCount(0, $result['warnings']);
|
||||
$this->assertEquals($expected, $result['settings']);
|
||||
|
||||
// Change a value and retrieve filtering by section.
|
||||
set_config('commentsperpage', 1);
|
||||
$expected[10]['value'] = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue