[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/course/format/weeks/ -> lib.php (summary)

This file contains main class for the course format Weeks

Copyright: 2009 Sam Hemelryk
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 382 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

format_weeks:: (12 methods):
  uses_sections()
  get_section_name()
  get_view_url()
  supports_ajax()
  extend_course_navigation()
  ajax_section_move()
  get_default_blocks()
  course_format_options()
  create_edit_form_elements()
  update_course_format_options()
  get_section_dates()
  is_section_current()


Class: format_weeks  - X-Ref

Main class for the Weeks course format

uses_sections()   X-Ref
Returns true if this course format uses sections

return: bool

get_section_name($section)   X-Ref
Returns the display name of the given section that the course prefers.

param: int|stdClass $section Section object from database or just field section.section
return: string Display name that the course format prefers, e.g. "Topic 2"

get_view_url($section, $options = array()   X-Ref
The URL to use for the specified course (with section)

param: int|stdClass $section Section object from database or just field course_sections.section
param: array $options options for view URL. At the moment core uses:
return: null|moodle_url

supports_ajax()   X-Ref
Returns the information about the ajax support in the given source format

The returned object's property (boolean)capable indicates that
the course format supports Moodle course ajax features.

return: stdClass

extend_course_navigation($navigation, navigation_node $node)   X-Ref
Loads all of the course sections into the navigation

param: global_navigation $navigation
param: navigation_node $node The course node within the navigation

ajax_section_move()   X-Ref
Custom action after section has been moved in AJAX mode

Used in course/rest.php

return: array This will be passed in ajax respose

get_default_blocks()   X-Ref
Returns the list of blocks to be automatically added for the newly created course

return: array of default blocks, must contain two keys BLOCK_POS_LEFT and BLOCK_POS_RIGHT

course_format_options($foreditform = false)   X-Ref
Definitions of the additional options that this course format uses for course

Weeks format uses the following options:
- coursedisplay
- numsections
- hiddensections

param: bool $foreditform
return: array of options

create_edit_form_elements(&$mform, $forsection = false)   X-Ref
Adds format options elements to the course/section edit form.

This function is called from {@link course_edit_form::definition_after_data()}.

param: MoodleQuickForm $mform form the elements are added to.
param: bool $forsection 'true' if this is a section edit form, 'false' if this is course edit form.
return: array array of references to the added form elements.

update_course_format_options($data, $oldcourse = null)   X-Ref
Updates format options for a course

In case if course format was changed to 'weeks', we try to copy options
'coursedisplay', 'numsections' and 'hiddensections' from the previous format.
If previous course format did not have 'numsections' option, we populate it with the
current number of sections

param: stdClass|array $data return value from {@link moodleform::get_data()} or array with data
param: stdClass $oldcourse if this function is called from {@link update_course()}
return: bool whether there were any changes to the options values

get_section_dates($section)   X-Ref
Return the start and end date of the passed section

param: int|stdClass|section_info $section section to get the dates for
return: stdClass property start for startdate, property end for enddate

is_section_current($section)   X-Ref
Returns true if the specified week is current

param: int|stdClass|section_info $section
return: bool



Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1