/** * Adds a videofile instance * * @param stdClass $data * @param mod_videofile_mod_form $form * @return int The instance id of the new videofile instance */ function videofile_add_instance(stdClass $data, mod_videofile_mod_form $form = null) { require_once dirname(__FILE__) . '/locallib.php'; $context = context_module::instance($data->coursemodule); $videofile = new videofile($context, null, null); return $videofile->add_instance($data); }