Zen Cart Logo
Forums / General Questions / admin/catelogue common areas?

admin/catelogue common areas?

Locked

Views: 901

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
7 Nov 2006, 6:48 PM
#1
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

admin/catelogue common areas?

I should know this by now...

Is there a way to make defines, configures, and/or functions accessible to both admin and store areas??

Specifically, I'm adding a feature to my site so that a customer can request a product (rather than order... don't ask). The customer creates the request, and the customer can also delete the request. The admin, can also delete a request. I've finished with the admin site... and when the delete is done it sends out a formatted email to the customer. I want the same thing to happen when the customer does it, without having to re-create all the defines and functions.

The functions aren't a big deal really... its more the defines. Because if the admin wants to change a typo (for example) it has to be done in two places.

I was wondering if there was already a way to do this?

  • Steven
7 Nov 2006, 10:00 PM
#2
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: admin/catelogue common areas?

Is there any problem with putting something like this at the top of my admin page that wants to use a function (or datafile, or whatever) from the shop?

require('../includes/functions/extra_functions/functions_somePage.php');

It'd be nice to hear from a developer that can tell me if that introduces some security problem, etc.

Thanks.

  • Steven
8 Nov 2006, 1:00 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: admin/catelogue common areas?

Yes, you can have the admin call catalog files. In fact, the admin does this already for many of the classes and functions, and v1.4 will consolidate things even more.
You could use the autoloader and init system to have it auto-load some components if you needed to. Or doing a direct require from within your module is fine too.

8 Nov 2006, 1:07 AM
#4
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: admin/catelogue common areas?

Cool...thanks! I just wanted to make sure I wasn't somehow opening a can of worms.

  • Steven