[ Index ]

PHP Cross Reference of Unnamed Project

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: 476 lines (19 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

format_weeks:: (16 methods):
  uses_sections()
  get_section_name()
  get_default_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()
  can_delete_section()
  inplace_editable_render_section_name()
  format_weeks_inplace_editable()


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_default_section_name($section)   X-Ref
Returns the default section name for the weekly course format.

If the section number is 0, it will use the string with key = section0name from the course format's lang file.
Otherwise, the default format of "[start date] - [end date]" will be returned.

param: stdClass $section Section object from database or just field course_sections section
return: string The default value for the section name.

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

can_delete_section($section)   X-Ref
Whether this format allows to delete sections

Do not call this function directly, instead use {@link course_can_delete_section()}

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

inplace_editable_render_section_name($section, $linkifneeded = true,$editable = null, $edithint = null, $editlabel = null)   X-Ref
Prepares the templateable object to display section name

param: \section_info|\stdClass $section
param: bool $linkifneeded
param: bool $editable
param: null|lang_string|string $edithint
param: null|lang_string|string $editlabel
return: \core\output\inplace_editable

format_weeks_inplace_editable($itemtype, $itemid, $newvalue)   X-Ref
Implements callback inplace_editable() allowing to edit values in-place

param: string $itemtype
param: int $itemid
param: mixed $newvalue
return: \core\output\inplace_editable



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1