Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Running CGI from Plugin Menu

Quote Reply
Running CGI from Plugin Menu
Am I better to run a seperate CGI from the plugin menu, or turn it into an internal sub of my plugin?

Example:

install.pm
myplugin.pm
catdepth.cgi <- repair function

Menu:

Installed Plugins

My Plugin
Menu Item 1
Repair Function <- repair function




If it is better run this as a bundled cgi, then how do I call this file from my sub?

sub repair {
# -------------------------------------------------------------------
# This subroutine will get called whenever the user clicks
# on 'repair' in the admin menu. Remember, you need to print
# your own content-type headers; you should use
#
# print $IN->header();
#

}

Thanks again!

Last edited by:

sooke: May 14, 2002, 10:07 AM
Quote Reply
Re: [sooke] Running CGI from Plugin Menu In reply to
It's better to go through admin.cgi. You can call:

admin.cgi?do=plugin&plugin=YOURPLUGIN&func=somefunction

and that will run Plugins::YOURPLUGIN::somefunction(). This saves having to create a separate cgi, and set permissions, etc.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Running CGI from Plugin Menu In reply to
Good! Thanks Alex.

Edit: Got the function working great now!

Last edited by:

sooke: May 14, 2002, 10:38 AM