-
-
- $endpage
-ENDFRAME
+ if (($env{'browser.mobile'}) || ($exttool eq 'window') || ($exttool eq 'tab')) {
+ my $output = $startpage;
+ if ($is_pdf) {
+ if ($title eq '') {
+ $title = $env{'form.title'};
+ if ($title eq '') {
+ unless ($env{'request.enc'}) {
+ ($title) = ($url =~ m{/([^/]+)$});
+ $title =~ s/(\?[^\?]+)$//;
+ }
+ }
+ }
+ unless ($title eq '') {
+ $output .= $title.'
';
+ }
+ $output .= ''.&mt('Link to PDF (for mobile devices)').'';
+ } elsif (($exttool eq 'window') || ($exttool eq 'tab')) {
+ if ($linktext eq '') {
+ $linktext = &mt('Launch External Tool');
+ }
+ $url = &HTML::Entities::encode($url,'"<>&');
+ if ($exttool eq 'tab') {
+ $output .= '';
+ } else {
+ $output .= <<"ENDLINK";
+
+
+ENDLINK
+ }
+ if ($explanation ne '') {
+ $output .= ''.$explanation.'
';
+ }
+ if (&Apache::lonnet::EXT('resource.0.gradable')) {
+ $output .= &Apache::lonfeedback::list_discussion('tool','OPEN');
+ }
+ } else {
+ my $dest = &HTML::Entities::encode($url.$anchor,'&<>"');
+ $output .= ''."\n".
+ '\n".
+ "
\n";
+ }
+ $output .= $endpage;
+ return $output;
} else {
+ my $offset = 5;
+ &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['inhibitmenu']);
+ if ($env{'form.inhibitmenu'} eq 'yes') {
+ $offset = 0;
+ }
my $script = &Apache::lonhtmlcommon::scripttag(<