'.
- &mt('Return to reservations'));
+ $r->print(''.
+ &mt('Return to reservations').'
');
} else {
- $r->print(''.
+ $r->print(''.
&mt('Return to last resource').'
');
}
}
+sub return_target {
+ my ($target,$ltitarget,$deeplinktarget);
+ if ($env{'request.lti.login'}) {
+ $ltitarget = $env{'request.lti.target'};
+ }
+ if ($env{'request.deeplink.login'}) {
+ $deeplinktarget = $env{'request.deeplink.target'};
+ }
+ if (($ltitarget eq 'iframe') || ($deeplinktarget eq '_self')) {
+ $target = '_self';
+ } else {
+ $target = '_top';
+ }
+ return $target;
+}
+
sub get_slot {
my ($r,$symb,$conflictable_slot,$inhibit_return_link)=@_;
@@ -1295,7 +1340,7 @@ sub allowed_slot {
if (($slot->{'endreserve'}) &&
($slot->{'endreserve'} < time)) {
return 0;
- }
+ }
&Apache::lonxml::debug("$slot_name reserve good");
my $userallowed=0;
@@ -1403,7 +1448,8 @@ sub show_choices {
if (!@{$available}) {
$output = ''.&mt('No available times.').'';
if ($env{'form.command'} ne 'manageresv') {
- $output .= ' '.
+ my $target = &return_target();
+ $output .= ' '.
&mt('Return to last resource').'';
}
if ($class) {
@@ -1441,7 +1487,7 @@ sub show_choices {
);
foreach my $option (@options) {
my $onclick = "toggleSlotDisplay(this.form,'$num');";
- if (($option eq 'show') && ($env{'form.command'} eq 'manageresv')) {
+ if (($option eq 'show') && ($env{'form.command'} eq 'manageresv')) {
$onclick .= "currSlotDisplay$num(this.form,'$num');";
}
$output .= '