MDL-32508 course: make_editting_buttons now takes optionally returns to section
authorDan Poltawski <dan@moodle.com>
Sat, 28 Apr 2012 05:56:35 +0000 (13:56 +0800)
committerDan Poltawski <dan@moodle.com>
Fri, 4 May 2012 02:53:00 +0000 (10:53 +0800)
course/lib.php

index f9dcab0..5b7f13a 100644 (file)
@@ -1372,7 +1372,7 @@ function get_print_section_cm_text(cm_info $cm, $course) {
 /**
  * Prints a section full of activity modules
  */
-function print_section($course, $section, $mods, $modnamesused, $absolute=false, $width="100%", $hidecompletion=false) {
+function print_section($course, $section, $mods, $modnamesused, $absolute=false, $width="100%", $hidecompletion=false, $sectionreturn = false) {
     global $CFG, $USER, $DB, $PAGE, $OUTPUT;
 
     static $initialised;
@@ -1643,7 +1643,12 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
                     $mod->groupmode = false;
                 }
                 echo '&nbsp;&nbsp;';
-                echo make_editing_buttons($mod, $absolute, true, $mod->indent, $section->section);
+
+                if ($sectionreturn) {
+                    echo make_editing_buttons($mod, $absolute, true, $mod->indent, $section->section);
+                } else {
+                    echo make_editing_buttons($mod, $absolute, true, $mod->indent, 0);
+                }
                 echo $mod->get_after_edit_icons();
             }