]> git.mjollnir.org Git - moodle.git/commitdiff
Merged from 1.7.
authorvyshane <vyshane>
Wed, 22 Nov 2006 07:36:41 +0000 (07:36 +0000)
committervyshane <vyshane>
Wed, 22 Nov 2006 07:36:41 +0000 (07:36 +0000)
course/rest.php
lib/ajax/section_classes.js

index ac04a75c25730f141c907a110f1e9eae910b36d9..e47e04f0f12eb9c4c8833ecfd64d9bda77969541 100644 (file)
@@ -99,6 +99,18 @@ switch($_SERVER['REQUEST_METHOD']) {
                         set_coursemodule_groupmode($mod->id, $value);
                         break;
 
+                    case 'indentleft':
+                        if ($mod->indent > 0) {
+                            $mod->indent--;
+                            update_record('course_modules', $mod);
+                        }
+                        break;
+
+                    case 'indentright':
+                        $mod->indent++;
+                        update_record('course_modules', $mod);
+                        break;
+
                     case 'move':
                         if (!$section = get_record('course_sections','course',$course->id,'section',$sectionid)) {
                             error_log('AJAX commands.php: Bad section ID '.$sectionid);
index ed0f2088a09a8ba4066ab927ebffe2d791b1964b..82c70336e5924357d278e8787142ae003e9a9c1a 100755 (executable)
@@ -647,7 +647,7 @@ resource_class.prototype.indent_left = function() {
        var spacer = YAHOO.util.Dom.getElementsByClassName('spacer',
                                        'img', this.getEl())[0];
        if (!spacer) {
-               return;
+               return false;
        }
        if (spacer.width > 20) {
                spacer.width -= 20;
@@ -665,7 +665,8 @@ resource_class.prototype.indent_left = function() {
 
                commandContainer.removeChild(indentLeftBtn);
        }
-       return;
+       main.connect('POST', 'class=resource&field=indentleft', null, 'id='+this.id);
+       return true;
 }
 
 
@@ -702,6 +703,7 @@ resource_class.prototype.indent_right = function() {
                YAHOO.util.Event.addListener(button, 'click', this.indent_left, this, true);
                commandContainer.insertBefore(button, indentRightBtn);
        }
+       main.connect('POST', 'class=resource&field=indentright', null, 'id='+this.id);
        return true;
 }