#!/usr/bin/perl -w # -*- perl -*- package viewConfig ; use strict ; # # ################################################################# # Configuration file for special file viewer. ################################################################# # # my %ExtensionToType ; my %SpecialExtensions ; my %TypeData ; BEGIN() { # Keys: file extension (in uppercase) # value: A type code (must be unique) %viewConfig::ExtensionToType = ( HTML =>"HTML", HTM =>"HTML", XML =>"XML", XSL =>"XML", XSD =>"XML", GIF =>"GIF", PNG =>"PNG", JPEG =>"JPEG", JPG =>"JPEG", DOC =>"WINWORD", DOT =>"WINWORDT", PPT =>"PWRPT", RTF =>"RTF", PDF =>"PDF", ) ; # Extensions that should be treated specially in htmlFileView.cgi but not # in fileViewer.cgi %viewConfig::SpecialExtensions = ( CSS =>"CSS", JS =>"JS", ) ; # Special "about" url for html viewer my $htmlAbout = &P4CGI::ahref(-url => "htmlFileView.cgi" , "TYPE=ABOUT", "About the HTML viewer") ; # Keys: Type code # value: A referece to an array: # [url for viewer,description of content, content type, optinal about] %viewConfig::TypeData = ( HTML =>["htmlFileView.cgi","html in browser","text/html",$htmlAbout], XML =>["specialFileView.cgi" ,"XML file","text/xml"], GIF =>["specialFileView.cgi" ,"gif image in browser","image/gif"], CSS =>["specialFileView.cgi" ,"css file","text/css"], JS =>["specialFileView.cgi" ,"javascript","application/x-javascript"], PNG =>["specialFileView.cgi" ,"png image in browser","image/png"], JPEG =>["specialFileView.cgi" ,"jpeg image in browser","image/jpeg"], WINWORD =>["specialFileView.cgi" ,"MS-Word document","application/msword"], WINWORDT =>["specialFileView.cgi" ,"MS-Word template","application/msword"], PWRPT =>["specialFileView.cgi" ,"MS-PowerPoint document","application/ppt"], RTF =>["specialFileView.cgi" ,"RTF document","application/rtf"], PDF =>["specialFileView.cgi" ,"PDF document","application/pdf"] ) ; } ; 1;