viewConfig.pm #2

  • //
  • guest/
  • fredric_fredricson/
  • P4DB/
  • main/
  • viewConfig.pm
  • View
  • Commits
  • Open Download .zip Download (2 KB)
#!/usr/bin/perl -w
# -*- perl -*-
package viewConfig ;
use strict ;
#
#
#################################################################
# Configuration file for special file viewer.
#################################################################
#
#
my %ExtensionToType ;

my %TypeData ;

BEGIN() 
{

    # Keys: file extension (in uppercase)
    # value: A type code (must be unique)
    %viewConfig::ExtensionToType = 
	(
	 HTML =>"HTML",
	 HTM  =>"HTML",
	 GIF  =>"GIF",
	 JPEG =>"JPEG",
	 JPG  =>"JPEG", 
	 DOC  =>"WINWORD",
	 DOT  =>"WINWORDT",
	 PPT  =>"PWRPT", 
	 RTF  =>"RTF", 
	 PDF  =>"PDF", 
	 ) ;

				# 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],
	 GIF      =>["specialFileView.cgi"  ,"gif image in browser","image/gif"],
	 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"],
	 PWRTP    =>["specialFileView.cgi"  ,"MS-PowerPoint document","application/ppt"],
	 RTF      =>["specialFileView.cgi"  ,"RTF document","application/rtf"],
	 PDF      =>["specialFileView.cgi"  ,"PDF document","application/pdf"]
	 ) ;
} ;
1;






# Change User Description Committed
#5 4874 Fredric Fredricson P4DB: Fixed bug in viewConfig.pm and added support for
XML files. Thanks, Charles Hardin, for the patch
#4 4843 Fredric Fredricson P4DB: Added .png to "special" extesions
#3 4216 Fredric Fredricson P4DB: Another partial submit on my way to P4DB 3.1...
#2 4069 Fredric Fredricson P4DB: More changes on the way to 3.1
#1 1638 Fredric Fredricson P4DB: Added all (I think) files for P4DB