Browse Source

Fix example template.

MOODLE_35_STABLE
Dan Marsden 6 years ago
parent
commit
1906820255
  1. 4
      classes/output/mobile.php
  2. 8
      templates/mobile_teacher_form.mustache

4
classes/output/mobile.php

@ -362,7 +362,7 @@ class mobile {
$data['messages'] = array();
$data['showmessage'] = false;
$data['statuses'] = array();
$data['args'] = ''; // Stores list of userid status args that should be added to form post.
$data['btnargs'] = ''; // Stores list of userid status args that should be added to form post.
$statuses = $att->get_statuses();
$otherdata = array();
@ -384,7 +384,7 @@ class mobile {
foreach ($users as $user) {
$data['users'][] = array('userid' => $user->id, 'fullname' => $user->fullname);
// Generate args to use in submission button here.
$data['args'] .= ', status'. $user->id. ': CONTENT_OTHERDATA.status'. $user->id;
$data['btnargs'] .= ', status'. $user->id. ': CONTENT_OTHERDATA.status'. $user->id;
}
if (!empty($data['messages'])) {

8
templates/mobile_teacher_form.mustache

@ -40,8 +40,8 @@
},
"cmid": "25",
"courseid": "4",
"sessid": "43"
"args" : ", status4: CONTENT_OTHERDATA.status4"
"sessid": "43",
"btnargs" : ""
}
}}
{{=<% %>=}}
@ -76,8 +76,10 @@
<%/statuses%>
</ion-list>
<%/users%>
<button ion-button core-site-plugins-new-content component="mod_attendance" method="mobile_view_activity" [args]="{cmid: <% cmid %>, courseid: <% courseid %>, sessid: <% sessid %><% args %>}">
<ion-item>
<button ion-button core-site-plugins-new-content component="mod_attendance" method="mobile_view_activity" [args]="{cmid: <% cmid %>, courseid: <% courseid %>, sessid: <% sessid %><% btnargs %>}">
{{ 'plugin.mod_attendance.submitattendance' | translate }}
</button>
</ion-item>
</div>
Loading…
Cancel
Save