-
-
- $endpage
-ENDFRAME
+ if (($uselink) && ($title eq '')) {
+ if ($env{'form.symb'}) {
+ $title=&Apache::lonnet::gettitle($env{'form.symb'});
+ } else {
+ my $symb=&Apache::lonnet::symbread($r->uri);
+ if ($symb) {
+ $title=&Apache::lonnet::gettitle($symb);
+ }
+ }
+ }
+ if (($env{'browser.mobile'}) || ($exttool eq 'window') || ($exttool eq 'tab')) {
+ my $output = $startpage;
+ if ($is_pdf) {
+ $linktext = &mt('Link to PDF (for mobile devices)');
+ $output .= &create_link($url,$anchor,$title,$linktext);
+ } 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.'
';
+ }
+ } else {
+ if ($uselink) {
+ $linktext = &mt('Link to resource');
+ $output .= &create_link($url,$anchor,$title,$linktext);
+ } else {
+ my $dest = &HTML::Entities::encode($url.$anchor,'&<>"');
+ $output .= ''."\n".
+ '\n".
+ "
\n";
+ }
+ }
+ $output .= $endpage;
+ return $output;
+ } elsif ($uselink) {
+ $linktext = &mt('Link to resource');
+ return $startpage.&create_link($url,$anchor,$title,$linktext).$endpage;
} 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(<