Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Files | Namespaces | Classes | Functions | Variables
format_topics

Files

file  format.php
 Topics course format.
 
file  lib.php
 This file contains main class for the course format Topic.
 
file  provider.php
 Privacy Subsystem implementation for format_topics.
 
file  renderer.php
 Renderer for outputting the topics course format.
 
file  restore_format_topics_plugin.class.php
 Specialised restore for format_topics.
 
file  upgrade.php
 Upgrade scripts for course format "Topics".
 
file  upgradelib.php
 Upgrade scripts for course format "Topics".
 

Namespaces

 format_topics\privacy
  
 

Classes

class  format_topics
 Main class for the Topics course format. More...
 
class  format_topics\privacy\provider
 Privacy Subsystem for format_topics implementing null_provider. More...
 
class  format_topics_renderer
 Basic renderer for topics format. More...
 
class  restore_format_topics_plugin
 

Functions

 format_topics_inplace_editable ($itemtype, $itemid, $newvalue)
 Implements callback inplace_editable() allowing to edit values in-place. More...
 
 format_topics_upgrade_add_empty_sections ($courseid, $numsections)
 This method adds empty sections to courses which have fewer sections than their 'numsections' course format option and adds these empty sections. More...
 
 format_topics_upgrade_hide_extra_sections ($courseid, $numsections)
 Find all sections in the course with sectionnum bigger than numsections. More...
 
 format_topics_upgrade_remove_numsections ()
 This method finds all courses in 'topics' format that have actual number of sections different than their 'numsections' course format option. More...
 
 xmldb_format_topics_upgrade ($oldversion)
 Upgrade script for format_topics. More...
 

Variables

if($topic=optional_param('topic', 0, PARAM_INT)) $context = context_course::instance($course->id)
 
 $course = course_get_format($course)->get_course()
 
 $renderer = $PAGE->get_renderer('format_topics')
 
if(!empty($displaysection)) else
 

Detailed Description

Function Documentation

◆ format_topics_inplace_editable()

format_topics_inplace_editable (   $itemtype,
  $itemid,
  $newvalue 
)

Implements callback inplace_editable() allowing to edit values in-place.

Parameters
string$itemtype
int$itemid
mixed$newvalue
Return values
core

◆ format_topics_upgrade_add_empty_sections()

format_topics_upgrade_add_empty_sections (   $courseid,
  $numsections 
)

This method adds empty sections to courses which have fewer sections than their 'numsections' course format option and adds these empty sections.

Parameters
int$courseid
int$numsections

◆ format_topics_upgrade_hide_extra_sections()

format_topics_upgrade_hide_extra_sections (   $courseid,
  $numsections 
)

Find all sections in the course with sectionnum bigger than numsections.

Either delete these sections or hide them

We will only delete a section if it is completely empty and all sections below it are also empty

Parameters
int$courseid
int$numsections

◆ format_topics_upgrade_remove_numsections()

format_topics_upgrade_remove_numsections ( )

This method finds all courses in 'topics' format that have actual number of sections different than their 'numsections' course format option.

For courses where there are more sections than numsections, we call format_topics_upgrade_hide_extra_sections() and either delete or hide "orphaned" sections. For courses where there are fewer sections than numsections, we call format_topics_upgrade_add_empty_sections() to add these sections.

◆ xmldb_format_topics_upgrade()

xmldb_format_topics_upgrade (   $oldversion)

Upgrade script for format_topics.

Parameters
int$oldversionthe version we are upgrading from
Return values
boolresult

Variable Documentation

◆ else

if (!empty( $displaysection)) else
Initial value:
{
$renderer->print_multiple_section_page($course, null, null, null, null)