3273 Commits

Author SHA1 Message Date
Dan Poltawski
6b02cc4fc1 MDL-35768 - fix E_STRICT issue 2012-11-05 14:31:54 +08:00
Marina Glancy
8d8d4da44d MDL-36017 renamed formatoptions to courseformatoptions in externallib 2012-11-05 11:40:03 +08:00
Marina Glancy
850acb3560 MDL-35768 MDL-36017 Avoid calling format_base::get_course() when not necessary
- If we want to check fields 'numsections' or 'hiddensections' call course_get_format()->get_format_options()
- We still use extended course object in course/edit.php, update_course(), create_course(), and inside course formats
2012-11-05 11:22:06 +08:00
Marina Glancy
92d38668ac MDL-35768 MDL-36017 code style corrections 2012-11-02 13:53:48 +08:00
Marina Glancy
0e984d9809 MDL-36017 Course now may have format-specific options, numsections and hiddensections are among them 2012-11-02 10:56:22 +08:00
Marina Glancy
b5cf83f080 MDL-36017 Fields numsections, hiddensections and coursedisplay are now format-specific options
- Fields added to format_legacy as default course format options;
- Upgrade script copies fields values from table course to course_format_options;
- Fields removed from table course;
- Fields removed from edit course form;
- Since front-page course has a 'numsections' setting, format_site defines it as it's option;
- Removed accessing those fields in core code unless we know that format supports them and in this
  case instead of $course = $DB->get_record('course'); we use:
  $course = course_get_format($courseorid)->get_course(); This way all format-specific options
  are added to the $course object
2012-11-02 10:56:19 +08:00
Marina Glancy
7b7d2f4d12 MDL-36017 Added default fields to format_legacy::course_format_options()
Fields coursedisplay, numsections, hiddensections are now the default fields for formats being converted from Moodle 2.3 or earlier
2012-11-02 10:55:24 +08:00
Marina Glancy
aea2e3c30d MDL-35768 Allow caching of section format options in course.sectioncache 2012-11-02 10:55:24 +08:00
Marina Glancy
fc79ede5a1 MDL-35768 Added format-specific options to edit course and section forms
- Course format may define additional fields (format options) to store for course and each section
- Edit course form allows to edit format-specific options and refreshes their list on format change
- Course format may provide it's own form for editing a section
- Default form for editing section allows to edit all format-specific fields
- Class section_info refactored, it defines magic methods such as __get() to access basic section
  information and format-specific options (retrieved only on the first request)
- format_base::update_course_format_options() allows to watch pre-update state of the course,
  format_legacy automatically copies the options with the same names between formats
2012-11-02 10:55:23 +08:00
Dan Poltawski
0caa0c869b Merge branch 'MDL-4655-master' of git://github.com/FMCorz/moodle 2012-10-30 11:58:34 +08:00
Sam Hemelryk
558aecf818 Merge branch 'wip-mdl-36131' of git://github.com/rajeshtaneja/moodle 2012-10-30 12:24:31 +13:00
Dan Poltawski
09f2367617 MDL-34354 - remove unused line 2012-10-29 14:54:14 +08:00
Dan Poltawski
02309e2d50 Merge branch 'MDL-34354-master' of git://git.luns.net.uk/moodle 2012-10-29 14:53:43 +08:00
Andrew Robert Nicols
afe3566cca MDL-35836 Rewrite doctonewwindow handling to use delegation instead of individual events 2012-10-26 08:52:23 +08:00
Rajesh Taneja
57bda78540 MDL-36131 AJAX: Conditional activities will behave same as in non-ajax mode 2012-10-19 17:10:25 +08:00
Frederic Massart
3b7bfbb5b8 MDL-4655 course: Number of courses with summaries to display is configurable 2012-10-18 11:07:17 +08:00
Dan Poltawski
9b0a3e17ba Merge branch 'wip-MDL-35769-master' of git://github.com/marinaglancy/moodle 2012-10-16 13:41:17 +08:00
Sam Hemelryk
8422094d91 Merge branch 'MDL-35198' of git://github.com/mouneyrac/moodle 2012-10-16 11:23:24 +08:00
Dan Poltawski
43c7341b82 Merge branch 'wip-MDL-32184-master' of http://github.com/phalacee/moodle 2012-10-16 10:48:23 +08:00
Dan Poltawski
0651778e95 Merge branch 'MDL-32294-master' of git://github.com/FMCorz/moodle 2012-10-16 10:41:24 +08:00
Marina Glancy
44aa854e93 MDL-35339 coding style corrections 2012-10-15 16:57:25 +08:00
Marina Glancy
2e4c0d05e1 MDL-35339 Fixing rebase with MDL-35634 2012-10-15 16:18:55 +08:00
Marina Glancy
a49e2ea7e6 MDL-35769 Course formats: Added function format_base::default_blocks() to replace format config.php 2012-10-15 14:14:33 +08:00
Marina Glancy
b46be6adf4 MDL-35339 Better cache reset for get_fast_modinfo(), allow exec get_fast_modinfo($courseid) 2012-10-15 14:08:15 +08:00
Marina Glancy
38b19bbca1 MDL-35339 call rebuild_course_cache() always (and only) after changing course modules or sections 2012-10-15 14:08:14 +08:00
Marina Glancy
384c3510a9 MDL-35339 Course functions unit tests 2012-10-15 14:08:14 +08:00
Marina Glancy
4ede27b253 MDL-35339 deprecate get_course_section() replace with course_create_sections_if_missing()
By passing course object instead of course id we ensure proper cache reset"
2012-10-15 14:08:14 +08:00
Marina Glancy
9796014660 MDL-35339 added deprecated information in upgrade.txt 2012-10-15 14:08:14 +08:00
Marina Glancy
eda43c7d10 MDL-35339 Use get_fast_modinfo() in course sections display functions
- Avoid using field course_sections.sequence for retrieving the modules list, use functionality from
get_fast_modinfo() instead;
- In the following functions/methods mark arguments $mod, $modnames, $modnamesused and $sections as
  not used because they can be taken any time from get_fast_modinfo():
  - function print_section()
  - protected function format_section_renderer_base::section_summary()
  - private function format_section_renderer_base::section_activity_summary
  - public function format_section_renderer_base::print_single_section_page
  - public function format_section_renderer_base::print_multiple_section_page
2012-10-15 14:08:13 +08:00
Marina Glancy
d57aa283f7 MDL-35339 Deprecate get_all_mods() add get_module_types_names()
- added function get_module_types_names() returning the list of localised strings used for module names;
- added function cm_info::get_used_module_names();
- added magic properties cm_info:: and cm_info:: returning human readable module name;
- replaced usage of function get_all_mods() with get_fast_modinfo() and get_module_types_names();
- function print_section_add_menus() may now retrieve the modules names list itself;
- deprecated function get_all_mods()
2012-10-15 14:08:13 +08:00
Marina Glancy
722e6ba947 MDL-35339 Deprecate add_mod_to_section(), create new function course_add_cm_to_section()
Function add_mod_to_section() has very confusing arguments when object  looks like record from
table course_modules but field ->section refers to relative section number (course_sections.section).
In table course_modules the field section refers to course_sections.id.
Also add_mod_to_section() does not update table course_modules and does not call rebuild_course_cache()
which developer can forget to do afterwards.

- Added function course_add_cm_to_section()
- In the core code add_mod_to_section() is replaced with course_add_cm_to_section()
- Function add_mod_to_section() is deprecated
2012-10-15 14:08:13 +08:00
Marina Glancy
99e9f9a69d MDL-35339 deprecate function get_all_sections() 2012-10-15 14:08:13 +08:00
Marina Glancy
71a56e08c8 MDL-35339 avoid using get_all_sections(), get_all_mods() and field section.sequence directly 2012-10-15 14:08:13 +08:00
Frederic Massart
4c897a815c MDL-32294 course: Add resource/activity dropdown have labels 2012-10-15 09:46:02 +08:00
Andrew Robert Nicols
a0bef1fb08 MDL-34354 Set default width for all chooser dialogues 2012-10-12 10:21:28 +01:00
Eloy Lafuente (stronk7)
28990bbef4 Merge branch 'MDL-35715-master' of git://git.luns.net.uk/moodle 2012-10-11 01:48:53 +02:00
Aparup Banerjee
d022f63202 MDL-35587 fixed up whitespaces 2012-10-09 16:35:32 +08:00
Aparup Banerjee
832e5f5957 Merge branch 'MDL-35587' of git://github.com/rlorenzo/moodle 2012-10-09 16:27:28 +08:00
Eloy Lafuente (stronk7)
3b950bab64 Merge branch 'w41_MDL-35382_m24_reordertest' of git://github.com/skodak/moodle 2012-10-08 23:54:36 +02:00
Eloy Lafuente (stronk7)
69d2746dd2 Revert "MDL-34894 course ws unit tests: fix windows problem."
This reverts commit 954c272e548c0578fde9d1bc0979ac46b72bc3b9.

With MDL-35714, each test gets gc_collect_cycles() called, so
no need to call it "manually".
2012-10-08 22:57:50 +02:00
Aparup Banerjee
db739bf096 Merge branch 'wip-MDL-35694' of git://github.com/jennymgray/moodle 2012-10-08 17:24:53 +08:00
Sam Hemelryk
dc67f522cf Merge branch 'MDL-35634-master' of git://github.com/FMCorz/moodle 2012-10-08 11:36:57 +13:00
Petr Skoda
3a222db215 MDL-35382 fix random course test failures 2012-10-06 13:27:04 +02:00
Jenny Gray
e85a341292 MDL-35694 logs: extend course log report downloads with action url 2012-10-05 09:17:40 +01:00
Jason Fowler
52fc56a79d MDL-32184 - Course - Fixing incorrect redirect when toggling course edit while inside an activity -- Patch provided by Kanika Goyal 2012-10-05 11:44:47 +08:00
Frederic Massart
ddb16bdd38 MDL-35634 course: Restored alt attribute on module icons 2012-10-03 17:03:35 +08:00
Ruslan Kabalin
9d7525fb1a MDL-35715 course dragdrop Fix the ability to drag back to the empty section 2012-10-02 14:35:28 +01:00
Dan Poltawski
0d24043d66 Merge branch 'wip-MDL-35263-master' of git://github.com/marinaglancy/moodle 2012-10-02 12:49:26 +08:00
Marina Glancy
76ab3fa18f MDL-35263 corrected coding style 2012-10-02 12:23:43 +08:00
Eloy Lafuente (stronk7)
8614cd72f0 Merge branch 'MDL-34657' of git://github.com/timhunt/moodle 2012-10-01 23:22:39 +02:00