Files
resatennis_tyroltenn/www/cgi-bin/Demos/DEMO_main.pl

366 lines
12 KiB
Perl
Executable File

#!/usr/sbin/perl
#**************************************************************************
#* *
#* Copyright (c) 1996 Silicon Graphics, Inc. *
#* All Rights Reserved *
#* *
#* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI *
#* *
#* The copyright notice above does not evidence any actual of intended *
#* publication of such source code, and is an unpublished work by Silicon *
#* Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is *
#* the property of Silicon Graphics, Inc. Any use, duplication or *
#* disclosure not specifically authorized by Silicon Graphics is strictly *
#* prohibited. *
#* *
#* RESTRICTED RIGHTS LEGEND: *
#* *
#* Use, duplication or disclosure by the Government is subject to *
#* restrictions as set forth in subdivision (c)(1)(ii) of the Rights in *
#* Technical Data and Computer Software clause at DFARS 52.227-7013, *
#* and/or in similar or successor clauses in the FAR, DOD or NASA FAR *
#* Supplement. Unpublished - rights reserved under the Copyright Laws of *
#* the United States. Contractor is SILICON GRAPHICS, INC., 2011 N. *
#* Shoreline Blvd., Mountain View, CA 94039-7311 *
#**************************************************************************
# DEMO_main.pl
#
# Routines for printing to the main page
1; # Return true
sub Generate_Main_Page {
if ("$in{$CGI_SUB_SWITCH}" eq "$CGI_DEMO_INFO_FLAG") {
&Generate_Demo_Info_Page("$in{$CGI_DEMO_SWITCH}", "$in{$CGI_TREE_SWITCH}", 0);
} elsif ("$in{$CGI_SUB_SWITCH}" eq "$CGI_HELP_FLAG") {
&Print_Help_Page;
} elsif ("$in{$CGI_SUB_SWITCH}" eq "$CGI_SEARCH_FLAG") {
&Generate_Search_Page;
} elsif ("$in{$CGI_SUB_SWITCH}" eq "$CGI_ADMIN_FLAG") {
&Generate_Admin_Page;
} else {
&Generate_Opening_Main_Page;
}
}
sub Generate_Admin_Page {
&Print_HTTP_Header("BLANK");
print "<body bgcolor=\"white\">\n";
print "<table width=100%>\n";
print "<tr><td align=right><img src=\"$IMGSRC_ADMIN_HEADER\"></td></tr></table>\n";
&Print_Help_Page_Admin;
&Print_HTTP_Footer;
}
sub Generate_Opening_Main_Page {
&Print_Opening_Main_Page;
}
sub Generate_Demo_Info_Page {
if ( &Is_Real_Demo("$_[0]","$_[1]") ) {
&Print_Demo_Info_Page("$_[0]", "$_[1]");
} else {
&Print_Bad_Demo_Page($_[0]);
}
}
sub Print_Bad_Demo_Page {
&Print_HTTP_Header;
print "<body bgcolor=white>";
print "<b>The Demo <i>$_[0]</i> does not exist. Please report this ";
print "bug in the interface.\n";
&Print_HTTP_Footer;
}
sub Is_Real_Demo {
return( &Is_Demo_In_Tree("$_[0]","$_[1]") );
}
sub Print_Demo_Info_Header {
&Print_HTTP_Header("BLANK", "$HTTP_YES_SCRIPT");
print "<script language=\"JavaScript\">\n";
print "<!-- \n";
print "function UpdateSide( category_flag, place_in_page) {\n";
print "\tvar newLocation = \"$WWW_SCRIPT?$CGI_SWITCH=$FRAME_SIDE\"\n";
print "\t\tnewLocation += \"&$CGI_SUB_SWITCH=\" + category_flag\n";
print "\t\tnewLocation += \"&$CGI_CATEGORY_SWITCH=\" + place_in_page\n";
print "\t\ttop.frames[\"$FRAME_SIDE\"].location = newLocation\n";
print "}\n";
&Print_Image_Script;
print "function UpdateTables() {\n";
$refreshString = "$WWW_SCRIPT?";
$refreshString .= "$CGI_SWITCH=$FRAME_DIAG&$CGI_SUB_SWITCH=$CGI_UPDATE_FLAG";
$refreshString .= "&$CGI_NOTIFY_SWITCH=$CGI_TRUE_FLAG";
print "\tparent.frames[\"$FRAME_DIAG\"].location = \"$refreshString\"\n";
print "}\n";
print "\n// -->\n";
print "</script>\n";
print "</head>\n";
}
sub Print_Demo_Info_Page {
&Print_Demo_Info_Header;
$tree_path = &Tree_Path_From_Name("$_[1]");
&Parse_Demo_Info("$tree_path/$_[0]/$DEMOSRC_INDEX");
if ($_[2]) { print "<body onLoad=\"parent.setDoc(document)\"; UpdateTables()\" bgcolor=white>\n"; }
else { print "<body onLoad=\"parent.setDoc(document)\" bgcolor=white>\n"; }
print "<table width=100%><tr><td align=right><img src=\"$PATH_WEB_GENERAL_DIR/$_[0]/$DEMOSRC_HEADER\"></td></tr></table> \n";
print "<center>\n";
print "<img src=\"$PATH_WEB_GENERAL_DIR/$_[0]/$DEMOSRC_DEMOPIC\">\n";
print "<table width=80%>\n";
print "<tr>\n";
print "<td align=right>\n";
print "<a target=$FRAME_DIAG onMouseOver = \"SwitchImage( 2, \'$IMGSRC_START_H\');window.status = \'Start $_[0]\'; ";
print "return true \" ";
print "onMouseOut = \"SwitchImage( 2, \'$IMGSRC_START\')\" \n";
print "href=\"$WWW_SCRIPT?$CGI_SWITCH=$FRAME_DIAG&";
print "$CGI_SUB_SWITCH=$CGI_EXECUTE_FLAG&$CGI_DEMO_SWITCH=$_[0]&";
print "$CGI_TREE_SWITCH=";
print &HTTP_Syntax("$_[1]");
print "\">\n";
print "<img border=0 src=\"$IMGSRC_START\"></a>\n";
print "</td>\n";
print "<td align=center>\n";
print "$demo_info{'DESCRIPTION'}<br>\n";
print "</td>\n";
print "<td width=80>\n";
print "<img border=0 src=\"$IMGSRC_END\">\n";
print "</td>\n</tr>\n</table>\n";
print "<br>\n";
# Only print this if there is information to put in it
if (grep(/\S+/, $demo_info{'AUTHOR'})) {
print "<i><b>Author(s):</b> $demo_info{'AUTHOR'}</i><p>" if (grep(/\S+/, $demo_info{'AUTHOR'}));
}
print "<img src=\"$IMGSRC_GRADHRY\"><p>\n";
print "<B>Quick Start:</B><BR>\n";
print "<BR>\n";
print "<table width=90%>\n<tr>\n<td>\n";
print "$demo_info{'BRIEF_INSTRUCTIONS'}<br>\n";
print "</td></tr></table></center>\n";
# Only print this if there is information to put in it
if (grep(/\S+/, $demo_info{'DETAILED_INSTRUCTIONS'})) {
print "<CENTER>\n";
print "<BR><IMG SRC=\"$IMGSRC_GRADHRY\">\n";
print "<BR>\n";
print "<B>More Details:</B><BR>\n";
print "<BR>\n";
print "<TABLE width=90%><TR><TD>\n";
print "$demo_info{'DETAILED_INSTRUCTIONS'}<br>\n";
print "</td></tr></table>\n";
print "</CENTER>\n";
}
# Only print this if there is information to put in it
if (grep(/\S+/, $demo_info{'OTHER_INFORMATION'})) {
print "<CENTER>\n";
print "<BR><IMG SRC=\"$IMGSRC_GRADHRY\">\n";
print "<BR>\n";
print "<b>Other Information:</b>\n";
print "<BR>\n";
print "<TABLE width=90%><TR><TD>\n";
print "$demo_info{'OTHER_INFORMATION'}<br>\n";
print "</td></tr></table>\n";
print "</CENTER>\n";
}
# Only print this if there is information to put in it
if (grep(/\S+/, $demo_info{'SYSTEM_REQS'})) {
print "<CENTER>\n";
print "<BR><IMG SRC=\"$IMGSRC_GRADHRY\">\n";
print "<BR>\n";
print "<b>System Requirements:</b>\n";
print "<BR>\n";
print "<TABLE width=90%><TR><TD>\n";
print "$demo_info{'SYSTEM_REQS'}<br>\n";
print "</td></tr></table>\n";
print "</CENTER>\n";
}
print "<CENTER>\n";
print "<BR><IMG SRC=\"$IMGSRC_GRADHRY\">\n";
print "<table width=80%>\n";
print "<tr>\n";
print "<td width=30% align=center>\n";
print "<b>Features:</b><br>\n";
print "</td>\n";
print "<td align=center>\n";
print "<b>Industries:</b><br>\n";
print "</td>\n";
print "<td width=30% align=center>\n";
print "<b>Hardware:</b><br>\n";
print "</td>\n";
print "</tr>\n";
print "<tr>\n";
print "<td width=30% align=center>\n";
&Print_Category_Links("FEATURES", "$CGI_FEATURES_FLAG", @features_categories);
print "</td><td align=center>\n";
&Print_Category_Links("MARKETS", "$CGI_MARKETS_FLAG", @markets_categories);
print "</td><td width=30% align=center>\n";
&Print_Category_Links("HARDWARE", "$CGI_HARDWARE_FLAG", @hardware_categories);
print "</td>\n";
print "</tr>\n";
print "</table>\n";
print "</center>\n";
&Print_HTTP_Footer;
}
sub Print_Category_Links {
local($category, $flag, @links);
$category = shift;
$flag = shift;
@links = split(/\n/, $demo_info{$category});
@links = &alpha(@links);
foreach $i ( 0 .. $#links ) {
if (grep(/$links[$i]/i, @_) && "$links[$i]" ne "") {
$link_http = &Insert_For_Space("$links[$i]", "$HTTP_NAME_DELIM");
print "<font size=1><a ";
print "onMouseOver=\"window.status = \'$links[$i]\'; return true;\" ";
print "href=\"javascript:UpdateSide(\'$flag\',\'\U$link_http\E\')\">";
print "\U$links[$i]\E</a></font><br>\n";
}
}
}
sub Print_Image_Script {
print "function SwitchImage( index , pic ) {\n";
print "\tdocument.images[index].src = pic\n";
print "}\n";
print "\n";
}
sub Print_Plugin_Script {
print <<_YAMAHA_IT200N_;
function initDisplay(Msg) {
// pluginOutput is the name of the frame which has been specified
// by the EMBED attribute called "PLUGINTARGET" for use with the
// demoUI plugin.
// This allows the target name of the frame the demoUI plugin
// sends it's output to, to be configurable.
//
// displayVar is the name of the variable that has been specified
// by the EMBED attribute called "JSVARNAME" for use with the demoUI
// plugin.
// This allows the variable name that holds the X DISPLAY value which
// the plugin sends it's output to, to be configurable.
//
dVar = null;
// is the demoUI mime type available to the browser?
mimetype=navigator.mimeTypes["application/demoUI"];
if(mimetype) {
// is this mimetype handled by a plugin, presumably mine?
pluginEnabled = mimetype.enabledPlugin;
if(pluginEnabled) {
// is a plugin loaded into the page
if(self.document.embeds.length == 1) {
// See what the plugin sent diag as the DISPLAY value
dVar = "" + parent.diag.displayVar;
if ( dVar == "undefined" ) {
dVar = null; // something went wrong, so set to null so parent will know
}
} else { self.location.reload() }
}
}
// send dVar value to parent so she can store it and I can go do other stuff
parent.storeDisplayValue(dVar);
} // end initDisplay()
_YAMAHA_IT200N_
}
sub Print_Opening_Main_Page {
&Print_HTTP_Header("BLANK", "$HTTP_YES_SCRIPT");
print "<script>\n";
&Print_Image_Script;
&Print_Plugin_Script;
print "</script>\n";
print "</head>\n";
print "<body bgcolor=white>\n";
print "<table width=100%>\n";
print "<tr><td align=right><img src=\"$IMGSRC_HEADER_HOME\"></td></tr>\n";
print "</table>\n";
print "<BR>\n";
print "<CENTER>\n";
print "<TABLE WIDTH=100% border=0>\n";
print "\n";
print "<TR>\n";
print "<TD colspan=4 align=middle>\n";
print "<center>\n";
print "<img src=\"$IMGSRC_MAIN\">\n";
print "</center>\n";
print "</TD>\n";
print "</TR>\n";
print "<TR>\n";
print "<TD width=5> </TD>\n";
print "<TD colspan=3>\n";
print "<CENTER>\n";
print "<BR>\n";
print "<img src=\"$IMGSRC_ROTLOGO\">\n";
print "<BR>\n";
print "</CENTER>\n";
print "</TD>\n";
print "</TR>\n";
print "<TR>\n";
print "<TD width=5> </TD>\n";
print "<TD colspan=3>\n";
print "<CENTER><I>\n";
print "<FONT SIZE=3>C</FONT><FONT SIZE=2>lick the \n";
print "icons to start the demos.</FONT><BR>\n";
print "<FONT SIZE=3>C</FONT><FONT SIZE=2>lick demo names to display detailed \n";
print "information about each demo.</FONT></I><BR> \n";
print "<BR>\n";
print "<BR>\n";
print "<BR>\n";
print "</I>\n";
print "</CENTER>\n";
print "</TD>\n";
print "</TR>\n";
print "<TR>\n";
print "<TD width=15> </TD>\n";
print "<TD align=right>\n";
print "<img border=0 src=\"$IMGSRC_AUDIO_OFF\"\n";
print "</TD>\n";
print "<TD align=middle>\n";
print "<img src=\"$IMGSRC_LONGDIV\">\n";
print "</TD>\n";
print "<TD align=left>\n";
print "<a onMouseOver = \"SwitchImage( 5, \'$IMGSRC_ABOUT_H\');window.status = \'About this Interface\'; return true\" \n";
print "onMouseOut = \"SwitchImage( 5, \'$IMGSRC_ABOUT\')\"\n";
print "target=$FRAME_DIAG \n";
print "href=\"$WWW_SCRIPT?$CGI_SWITCH=$FRAME_DIAG&$CGI_SUB_SWITCH=$CGI_ABOUT_UI_FLAG\">\n";
print "<img border=0 src=\"$IMGSRC_ABOUT\"></A>\n";
print "</TD>\n";
print "</TR>\n";
print "<TR>\n";
print "<TD colspan=4 align=middle>\n";
print "<center>\n";
print "<img src=\"$IMGSRC_GRADHRY\"><p>\n";
print "</center>\n";
print "</TD>\n";
print "</TR>\n";
print "</TABLE>\n";
print <<_YAMAHA_YZ250_;
<!-- The following EMBED tag will load the demoUI plugin.
PLUGINTARGET is the name of the FRAME, in the current
FRAMESET, that the plugin will send its output to.
JSVARNAME is the name of the JavaScript variable that will
contain the value of Navigator's DISPLAY environment variable.
NOTE: The HTML source which the plugin sends to
PLUGINTARGET window is *not* viewable by using the
menu View->Frame_Source.
-->
<EMBED name="demoUI" type="application/demoUI" PLUGINTARGET="diag" JSVARNAME="displayVar" HIDDEN>
_YAMAHA_YZ250_
&Print_HTTP_Footer;
}