. function get_editing_button ($id, $edit) { $options = array('id' => $id); if (!$edit) { $options['edit'] = 1; } $string = $edit ? get_string('turneditingoff') : get_string('turneditingon'); return new single_button(new moodle_url('view.php', $options), $string, 'get'); }