Skip to content
Snippets Groups Projects
Commit fe15f410 authored by TamaraGunkel's avatar TamaraGunkel
Browse files

rEENAbled step interaction handling

parent 243a5a16
No related branches found
No related tags found
No related merge requests found
...@@ -36,12 +36,22 @@ defined('MOODLE_INTERNAL') || die(); ...@@ -36,12 +36,22 @@ defined('MOODLE_INTERNAL') || die();
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
class view_controller { class view_controller {
public function handle_view() {
/**
* Handles actions triggered in the view.php and displays the view.
*
* @param $action string triggered action code.
* @param $processid int id of the process the action was triggered for.
* @param $stepid int id of the step the action was triggerd for.
*/
public function handle_view($action, $processid, $stepid) {
global $USER, $DB, $OUTPUT; global $USER, $DB, $OUTPUT;
// if ($action && $processid) { // Handle action for step.
// interaction_manager::handle_interaction($stepinstance->id, $processid, $action); if ($action && $processid && $stepid) {
// } interaction_manager::handle_interaction($stepid, $processid, $action);
}
$courses = get_user_capability_course('tool/cleanupcourses:managecourses', $USER, false); $courses = get_user_capability_course('tool/cleanupcourses:managecourses', $USER, false);
if (!$courses) { if (!$courses) {
echo 'no courses'; echo 'no courses';
......
...@@ -35,6 +35,7 @@ $PAGE->set_url(new \moodle_url('/admin/tool/cleanupcourses/view.php')); ...@@ -35,6 +35,7 @@ $PAGE->set_url(new \moodle_url('/admin/tool/cleanupcourses/view.php'));
$action = optional_param('action', null, PARAM_ALPHA); $action = optional_param('action', null, PARAM_ALPHA);
$processid = optional_param('processid', null, PARAM_INT); $processid = optional_param('processid', null, PARAM_INT);
$stepid = optional_param('stepid', null, PARAM_INT);
$PAGE->set_title(get_string('viewheading', 'tool_cleanupcourses')); $PAGE->set_title(get_string('viewheading', 'tool_cleanupcourses'));
$PAGE->set_heading(get_string('viewheading', 'tool_cleanupcourses')); $PAGE->set_heading(get_string('viewheading', 'tool_cleanupcourses'));
...@@ -44,7 +45,7 @@ $renderer = $PAGE->get_renderer('tool_cleanupcourses'); ...@@ -44,7 +45,7 @@ $renderer = $PAGE->get_renderer('tool_cleanupcourses');
echo $renderer->header(); echo $renderer->header();
$controller = new \tool_cleanupcourses\view_controller(); $controller = new \tool_cleanupcourses\view_controller();
$controller->handle_view(); $controller->handle_view($action, $processid, $stepid);
echo $renderer->footer(); echo $renderer->footer();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment