Skip to content

Commit

Permalink
MDL-73362 lesson: Bring tertiary nav changes into classic
Browse files Browse the repository at this point in the history
- Remove usage of lesson's tabs.php
- Add tertiary navigation into classic as the other modules do
  • Loading branch information
Peter Dias committed Jan 17, 2022
1 parent 0e18847 commit 0e1b096
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 2 additions & 4 deletions mod/lesson/edit.php
Expand Up @@ -57,10 +57,8 @@
$PAGE->navbar->add(get_string('edit'));

echo $lessonoutput->header($lesson, $cm, $mode, false, null, get_string('edit', 'lesson'));
if ($PAGE->has_secondary_navigation()) {
$actionarea = new \mod_lesson\output\edit_action_area($id, $url);
echo $lessonoutput->render($actionarea);
}
$actionarea = new \mod_lesson\output\edit_action_area($id, $url);
echo $lessonoutput->render($actionarea);

if (!$lesson->has_pages()) {
// There are no pages; give teacher some options
Expand Down
5 changes: 5 additions & 0 deletions mod/lesson/locallib.php
Expand Up @@ -570,13 +570,18 @@ function lesson_menu_block_contents($cmid, $lesson) {
/**
* Adds header buttons to the page for the lesson
*
* @deprecated since Moodle 4.0 in favour of tertiary navigation.
* @todo MDL-73545 This will be deleted in Moodle 4.4
* @param object $cm
* @param object $context
* @param bool $extraeditbuttons
* @param int $lessonpageid
*/
function lesson_add_header_buttons($cm, $context, $extraeditbuttons=false, $lessonpageid=null) {
global $CFG, $PAGE, $OUTPUT;

debugging('lesson_add_header_buttons() is deprecated in favour of tertiary navigation.', DEBUG_DEVELOPER);

if (has_capability('mod/lesson:edit', $context) && $extraeditbuttons) {
if ($lessonpageid === null) {
print_error('invalidpageid', 'lesson');
Expand Down
6 changes: 0 additions & 6 deletions mod/lesson/renderer.php
Expand Up @@ -72,12 +72,6 @@ public function header($lesson, $cm, $currenttab = '', $extraeditbuttons = false
}

$output = $this->output->header();
if ($canmanage && !empty($currenttab) && !$this->page->has_secondary_navigation()) {
ob_start();
include($CFG->dirroot.'/mod/lesson/tabs.php');
$output .= ob_get_contents();
ob_end_clean();
}

foreach ($lesson->messages as $message) {
$output .= $this->output->notification($message[0], $message[1], $message[2]);
Expand Down
3 changes: 3 additions & 0 deletions mod/lesson/upgrade.txt
@@ -1,5 +1,8 @@
This files describes API changes in the lesson code.

=== 4.0 ===
* Deprecated the function lesson_add_header_buttons in favour of tertiary navigation.

=== 3.6.1 ===

* A new function update_form_data() has been added to lesson_page class. This can be overridden by the individual page types
Expand Down

0 comments on commit 0e1b096

Please sign in to comment.