#!/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_side.pl # # Routines to manage the sidebar 1; # Return true sub Generate_Side_Page { if ($in{$CGI_BOTTOM_SIDE_SWITCH}) { if ("$in{$CGI_BOTTOM_SIDE_SWITCH}" eq "$CGI_ALL_DEMOS_FLAG") { &Print_List_All_Page; } elsif ("$in{$CGI_BOTTOM_SIDE_SWITCH}" eq "$CGI_FEATURES_FLAG") { &Print_Bottom_Category_Page("$CGI_FEATURES_FLAG", "$in{$CGI_CATEGORY_SWITCH}"); } elsif ("$in{$CGI_BOTTOM_SIDE_SWITCH}" eq "$CGI_MARKETS_FLAG") { &Print_Bottom_Category_Page("$CGI_MARKETS_FLAG", "$in{$CGI_CATEGORY_SWITCH}"); } elsif ("$in{$CGI_BOTTOM_SIDE_SWITCH}" eq "$CGI_HARDWARE_FLAG") { &Print_Bottom_Category_Page("$CGI_HARDWARE_FLAG", "$in{$CGI_CATEGORY_SWITCH}"); } elsif ("$in{$CGI_BOTTOM_SIDE_SWITCH}" eq "$CGI_CUSTOM_NAME_FLAG") { &Print_Bottom_Custom_Page; } else { &Print_List_All_In_Tree("$in{$CGI_BOTTOM_SIDE_SWITCH}"); } } elsif ($in{$CGI_TOP_SIDE_SWITCH}) { #if ("$in{$CGI_TOP_SIDE_SWITCH}" eq "$CGI_FEATURES_FLAG") { # &Print_Top_Category_Page("$CGI_FEATURES_FLAG", "$in{$CGI_CATEGORY_SWITCH}"); #} elsif ("$in{$CGI_TOP_SIDE_SWITCH}" eq "$CGI_MARKETS_FLAG") { # &Print_Top_Category_Page("$CGI_MARKETS_FLAG", "$in{$CGI_CATEGORY_SWITCH}"); #} elsif ("$in{$CGI_TOP_SIDE_SWITCH}" eq "$CGI_HARDWARE_FLAG") { # &Print_Top_Category_Page("$CGI_HARDWARE_FLAG", "$in{$CGI_CATEGORY_SWITCH}"); #} elsif ("$in{$CGI_TOP_SIDE_SWITCH}" eq "$CGI_CUSTOM_NAME_FLAG") { # &Print_Top_Custom_Page; #} else { &Print_Top_Tree_Menu("$in{$CGI_TOP_SIDE_SWITCH}"); #} } elsif ($in{$CGI_SUB_SWITCH}) { # Maybe the first 3 lines here can be removed if the bottom frame buttons are not used??? if ("$in{$CGI_SUB_SWITCH}" eq "$CGI_FEATURES_FLAG") { &Print_Two_Frames("$CGI_FEATURES_FLAG&$CGI_CATEGORY_SWITCH=$in{$CGI_CATEGORY_SWITCH}","$CGI_FEATURES_FLAG&$CGI_CATEGORY_SWITCH=$in{$CGI_CATEGORY_SWITCH}", &Side_Top_Length("$CGI_FEATURES_FLAG")); } elsif ("$in{$CGI_SUB_SWITCH}" eq "$CGI_MARKETS_FLAG") { &Print_Two_Frames("$CGI_MARKETS_FLAG&$CGI_CATEGORY_SWITCH=$in{$CGI_CATEGORY_SWITCH}","$CGI_MARKETS_FLAG&$CGI_CATEGORY_SWITCH=$in{$CGI_CATEGORY_SWITCH}", &Side_Top_Length("$CGI_MARKETS_FLAG")); } elsif ("$in{$CGI_SUB_SWITCH}" eq "$CGI_HARDWARE_FLAG") { &Print_Two_Frames("$CGI_HARDWARE_FLAG&$CGI_CATEGORY_SWITCH=$in{$CGI_CATEGORY_SWITCH}","$CGI_HARDWARE_FLAG&$CGI_CATEGORY_SWITCH=$in{$CGI_CATEGORY_SWITCH}", &Side_Top_Length("$CGI_HARDWARE_FLAG")); #} elsif ("$in{$CGI_SUB_SWITCH}" eq "$CGI_CUSTOM_TOP_FLAG") { # &Generate_Custom_Top_Page; } elsif ("$in{$CGI_SUB_SWITCH}" eq "$CGI_SEARCH_RESULT_FLAG") { &Generate_Search_Result_Page($in{$CGI_DEMO_LIST_SWITCH}); } elsif ("$in{$CGI_SUB_SWITCH}" eq "$CGI_ADMIN_FLAG") { &Generate_Admin_Menu; } elsif ("$in{$CGI_SUB_SWITCH}" eq "$CGI_HELP_FLAG") { &Generate_Help_Menu; } elsif ("$in{$CGI_SUB_SWITCH}" eq "$CGI_MAINT_FLAG") { &Print_Maint_Menu; } else { &Generate_Trees_Page("$CGI_ALL_DEMOS_FLAG",&Get_Default_List, &Side_Top_Length("$CGI_ALL_DEMOS_FLAG")); } } else { &Generate_Trees_Page("$CGI_ALL_DEMOS_FLAG", &Get_Default_List, &Side_Top_Length("$CGI_ALL_DEMOS_FLAG")); } } sub Generate_Trees_Page { # if (&Is_Multiple_Trees || &Is_Custom_List) { &Print_Two_Frames("$_[0]","$_[1]", "$_[2]"); # } else { # &Print_List_All_Page; # } } sub Generate_Admin_Menu { &Print_HTTP_Header; if ($_[0]) { $no_passwd = "&$CGI_MAINT_OUTSIDE_SWITCH=$CGI_MAINT_FALSE_FLAG"; } else { $no_passwd = ""; } local($help_page) = "$WWW_SCRIPT?$CGI_SWITCH=$FRAME_MAIN&$CGI_SUB_SWITCH=$CGI_ADMIN_FLAG"; print "
\n"; print "Administration topics
\n"; print "
\n"; print "
| Do It! | Info |
|---|---|
| \n";
print "";
print " | \n";
print "\n";
print "Managing Custom Demo Lists \n"; print " |
| \n";
print "";
print " | \n";
print "\n";
print "Password Protection \n"; print " |
| \n";
print "";
print " | \n";
print "\n";
print "Edit Demo Information \n"; print " |
| \n";
print "";
print " | \n";
print "\n";
print "Add a Demo \n"; print " |
| \n";
print "";
print " | \n";
print "\n";
print "Add a Group of Demos \n"; print " |
| \n";
print "";
print " | \n";
print "\n";
print "Managing Categories \n"; print " |
| \n";
print "";
print " | \n";
print "\n";
print "Update Demo Tables \n"; print " |
\n";
for $list ( &alpha(keys(%name_space)) ) {
print "\n";
print "$list\n
\n";
}
print "
\n"; print "
| Do It! | Info |
|---|
\n"; &Print_HTTP_Footer; } sub Print_Top_Tree_Menu { &Print_Side_Bar_Header; print "
\n"; &Parse_Name_Space; @list_names = &alpha(keys(%name_space)); @tree_names = &List_Tree_Names; push(@tree_names, @list_names); if ($MENU_USE_TREES_FORM) { print "\n"; print "\n"; print "\n"; print "\n"; } else { print "\n"; $bold = ("$CGI_ALL_DEMOS_FLAG" eq "$_[0]"); &Print_Top_Tree_Menu_Item("$CGI_ALL_DEMOS_FLAG", "All Demos", "$bold"); print "
\n"; for $tree_name (@tree_names) { $bold = ("$tree_name" eq "$_[0]"); &Print_Top_Tree_Menu_Item(&HTTP_Syntax($tree_name), "$tree_name", "$bold"); } print "
\n"; print "
| Do It! | Info |
|---|
\n"; &Print_HTTP_Footer; } sub Side_Top_Length { if ("$_[0]" eq "$CGI_ALL_DEMOS_FLAG") { if ($MENU_USE_TREES_FORM) { return($MENU_FORM_SIZE); } else { return($MENU_DEFAULT_SIZE); } } elsif ($MENU_USE_FORM) { return($MENU_FORM_SIZE); } elsif ("$_[0]" eq "$CGI_CUSTOM_NAME_FLAG") { return($MENU_CUSTOM_SIZE); } elsif ("$_[0]" eq "$CGI_HARDWARE_FLAG") { return($MENU_HARDWARE_SIZE); } elsif ("$_[0]" eq "$CGI_MARKETS_FLAG") { return($MENU_MARKETS_SIZE); } elsif ("$_[0]" eq "$CGI_FEATURES_FLAG") { return($MENU_FEATURES_SIZE); } } sub Print_Two_Frames { local($top_frame, $bottom_frame, $length); $top_frame = shift; $bottom_frame = shift; $bottom_frame =~ s/ /+/g; $length = shift; &Print_HTTP_Header; print "
\n"; &Print_HTTP_Footer; } sub Generate_Custom_Top_Page { &Parse_Name_Space; @lists = &List_Custom_Lists; if (&Number_Custom_Lists == 1) { &Print_Bottom_Custom_Page; } else { &Print_Two_Frames("$CGI_CUSTOM_NAME_FLAG","$CGI_CUSTOM_NAME_FLAG", &Side_Top_Length("$CGI_CUSTOM_NAME_FLAG")); } } sub Print_List_All_Page { local(@demo_list, $demo, $demo_name, $demo_tree); &Print_Side_Bar_Header; print "\n"; print "\n"; print "
| Do It! | Info |
|---|
\n"; &Print_HTTP_Footer; } sub Generate_Search_Result_Page { local(@match_demos); &Print_Side_Bar_Header; @match_demos = split(/$HTTP_DEMOS_DELIM/, $_[0]); print "
\n"; print "\n"; print "
| Sorry! No demo matching that search criteria found. | \n";
}
else {
print "|
| Do It! | Info |
|---|
\n";
&Print_HTTP_Footer;
}
sub Print_Bottom_Category_Page {
local($category_flag, @demos, $demo, $demo_name, $demo_tree);
&Print_Category_Top($_[0]);
print "
\n";
for $category (&alpha(keys(%demos_under))) {
$category_flag = &Insert_For_Space("$category", "$HTTP_NAME_DELIM");
if ( ("$_[1]" eq "$CGI_ALL_DEMOS_FLAG") || ("$_[1]" eq "\U$category_flag\E") ) {
@demos = split(/$TABLE_SECOND_DELIM/, $demos_under{$category});
print "";
print "$category
\n";
for $i (0..$SIDE_EXTRA_LINES) {
print "\n";
}
print "\n";
}
&Print_HTTP_Footer;
}
sub Print_Top_Category_Page {
local($category, $category_flag);
&Print_Category_Top($_[0]);
if ($MENU_USE_FORM) {
print "\n"; &Print_Error("$ERROR_INFO", "Removing \"$_[0]\" from \"$_[1]\". Did not pass basic test of directory.", "$STATUS_MINOR"); # Update tables } }