function hotpot_update_instance(&$hotpot) { if (hotpot_set_form_values($hotpot)) { $hotpot->id = $hotpot->instance; if ($result = update_record('hotpot', $hotpot)) { hotpot_update_events($hotpot); //hotpot_grade_item_update(stripslashes_recursive($hotpot)); hotpot_update_grades(stripslashes_recursive($hotpot)); } } else { $result = false; } return $result; }
/** * @global object * @param object $hotpot * @return bool */ function hotpot_update_instance($hotpot) { global $DB; if (hotpot_set_form_values($hotpot)) { $hotpot->id = $hotpot->instance; if ($result = $DB->update_record('hotpot', $hotpot)) { hotpot_update_events($hotpot); hotpot_update_grades($hotpot); } } else { $result = false; } return $result; }
function hotpot_update_instance(&$hotpot) { if (hotpot_set_form_values($hotpot)) { $hotpot->id = $hotpot->instance; if ($result = update_record('hotpot', $hotpot)) { hotpot_update_events($hotpot); } } else { $result = false; } return $result; }
/** * Update calendar events for a single HotPot activity * This function is intended to be called just after * a HotPot activity has been created or edited. * * @param xxx $hotpot */ function hotpot_update_events_wrapper($hotpot) { global $DB; if ($eventids = $DB->get_records('event', array('modulename' => 'hotpot', 'instance' => $hotpot->id), 'id', 'id')) { $eventids = array_keys($eventids); } else { $eventids = array(); } hotpot_update_events($hotpot, $eventids, true); }