Morning All,
 
What I have below works, but for some reason I'm not all that comfortable with it.. Could someone tell me if I'm doing anything evil with my approach??
 
MP2 (ParseNav.pm) Script Description:
Needed a script to create page navigation, the nav needs to be called within other MP2 scripts as well as in standard static pages (via ssi)
 
When I want the nav within another MP2 script, I simply...
 
 my $top_nav = SCRIPTS::ParseNav->cgi_nav($r);
 
When I want the nav in a static HTML page, I simply..
 
<!--#include virtual="/parsenav" -->
 
Below is the basic ParseNav script - TIA for any help or advise..
-Chris
 
####################################################################package SCRIPTS::ParseNav;

use strict;
use vars qw($r);

###### Set some Constants
# Template Path
$ENV{'HTML_TEMPLATE_ROOT'} = xxx";
# Our Content Template
my $content = "Navigation.tmpl";

######################################################################
# Main
# Our Mod_Perl Content Handler
sub handler {
 $r = shift;

 &cgi_nav();

 # As this is being called from a include, set a header and print it out
 $r->send_http_header;
 print $content->output; 
 
 # Return our header as we are done!!!
 return Apache::OK;
 
} # End of Sub
######################################################################
sub cgi_nav {
 my ($self,$r) = @_;

# do what we want to do and return the content template to the requesting MP2 script

return $content;

}


 

 
 
 
 
 
 
 

Reply via email to