Proyectos de Subversion Moodle

Rev

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

Rev 887 Rev 888
Línea 97... Línea 97...
97
}
97
}
Línea 98... Línea 98...
98
 
98
 
99
$sidecourseblocks = $OUTPUT->blocks('sidecourseblocks');
99
$sidecourseblocks = $OUTPUT->blocks('sidecourseblocks');
Línea 100... Línea -...
100
$hassidecourseblocks = strpos($sidecourseblocks, 'data-block=') !== false;
-
 
101
 
-
 
102
if ($PAGE->course->enablecompletion == '1') {
-
 
103
    $extraclasses[] = 'rui-course--enablecompletion';
-
 
104
}
100
$hassidecourseblocks = strpos($sidecourseblocks, 'data-block=') !== false;
105
 
101
 
106
if ($draweropenright && $hasblocks) {
102
if ($draweropenright && $hasblocks) {
Línea -... Línea 103...
-
 
103
    $extraclasses[] = 'drawer-open-right';
-
 
104
}
-
 
105
 
-
 
106
if ($PAGE->course->enablecompletion == '1') {
107
    $extraclasses[] = 'drawer-open-right';
107
    $extraclasses[] = 'rui-course--enablecompletion';
108
}
108
}
109
 
109
 
Línea 110... Línea 110...
110
if ($PAGE->course->showactivitydates == '1') {
110
if ($PAGE->course->showactivitydates == '1') {
Línea 137... Línea 137...
137
// If the settings menu will be included in the header then don't add it here.
137
// If the settings menu will be included in the header then don't add it here.
138
$regionmainsettingsmenu = $buildregionmainsettings ? $OUTPUT->region_main_settings_menu() : false;
138
$regionmainsettingsmenu = $buildregionmainsettings ? $OUTPUT->region_main_settings_menu() : false;
Línea 139... Línea 139...
139
 
139
 
140
$header = $PAGE->activityheader;
140
$header = $PAGE->activityheader;
141
$headercontent = $header->export_for_template($renderer);
-
 
142
$completed = false;
-
 
143
 
-
 
144
$course_context = context_course::instance($COURSE->id);
-
 
145
$roles = get_user_roles($course_context, $USER->id, true);
-
 
146
 
-
 
147
$completion_visible = true;
-
 
148
foreach ($roles as $role) {
-
 
149
    if ($role->shortname != 'student') {
-
 
150
        $completion_visible  = false;
-
 
151
    }
-
 
152
}
-
 
153
 
-
 
154
if (!$completion_visible) {
-
 
155
    $completed = false;
-
 
156
}
-
 
157
 
-
 
158
$modules = get_fast_modinfo($COURSE->id)->get_cms();
-
 
159
 
-
 
160
$mods = [];
-
 
161
foreach ($modules as $module) {
-
 
162
    if (!$module->uservisible || $module->is_stealth() || empty($module->url)) {
-
 
163
        continue;
-
 
164
    }
-
 
165
    $mods[$module->id] = $module;
-
 
166
}
-
 
167
 
-
 
168
 
-
 
169
 
-
 
170
$nummods = count($mods);
-
 
171
 
-
 
172
// If there is only one mod then do nothing.
-
 
173
if ($nummods == 1) {
-
 
174
    $completed = false;
-
 
175
}
-
 
176
 
-
 
177
$modids = array_keys($mods);
-
 
178
$position = array_search($page_context->id, $modids);   //array_search($this->page->cm->id, $modids);
-
 
179
 
-
 
180
$currentmod = $mods[$modids[$position]];
-
 
181
 
-
 
182
/*if(!$currentmod->completion) {
-
 
183
    return '';
-
 
184
}*/
-
 
185
 
-
 
186
$completioninfo = new \completion_info($COURSE);
-
 
187
$completiondata = $completioninfo->get_data($currentmod, true);
-
 
188
if ($completiondata->completionstate == COMPLETION_COMPLETE && $completiondata->completionstate == COMPLETION_COMPLETE_PASS) {
-
 
189
    $completed = true;
-
 
190
}
-
 
Línea 191... Línea 141...
191
 
141
$headercontent = $header->export_for_template($renderer);
192
 
142
 
Línea 193... Línea 143...
193
// RUI.
143
// RUI.
Línea 239... Línea 189...
239
    'hasregionmainsettingsmenu' => !empty($regionmainsettingsmenu),
189
    'hasregionmainsettingsmenu' => !empty($regionmainsettingsmenu),
240
    'overflow' => $overflow,
190
    'overflow' => $overflow,
241
    'headercontent' => $headercontent,
191
    'headercontent' => $headercontent,
242
    'addblockbutton' => $addblockbutton,
192
    'addblockbutton' => $addblockbutton,
243
    'hidecourseindexnav' => $hidecourseindexnav,
193
    'hidecourseindexnav' => $hidecourseindexnav,
244
    'completed' => $completed
-
 
245
];
194
];
Línea 246... Línea 195...
246
 
195
 
247
// Get and use the course page information banners HTML code, if any course page hints are configured.
196
// Get and use the course page information banners HTML code, if any course page hints are configured.
248
$coursepageinformationbannershtml = theme_universe_get_course_information_banners();
197
$coursepageinformationbannershtml = theme_universe_get_course_information_banners();