我如何 select 一个主题并从 moodle config.php 文件更改主题配置?

How do I select a theme and change theme configuration from moodle config.php file?

我想通过在 config.php 中设置 $CFG-> 值来 select 一个主题。我怎样才能做到这一点? 另外,我想通过访问 config.php 文件中的 theme_moove | brandcolor 来更改主题中的品牌颜色。

目前,我可以在 config.php 中设置其他值,如下所示。

$CFG->enablemobilewebservice = true;

$CFG->passwordpolicy = false;

$CFG->updateautocheck = false;

我收到了 Leon Stringer 在 Moodle 论坛上对问题的回答。所以在这里分享它,因为有人可能会发现它对 SO 社区有用。

核心设置可以通过设置相应的$CFG 属性来设置,所以主题可以设置为:

$CFG->theme = 'moove';

插件设置(一个主题就是一个插件)用$CFG->forced_plugin_settings设置。这在“8.强制设置”下的 config-dist.php 中进行了描述。例如。设置 theme_moove | brandcolor:

$CFG->forced_plugin_settings = array('theme_moove'  => array('brandcolor' => '#022B78'));