Skip to content

Commit

Permalink
MDL-83561 format_social: Limit visible sections in social
Browse files Browse the repository at this point in the history
* Only the first section is visible in social format, so we
limit the visibility of the section to the first section.
This impacts the move dialog.
  • Loading branch information
laurentdavid committed Nov 19, 2024
1 parent d748b10 commit fd8b1d8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions course/format/social/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,18 @@ public function get_max_sections() {
// Social ony uses one section.
return 1;
}

/**
* Returns if an specific section is visible to the current user.
*
* Formats can overrride this method to implement any special section logic.
*
* @param section_info $section the section modinfo
* @return bool;
*/
#[\Override]
public function is_section_visible(section_info $section): bool {
$visible = parent::is_section_visible($section);
return $visible && $section->section == 0;
}
}

0 comments on commit fd8b1d8

Please sign in to comment.