course->controller->is_loaded() == false) { //TODO: more appropriate error message? error(get_string('objectauthnotfound','sloodle')); exit(); } // Make sure the user has permission to manage activities on this course $course_context = get_context_instance(CONTEXT_COURSE, $auth_obj->course->get_course_id()); require_capability('moodle/course:manageactivities', $course_context); // Delete all configuration options already associated with the object sloodle_delete_records('sloodle_object_config', 'object', $sloodleauthid); // Define parameter names we will ignore $IGNORE_PARAMS = array('sloodleauthid', 'sloodledebug'); // This structure will store our values $config_setting = new stdClass(); $config_setting->object = $sloodleauthid; // Add the new ones $numstored = 0; foreach ($_REQUEST as $k => $v) { // Ignore anything which does not start with "sloodle" if (strpos($k, 'sloodle') !== 0) continue; // Ignore certain parameters if (in_array($k, $IGNORE_PARAMS)) continue; // Store the setting $config_setting->name = $k; $config_setting->value = $v; if (sloodle_insert_record('sloodle_object_config', $config_setting)) { $numstored++; } } // Construct a breadcrumb navigation menu $nav = get_string('modulename', 'sloodle').' -> '; $nav .= get_string('objectconfiguration','sloodle'); // Display the page header sloodle_print_header(get_string('objectconfiguration','sloodle'), get_string('objectconfiguration','sloodle'), $nav, '', '', false); // Display the information about the object sloodle_print_box_start('generalbox boxaligncenter boxwidthnarrow'); echo '