Proyectos de Subversion Moodle

Rev

Rev 1342 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1342 Rev 1344
Línea 25... Línea 25...
25
 
25
 
Línea 26... Línea 26...
26
defined('MOODLE_INTERNAL') || die();
26
defined('MOODLE_INTERNAL') || die();
27
 
27
 
28
// Advanced settings.
28
// Advanced settings.
29
$page = new admin_settingpage(
29
$page = new admin_settingpage(
30
    'theme_universe_advanced',
30
    'theme_universe_child_advanced',
Línea 31... Línea 31...
31
    get_string('advancedsettings', 'theme_universe')
31
    get_string('advancedsettings', 'theme_universe_child')
32
);
32
);
33
 
33
 
34
// H5P custom CSS.
34
// H5P custom CSS.
35
$setting = new admin_setting_configtextarea(
35
$setting = new admin_setting_configtextarea(
-
 
36
    'theme_universe_child/hvpcss',
-
 
37
    get_string('hvpcss', 'theme_universe_child'),
36
    'theme_universe/hvpcss',
38
    get_string('hvpcss_desc', 'theme_universe_child'),
Línea 37... Línea 39...
37
    get_string('hvpcss', 'theme_universe'),
39
    ''
38
    get_string('hvpcss_desc', 'theme_universe'), '');
40
);
39
$page->add($setting);
41
$page->add($setting);
40
 
42
 
41
// Raw SCSS to include before the content.
43
// Raw SCSS to include before the content.
42
$setting = new admin_setting_scsscode(
44
$setting = new admin_setting_scsscode(
43
    'theme_universe/scsspre',
45
    'theme_universe_child/scsspre',
44
    get_string('rawscsspre', 'theme_universe'),
46
    get_string('rawscsspre', 'theme_universe_child'),
45
    get_string('rawscsspre_desc', 'theme_universe'),
47
    get_string('rawscsspre_desc', 'theme_universe_child'),
46
    '',
48
    '',
Línea 47... Línea 49...
47
    PARAM_RAW
49
    PARAM_RAW
48
);
50
);
49
$setting->set_updatedcallback('theme_reset_all_caches');
51
$setting->set_updatedcallback('theme_reset_all_caches');
50
$page->add($setting);
52
$page->add($setting);
51
 
53
 
52
// Raw SCSS to include after the content.
54
// Raw SCSS to include after the content.
53
$setting = new admin_setting_scsscode(
55
$setting = new admin_setting_scsscode(
54
    'theme_universe/scss',
56
    'theme_universe_child/scss',
55
    get_string('rawscss', 'theme_universe'),
57
    get_string('rawscss', 'theme_universe_child'),
56
    get_string('rawscss_desc', 'theme_universe'),
58
    get_string('rawscss_desc', 'theme_universe_child'),
Línea 57... Línea 59...
57
    '',
59
    '',
58
    PARAM_RAW
60
    PARAM_RAW
59
);
61
);
60
$setting->set_updatedcallback('theme_reset_all_caches');
62
$setting->set_updatedcallback('theme_reset_all_caches');
61
$page->add($setting);
63
$page->add($setting);
62
 
64
 
63
// Font files upload.
65
// Font files upload.
-
 
66
// Setting: Custom fonts.
-
 
67
$name = 'theme_universe_child/fontfiles';
-
 
68
$title = get_string('customfontssetting', 'theme_universe', null, true);
-
 
69
$description = get_string('customfontssetting_desc', 'theme_universe', null, true);
-
 
70
if ($registerfontsresult == true) {
64
// Setting: Custom fonts.
71
    $setting = new admin_setting_configstoredfile(
-
 
72
        $name,
65
$name = 'theme_universe/fontfiles';
73
        $title,
66
$title = get_string('customfontssetting', 'theme_universe', null, true);
74
        $description,
-
 
75
        'fontfiles',
-
 
76
        0,
-
 
77
        ['maxfiles' => -1, 'accepted_types' => theme_universe_get_webfonts_extensions()]
-
 
78
    );
-
 
79
} else {
67
$description = get_string('customfontssetting_desc', 'theme_universe', null, true);
80
    $setting = new admin_setting_configstoredfile(
-
 
81
        $name,
68
if ($registerfontsresult == true) {
82
        $title,
69
    $setting = new admin_setting_configstoredfile($name, $title, $description, 'fontfiles', 0,
83
        $description,
Línea 70... Línea 84...
70
            ['maxfiles' => -1, 'accepted_types' => theme_universe_get_webfonts_extensions()]);
84
        'fontfiles',
71
} else {
85
        0,
Línea 94... Línea 108...
94
 
108
 
95
// Additional files
109
// Additional files
96
$name = 'theme_universe/additionalresources';
110
$name = 'theme_universe/additionalresources';
97
$title = get_string('additionalresourcessetting', 'theme_universe', null, true);
111
$title = get_string('additionalresourcessetting', 'theme_universe', null, true);
98
$description = get_string('additionalresourcessetting_desc', 'theme_universe', null, true);
112
$description = get_string('additionalresourcessetting_desc', 'theme_universe', null, true);
-
 
113
$setting = new admin_setting_configstoredfile(
-
 
114
    $name,
-
 
115
    $title,
-
 
116
    $description,
-
 
117
    'additionalresources',
99
$setting = new admin_setting_configstoredfile($name, $title, $description, 'additionalresources', 0,
118
    0,
-
 
119
    ['maxfiles' => -1]
100
        ['maxfiles' => -1]);
120
);
Línea 101... Línea 121...
101
$page->add($setting);
121
$page->add($setting);
102
 
122
 
103
// Information: Additional resources list.
123
// Information: Additional resources list.
104
// If there is at least one file uploaded.
124
// If there is at least one file uploaded.
105
if (!empty(get_config('theme_universe', 'additionalresources'))) {
125
if (!empty(get_config('theme_universe', 'additionalresources'))) {
106
    // Prepare the widget.
126
    // Prepare the widget.
107
    $name = 'theme_universe/additionalresourceslist';
127
    $name = 'theme_universe/additionalresourceslist';
108
    $title = get_string('additionalresourceslistsetting', 'theme_universe', null, true);
128
    $title = get_string('additionalresourceslistsetting', 'theme_universe', null, true);
Línea 109... Línea 129...
109
    $description = get_string('additionalresourceslistsetting_desc', 'theme_universe', null, true).'<br /><br />'.
129
    $description = get_string('additionalresourceslistsetting_desc', 'theme_universe', null, true) . '<br /><br />' .
110
            get_string('resourcescachecontrolnote', 'theme_universe', null, true);
130
        get_string('resourcescachecontrolnote', 'theme_universe', null, true);
-
 
131
 
111
 
132
    // Append the file list to the description.
112
    // Append the file list to the description.
133
    $templatecontext = ['files' => theme_universe_get_additionalresources_templatecontext()];
-
 
134
    $description .= $OUTPUT->render_from_template(
Línea 113... Línea 135...
113
    $templatecontext = ['files' => theme_universe_get_additionalresources_templatecontext()];
135
        'theme_universe/settings-additionalresources-filelist',
114
    $description .= $OUTPUT->render_from_template('theme_universe/settings-additionalresources-filelist',
136
        $templatecontext
115
            $templatecontext);
137
    );
116
 
138