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

Re: [webmaster33] Decide if plugin executed on admin interface or website?

Quote Reply
Re: [webmaster33] Decide if plugin executed on admin interface or website? In reply to
Quote:
But in this case, if I want to have separate admin and user function, I have to duplicate the code, almost the same code (1-5% difference), except the admin has a few prints to display informational text on admin interface.


I'm not sure what you are doing, but surely:

sub modify {
my $am_admin = shift;
# your code here
}
sub admin_modify {
modify(1);
}
sub user_modify {
modify(0);
}

could accomplish what you want.

Cheers,

Alex
--
Gossamer Threads Inc.
Subject Author Views Date
Thread; hot thread Decide if plugin executed on admin interface or website? webmaster33 10964 Sep 5, 2002, 3:47 AM
Thread; hot thread Re: [webmaster33] Decide if plugin executed on admin interface or website?
Andy 10534 Sep 5, 2002, 3:52 AM
Thread; hot thread Re: [Andy] Decide if plugin executed on admin interface or website?
webmaster33 10515 Sep 5, 2002, 4:01 AM
Thread; hot thread Re: [webmaster33] Decide if plugin executed on admin interface or website?
Paul 10544 Sep 5, 2002, 4:05 AM
Thread; hot thread Re: [Paul] Decide if plugin executed on admin interface or website?
webmaster33 10571 Sep 5, 2002, 4:09 AM
Thread; hot thread Re: [webmaster33] Decide if plugin executed on admin interface or website?
Paul 10538 Sep 5, 2002, 4:19 AM
Thread; hot thread Re: [Paul] Decide if plugin executed on admin interface or website?
webmaster33 10499 Sep 5, 2002, 4:30 AM
Thread; hot thread Re: [webmaster33] Decide if plugin executed on admin interface or website?
Paul 10474 Sep 5, 2002, 5:07 AM
Post; hot thread Re: [Paul] Decide if plugin executed on admin interface or website?
webmaster33 10454 Sep 5, 2002, 5:15 AM
Thread; hot thread Re: [webmaster33] Decide if plugin executed on admin interface or website?
yogi 10522 Sep 5, 2002, 4:23 AM
Thread; hot thread Re: [yogi] Decide if plugin executed on admin interface or website?
webmaster33 10562 Sep 5, 2002, 4:33 AM
Thread; hot thread Re: [webmaster33] Decide if plugin executed on admin interface or website?
yogi 10526 Sep 5, 2002, 4:41 AM
Thread; hot thread Re: [yogi] Decide if plugin executed on admin interface or website?
webmaster33 10522 Sep 5, 2002, 5:17 AM
Thread; hot thread Re: [webmaster33] Decide if plugin executed on admin interface or website?
Paul 10465 Sep 5, 2002, 5:23 AM
Post; hot thread Re: [Paul] Decide if plugin executed on admin interface or website?
webmaster33 10520 Sep 5, 2002, 6:03 AM
Thread; hot thread Re: [webmaster33] Decide if plugin executed on admin interface or website?
Alex 10514 Sep 5, 2002, 1:10 PM
Thread; hot thread Re: [Alex] Decide if plugin executed on admin interface or website?
webmaster33 10429 Sep 6, 2002, 12:56 AM
Thread; hot thread Re: [webmaster33] Decide if plugin executed on admin interface or website?
Alex 10546 Sep 6, 2002, 10:50 AM
Thread; hot thread Re: [Alex] Decide if plugin executed on admin interface or website?
webmaster33 10539 Sep 6, 2002, 11:05 AM
Thread; hot thread Re: [webmaster33] Decide if plugin executed on admin interface or website?
Alex 10512 Sep 6, 2002, 11:09 AM
Post; hot thread Re: [Alex] Decide if plugin executed on admin interface or website?
webmaster33 10407 Sep 6, 2002, 11:12 AM