Sub tHelp-> sets startpoint.<% @Language="PerlScript" %> <!--#Include File="base/base.asp"--> <!--#Include File="base/core.asp"--> <!--#Include File="base/helper.asp"--> <!--#Include File="base/modules.asp"--> <% my $User = $Request->item("Login")->item(); my $Site = $Request->item("Site")->item(); $topic= $Request->item("Topic")->item(); my $Referer = $Request->ServerVariables("HTTP_REFERER")->item(); use CGI; use ASP; use OLE; $query= new CGI; my %ttopics = ( home => 'TEMPO%205%20Help%20Topics-01-1.html', listingmgr => 'TEMPO%205%20Help%20Topics-06-1.html', ); if (!defined($topic)) { # ...handle error... } $nightmare = $ttopics{$topic}; if (!defined($target)) { # ...handle error... } $Response->Write("Topic is $topic\n"); $Response->Write("my target is $nightmare\n"); }
Here is main which calls thelp.sub tHelp { my $str = ""; my $startpoint=$nightmare=@_; # Are We Tempo? if ($Session->{'usrType'} eq 'Std') { if ($Request->ServerVariables("SERVER_NAME")->item()=~/tempohelp/i +) { my $target='Tempo%20help_frame'; $str .= shadowBox("Tempo Help", qq^<help_iframe name="$target" +startpoint="$startpoint"/>^ , ($g_docWidth/5*4-(2*$g_docSpace))); return $str; } } }
Sub document that outputs doc.sub pMain { my ($dWidth) = @_; my $str = ""; my $xmlFSO = CreateObject OLE "Scripting.FileSystemObject"; if ($Request->item("xURL")->item()) { lg("ACTIVITY","REFERRAL:".$Request->item("xURL")->item()); $str .= "<xURL href=\"".$Request->item("xURL")->item()."\"/>"; } if ($Request->item("xResource")->item()) { lg("ACTIVITY","Resource:".$Request->item("xResource")->item()); $str .= "<xResource href=\"".$Request->item("xResource")->item() +."\" height=\"".$Request->item("xRh")->item()."\" width=\"".$Request- +>item("xRw")->item()."\"/>"; } SWITCH: { if ($Request->item("View")->item() eq "Logout"){ $str .= mLogout +(); last SWITCH; } if ($Request->item("Tab")->item() eq "Help"){ $str .= +&tHelp($nightmare); last SWITCH; } if ($Request->item("Tab")->item() eq "Support"){ $str .= tSuppor +t(); last SWITCH; } if ($Request->item("Tab")->item() eq "Admin"){ $str .= tAdm +in(); last SWITCH; } } return $str; }
Here is mLeftIndex();$xmlPage = "<document here=\ queryString=\"$queryString\" docWidth=\"$dWidth\" scWidth=\"".$Session->{'screenX'}."\" scHeight=\"".$Session->{'screenY'}."\" docSpace=\"$g_docSpace\" uClass=\"".$uClass."\" uTitle=\"".$1."\" uDesc=\"".$2."\""; $xmlPage .= $Session->{'statsRights'} ? " statsRights=\"".$Session +->{'statsRights'}."\"" : ""; $xmlPage .= $Session->{'adminRights'} ? " adminRights=\"".$Session +->{'adminRights'}."\"" : ""; $xmlPage .= " date=\"$year".pad($mon,2).pad($mday,2)."\" wDay=\"$wday\" time=\"".pad($hour,2).pad($min,2)."\" + cBackground=\"$c_Background\" cElement=\"$c_Element\" cFrame=\"$c_Frame\" cShadow=\"$c_Shadow\" cLink=\"$c_Link\" cText=\"$c_Text\">\n"; $xmlPage .= css(); $xmlPage .= admin(); $xmlPage .= config(); $xmlPage .= jscripts(); $xmlPage .= adverts(); $xmlPage .= header(); $xmlPage .= body($dWidth); $xmlPage .= footer(); $xmlPage .= "\n</document>"; return $xmlPage; }
function that calls transformssub mLeftIndex { my $str = ""; my $logoutLink = "<link tab=\"\" view=\"Logout\" title=\"Logout\"/ +>"; my $content = '<leftIndex>'; if ( $Request->ServerVariables("SERVER_NAME")->item() =~ /mlxhelp/ + ) { my $toc_file = ( $Session->{'usrType'} eq 'Pro' ) ? 'e:\Suppor +tWeb\Content\HELP\PRO\TOC.html' : 'e:\SupportWeb\Content\HELP\STD\TOC +.html'; my $user_type = uc $Session->{'usrType'}; open TOC, $toc_file; my @toc_lines = <TOC>; close TOC; foreach my $line ( @toc_lines ) { $content .= qq^<rlink tab="Help" script="frames['help_ifra +me'].location.href='Content/HELP/$user_type/$1'" title="$3"> </rlink>^ if ( $line =~ /<p class="pTOC1"><a href= +"(.*?)"\s+target="(.*?)">(.*?)<\/a>/ ); } $content .= '</leftIndex>'; } if ( $Request->ServerVariables("SERVER_NAME")->item() =~ /tempohelp/ ) + { my $toc_file = ( $Session->{'usrType'} eq 'Pro' ) ? 'e:\Suppor +tWeb\Content\HELP\PRO\TOC.html' : 'e:\SupportWeb\Content\help\tpo\def +ault\TOC.html'; my $user_type = uc $Session->{'usrType'}; if ($user_type='STD') {$user_type='TPO\/default\/'} open TOC, $toc_file; my @toc_lines = <TOC>; close TOC; foreach my $line ( @toc_lines ) { $content .= qq^<rlink tab="Help" script="frames['help_ifra +me'].location.href='Content/HELP/$user_type/$1'" title="$3"> </rlink>^ if ( $line =~ /<p class="pTOC\d"><a href +="(.*?)"\s+target="(.*?)">(.*?)<\/a>/ ); } $content .= '</leftIndex>'; }
sub transform { my $trns = $Server->MapPath("Transforms/pLogin.xsl"); if ($Session->{'isAuthenticated'}) { getMOTD(); SWITCH: { if ($Request->item("View")->item() eq "Resources") { $trns = $Server->MapPath("Transforms/tResources.xsl"); last SWITCH; } if ($Request->item("Tab")->item() eq "Support") { $trns = $Server->MapPath("Transforms/tSupport.xsl"); last SWITCH; } if ($Request->item("Tab")->item() eq "Help") { $trns = $Server->MapPath("Transforms/tHelp.xsl"); last SWITCH; } if ($Request->item("Tab")->item() eq "Training") { $trns = $Server->MapPath("Transforms/tTraining.xsl"); last SWITCH; } if ($Request->item("Tab")->item() eq "Trainers") { $trns = $Server->MapPath("Transforms/tTrainers.xsl"); last SWITCH; } if ($Request->item("Tab")->item() eq "Admin") { $trns = $Server->MapPath("Transforms/tAdmin.xsl"); last SWITCH; } $trns = $Server->MapPath("Transforms/pMain.xsl"); } } return $trns; }
In reply to printing out hash by grashoper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |