Merged from 1.7.

This commit is contained in:
vyshane 2006-11-22 07:36:41 +00:00
parent 22206b6722
commit 607c1bc1c6
2 changed files with 16 additions and 2 deletions

View 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);

View File

@ -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;
}