Hello to all,
I have created a custom course report and I want to execute a custom function, which enrolls users to specific cohort, after clicking a button.
So, I want this:
if_I_click_the_button {
execute function
}
Something like 'Run now' on tasks page. This is the php code of 'run now':
$runnow = '';
if ( ! $disabled && get_config('tool_task', 'enablerunnow') && $runnabletasks ) {
$runnow = html_writer::div(html_writer::link(
new moodle_url('/admin/tool/task/schedule_task.php',
array('task' => get_class($task))),
get_string('runnow', 'tool_task')), 'task-runnow');
}
So, I want the same but not to 'call' moodle_url but a specific function.
How can I do this??
Thank you!
Andreas