Skip to content

Commit

Permalink
Merge pull request #213 from dpalou/mobile
Browse files Browse the repository at this point in the history
Adapt mobile code to ionic 7
  • Loading branch information
ndunand authored Aug 8, 2024
2 parents fa158fc + c718c70 commit d8313ae
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 888 deletions.
10 changes: 4 additions & 6 deletions classes/output/mobile.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,9 @@ public static function mobile_init($args) {

$args = (object) $args;

$foldername = $args->appversioncode >= 3950 ? 'latest' : 'ionic3';

return [
'templates' => [],
'javascript' => file_get_contents($CFG->dirroot . "/mod/choicegroup/mobile/js/$foldername/init.js"),
'javascript' => file_get_contents($CFG->dirroot . "/mod/choicegroup/mobile/js/latest/init.js"),
];
}

Expand All @@ -66,7 +64,7 @@ public static function mobile_course_view($args) {

$args = (object) $args;

$foldername = $args->appversioncode >= 3950 ? 'latest' : 'ionic3';
$versionname = $args->appversioncode >= 44000 ? 'latest' : 'ionic5';
$cm = get_coursemodule_from_id('choicegroup', $args->cmid);
$course = $DB->get_record('course', ['id' => $cm->course]);

Expand Down Expand Up @@ -142,10 +140,10 @@ public static function mobile_course_view($args) {
'templates' => [
[
'id' => 'main',
'html' => $OUTPUT->render_from_template("mod_choicegroup/mobile_view_page_$foldername", $data),
'html' => $OUTPUT->render_from_template("mod_choicegroup/mobile_view_page_$versionname", $data),
],
],
'javascript' => file_get_contents($CFG->dirroot . "/mod/choicegroup/mobile/js/$foldername/courseview.js"),
'javascript' => file_get_contents($CFG->dirroot . "/mod/choicegroup/mobile/js/latest/courseview.js"),
'otherdata' => [
'data' => json_encode($responses),
'allowupdate' => $choicegroup->allowupdate ? 1 : 0,
Expand Down
240 changes: 0 additions & 240 deletions mobile/js/ionic3/courseview.js

This file was deleted.

Loading

0 comments on commit d8313ae

Please sign in to comment.