Proyectos de Subversion Moodle

Rev

Rev 1377 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1377 Rev 1378
Línea 159... Línea 159...
159
 */
159
 */
160
function theme_universe_child_is_guest_in_course($context, $userid)
160
function theme_universe_child_is_guest_in_course($context, $userid)
161
{
161
{
162
    return is_guest($context, $userid);
162
    return is_guest($context, $userid);
163
}
163
}
164
 
-
 
165
/**
-
 
166
 * Get all parent theme settings
-
 
167
 * @return array Array of parent theme settings
-
 
168
 */
-
 
169
function theme_universe_child_get_parent_settings()
-
 
170
{
-
 
171
    global $CFG;
-
 
172
 
-
 
173
    $settings = [];
-
 
174
    $parent_settings_dir = $CFG->dirroot . '/theme/universe/settings/';
-
 
175
 
-
 
176
    if (is_dir($parent_settings_dir)) {
-
 
177
        $files = scandir($parent_settings_dir);
-
 
178
        foreach ($files as $file) {
-
 
179
            if (pathinfo($file, PATHINFO_EXTENSION) === 'php') {
-
 
180
                $settings[] = $file;
-
 
181
            }
-
 
182
        }
-
 
183
    }
-
 
184
 
-
 
185
    return $settings;
-
 
186
}
-
 
187
 
-
 
188
/**
-
 
189
 * Apply parent theme settings to child theme
-
 
190
 * @param array $settings Array of settings to apply
-
 
191
 */
-
 
192
function theme_universe_child_apply_parent_settings($settings)
-
 
193
{
-
 
194
    global $CFG;
-
 
195
 
-
 
196
    foreach ($settings as $setting) {
-
 
197
        $parent_setting = $CFG->dirroot . '/theme/universe/settings/' . $setting;
-
 
198
        if (file_exists($parent_setting)) {
-
 
199
            require_once($parent_setting);
-
 
200
        }
-
 
201
    }
-
 
202
}
-