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['messages'] = array();
$data['showmessage'] = false; $data['showmessage'] = false;
$data['statuses'] = array(); $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(); $statuses = $att->get_statuses();
$otherdata = array(); $otherdata = array();
@ -384,7 +384,7 @@ class mobile {
foreach ($users as $user) { foreach ($users as $user) {
$data['users'][] = array('userid' => $user->id, 'fullname' => $user->fullname); $data['users'][] = array('userid' => $user->id, 'fullname' => $user->fullname);
// Generate args to use in submission button here. // 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'])) { if (!empty($data['messages'])) {

8
templates/mobile_teacher_form.mustache

@ -40,8 +40,8 @@
}, },
"cmid": "25", "cmid": "25",
"courseid": "4", "courseid": "4",
"sessid": "43" "sessid": "43",
"args" : ", status4: CONTENT_OTHERDATA.status4" "btnargs" : ""
} }
}} }}
{{=<% %>=}} {{=<% %>=}}
@ -76,8 +76,10 @@
<%/statuses%> <%/statuses%>
</ion-list> </ion-list>
<%/users%> <%/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 }} {{ 'plugin.mod_attendance.submitattendance' | translate }}
</button> </button>
</ion-item>
</div> </div>
Loading…
Cancel
Save