From 607c1bc1c6bed54cf8c61e842f4cc27f92391017 Mon Sep 17 00:00:00 2001 From: vyshane Date: Wed, 22 Nov 2006 07:36:41 +0000 Subject: [PATCH] Merged from 1.7. --- course/rest.php | 12 ++++++++++++ lib/ajax/section_classes.js | 6 ++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/course/rest.php b/course/rest.php index ac04a75c25..e47e04f0f1 100644 --- a/course/rest.php +++ b/course/rest.php @@ -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); diff --git a/lib/ajax/section_classes.js b/lib/ajax/section_classes.js index ed0f2088a0..82c70336e5 100755 --- a/lib/ajax/section_classes.js +++ b/lib/ajax/section_classes.js @@ -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; } -- 2.39.5