X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=blobdiff_plain;f=lib%2Fdeprecatedlib.php;h=900b6e72b93e63ca02039fac65f11184edd7a4ea;hp=1a2b205c15e66f9ad047fb0cca77d1ec5be3837b;hb=1b2581f43028ea14dab26aaebe1c4da60c882eff;hpb=0f070867b8a7515de4f5858e7e5119a7ad7a6e61;ds=sidebyside diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index 1a2b205c15e..900b6e72b93 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -3044,3 +3044,24 @@ function get_course_section($section, $courseid) { rebuild_course_cache($courseid, true); return $DB->get_record("course_sections", array("id"=>$id)); } + +/** + * Return the start and end date of the week in Weekly course format + * + * It is not recommended to use this function outside of format_weeks plugin + * + * @deprecated since 2.4 + * @see format_weeks::get_section_dates() + * + * @param stdClass $section The course_section entry from the DB + * @param stdClass $course The course entry from DB + * @return stdClass property start for startdate, property end for enddate + */ +function format_weeks_get_section_dates($section, $course) { + debugging('Function format_weeks_get_section_dates() is deprecated. It is not recommended to'. + ' use it outside of format_weeks plugin', DEBUG_DEVELOPER); + if (isset($course->format) && $course->format === 'weeks') { + return course_get_format($course)->get_section_dates($section); + } + return null; +}