Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1380 ariadna 1
<?php
2
defined('MOODLE_INTERNAL') || die();
3
 
4
function theme_universe_child_inherit_settings()
5
{
6
    global $CFG;
7
 
8
    // Get parent theme settings
9
    $parent_settings = [];
10
    $parent_settings_dir = $CFG->dirroot . '/theme/universe/settings/';
11
 
12
    if (is_dir($parent_settings_dir)) {
13
        $files = scandir($parent_settings_dir);
14
        foreach ($files as $file) {
15
            if (pathinfo($file, PATHINFO_EXTENSION) === 'php') {
16
                $parent_settings[] = $file;
17
            }
18
        }
19
    }
20
 
21
    return $parent_settings;
22
}
23
 
24
function theme_universe_child_apply_settings($settings)
25
{
26
    global $CFG;
27
 
28
    // Apply parent theme settings to child theme
29
    foreach ($settings as $setting) {
30
        $parent_setting = $CFG->dirroot . '/theme/universe/settings/' . $setting;
31
        if (file_exists($parent_setting)) {
32
            require_once($parent_setting);
33
        }
34
    }
35
}