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);
var spacer = YAHOO.util.Dom.getElementsByClassName('spacer',
'img', this.getEl())[0];
if (!spacer) {
- return;
+ return false;
}
if (spacer.width > 20) {
spacer.width -= 20;
commandContainer.removeChild(indentLeftBtn);
}
- return;
+ main.connect('POST', 'class=resource&field=indentleft', null, 'id='+this.id);
+ return true;
}
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;
}