Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 30... Línea 30...
30
 
30
 
31
$sectionid = required_param('id', PARAM_INT);
31
$sectionid = required_param('id', PARAM_INT);
32
// This parameter is used by the classic theme to force editing on.
32
// This parameter is used by the classic theme to force editing on.
Línea 33... Línea 33...
33
$edit = optional_param('edit', -1, PARAM_BOOL);
33
$edit = optional_param('edit', -1, PARAM_BOOL);
-
 
34
 
-
 
35
if (!$section = $DB->get_record('course_sections', ['id' => $sectionid], '*')) {
-
 
36
    $url = new moodle_url('/');
-
 
37
    $PAGE->set_context(\core\context\system::instance());
-
 
38
    $PAGE->set_url($url);
-
 
39
    $PAGE->set_pagelayout('course');
-
 
40
    $PAGE->add_body_classes(['limitedwidth', 'single-section-page']);
-
 
41
    $PAGE->set_title(get_string('notfound', 'error'));
-
 
42
    $PAGE->set_heading($SITE->fullname);
-
 
43
    echo $OUTPUT->header();
-
 
44
 
-
 
45
    $errortext = new \core\output\notification(
-
 
46
            get_string('sectioncantbefound', 'error'),
-
 
47
            \core\output\notification::NOTIFY_ERROR
-
 
48
    );
-
 
49
    echo $OUTPUT->render($errortext);
-
 
50
 
-
 
51
    $button = new single_button($url, get_string('gobacktosite'), 'get', single_button::BUTTON_PRIMARY);
-
 
52
    $button->class = 'continuebutton';
-
 
53
    echo $OUTPUT->render($button);
-
 
54
 
-
 
55
    echo $OUTPUT->footer();
Línea 34... Línea 56...
34
 
56
    die();
35
$section = $DB->get_record('course_sections', ['id' => $sectionid], '*', MUST_EXIST);
57
}
Línea 36... Línea 58...
36
 
58
 
Línea 124... Línea 146...
124
// Make the title more specific when editing, for accessibility reasons.
146
// Make the title more specific when editing, for accessibility reasons.
125
$editingtitle = '';
147
$editingtitle = '';
126
if ($PAGE->user_is_editing()) {
148
if ($PAGE->user_is_editing()) {
127
    $editingtitle = 'editing';
149
    $editingtitle = 'editing';
128
}
150
}
129
$sectionname = get_string('sectionname', "format_$course->format");
151
$sectionname = $format->get_generic_section_name();
130
$sectiontitle = get_section_name($course, $section);
152
$sectiontitle = $format->get_section_name($section);
131
$PAGE->set_title(
153
$PAGE->set_title(
132
    get_string(
154
    get_string(
133
        'coursesectiontitle' . $editingtitle,
155
        'coursesectiontitle' . $editingtitle,
134
        'moodle',
156
        'moodle',
135
        ['course' => $course->fullname, 'sectiontitle' => $sectiontitle, 'sectionname' => $sectionname]
157
        ['course' => $course->fullname, 'sectiontitle' => $sectiontitle, 'sectionname' => $sectionname]
Línea 174... Línea 196...
174
        $course->id
196
        $course->id
175
    );
197
    );
176
    $communication->show_communication_room_status_notification();
198
    $communication->show_communication_room_status_notification();
177
}
199
}
Línea 178... Línea 200...
178
 
200
 
179
// Display a warning if asynchronous backups are pending for this course.
201
$containerattributes = [];
180
if ($PAGE->user_is_editing()) {
202
if ($PAGE->user_is_editing()) {
-
 
203
    require_once($CFG->dirroot . '/backup/util/helper/async_helper.class.php');
181
    require_once($CFG->dirroot . '/backup/util/helper/async_helper.class.php');
204
    // Display a warning if asynchronous backups are pending for this course.
182
    if (async_helper::is_async_pending($course->id, 'course', 'backup')) {
205
    if (async_helper::is_async_pending($course->id, 'course', 'backup')) {
183
        echo $OUTPUT->notification(get_string('pendingasyncedit', 'backup'), 'warning');
206
        echo $OUTPUT->notification(get_string('pendingasyncedit', 'backup'), 'warning');
-
 
207
    }
-
 
208
 
-
 
209
    // Allow drag and drop in the course index.
-
 
210
    $containerattributes = [
-
 
211
        'data-courseindexdndallowed' => 'true',
184
    }
212
    ];
Línea 185... Línea 213...
185
}
213
}
Línea 186... Línea 214...
186
 
214
 
187
echo $renderer->container_start('course-content');
215
echo $renderer->container_start('course-content', attributes: $containerattributes);
Línea 188... Línea 216...
188
 
216