Jump to content
Sign in to follow this  
amd.miri

mandatory module's parameters?

Recommended Posts

Hello everybody,

does somebody know how to create a mandatory parameter for a module in the admin site?

 

I explain myself : after installing a module (in my case ,it's a shipping module that I developed myself) , you are directed to the page of the installed module and when you click on the installed module, there are some personalized parameters on the right side to be filled in. so my question is there : how can I have a mandatory parameter? that means that if the parameter is not filled in , then the module should not work... and better the admin can have a message that there's a configuration missing. is that possible?

 

in my case my parameters are defined like this :

 

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('The Netherlands - Sender ID', 'MODULE_SHIPPING_NL_SENDER_ID', '', 'For using this module in The Netherlands, you need to register on test.nl', '6', '0', now())");

 

thanks in advance for your help

Miri

Share this post


Link to post
Share on other sites

There is no validation for what is entered of is is entered, however, the whole thing is a form.

 

Maybe the easiest would be to add a text saying what you want to say, as you already did in the field description

 

To prevent the module from working, you can add a condition for this either within function execute() (or quote()) or earlier, when the class is checking if the module is enabled or not , something like this

Share this post


Link to post
Share on other sites

mmm... your suggestion gives me some new ideas... ok I'll try it and I'll come back for the feedback, thanks Georges ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×