Changeset 39658 for trunk/DataStoreServer/web/cgi/dsgetindex
- Timestamp:
- Aug 23, 2016, 9:17:22 AM (10 years ago)
- File:
-
- 1 edited
-
trunk/DataStoreServer/web/cgi/dsgetindex (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataStoreServer/web/cgi/dsgetindex
r25366 r39658 20 20 my $PS_EXIT_CONFIG_ERROR = 3; 21 21 my $PS_EXIT_DATA_ERROR = 5; 22 23 my $redirect_root_to_pstamp = 0; 22 24 23 25 my $uri = shift; … … 132 134 print @$stdout_buf; 133 135 } 136 $error_code = 0 if !defined $error_code; 134 137 } else { 135 138 if (0 && $html_mode) { … … 199 202 200 203 # return link 201 print a({-href=>"./index.txt"}, "Text Version"); 204 if (!$redirect_root_to_pstamp || $program ne "dsrootindex") { 205 print a({-href=>"./index.txt"}, "Text Version"); 206 } 202 207 203 208 if ($#path >= 1) { 204 print "    \n"; 205 206 my $up = join('/', @path[0..$#path-1]); 207 print a({-href=>".."}, "Up to $up"); 208 209 # including the up links in the data store display causes 210 # wget -r to follow them up which makes a mess 211 # Turn them off if the user agent looks like wget 212 my $display_up_links = (lc($ENV{HTTP_USER_AGENT}) =~ /wget/) ? 0 : 1; 213 if ($display_up_links) { 214 print "    \n"; 215 my $up = join('/', @path[0..$#path-1]); 216 if ($redirect_root_to_pstamp and $program eq "dsprodindex") { 217 print a({-href=>"http://pstamp.ipp.ifa.hawaii.edu/dsroot.php"}, "Up to $up"); 218 } elsif ($program eq 'dsrootindex') { 219 # no up link in dsroot 220 } else { 221 print a({-href=>".."}, "Up to $up"); 222 } 223 } 209 224 } 210 225 print "</p>\n"; … … 244 259 if ($nolink) { 245 260 print $toks[0]; 246 } 247 248 else { 249 # assumes id is always first field 250 my $wpath = "./$toks[0]"; 251 252 # if this is a file request, use a download cgi 253 if ($wpath =~ /\.fits\s*$/) { 254 # This doesn't work through the proxy 255 # The /ds-cgi gets tried on alala 256 # $wpath = '/ds-cgi/dsfits.cgi?'.substr($wpath, 4); # strip' /ds/' 261 } else { 262 # First column is link to an entity down one level in data store (product, fileset, file) 263 # assumes id is always first field 264 my $wpath = "./$toks[0]"; 265 266 # if this is a file request, use a download cgi 267 my $fits = 0; 268 if ($wpath =~ /\.fits\s*$/) { 269 # This doesn't work through the proxy 270 # The /ds-cgi gets tried on alala 271 # $wpath = '/ds-cgi/dsfits.cgi?'.substr($wpath, 4); # strip' /ds/' 272 $fits = 1; 273 } 274 275 if ($fits) { 276 print a({-href=>$wpath, -type=>'image/x-fits'}, $toks[0]); 277 } else { 278 print a({-href=>$wpath}, $toks[0]); 279 } 280 281 if ($program eq 'dsrootindex') { 282 # for root listing make most recent fileset a link as well unless there are no filesets 283 my $fileset = $toks[1]; 284 $fileset =~ s/^\s+//; 285 $fileset =~ s/\s+$//; 286 if ($fileset ne 'none') { 287 print "</$celltag>"; 288 print "<$celltag>"; 289 # drop the product from the list of tokens 290 my $product = shift @toks; 291 # elmiminate any whitesapace 292 $product =~ s/^\s+//; 293 $product =~ s/\s+$//; 294 print a({-href=>"./$product/$fileset"}, $fileset); 257 295 } 258 259 print a({-href=>$wpath, -type=>'image/x-fits'}, $toks[0]);260 }296 } 297 } 298 shift @toks; 261 299 262 300 print "</$celltag>"; 263 301 264 foreach my $val (@toks[1..$#toks]) { 302 # foreach my $val (@toks[1..$#toks]) { 303 foreach my $val (@toks) { 265 304 print "<$celltag>"; 266 305 print $val;
Note:
See TracChangeset
for help on using the changeset viewer.
