Module Development: Possible to display a message on next page?

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Module Development: Possible to display a message on next page?

Post by calguy1000 »

Well.... there are some functions, like 'ShowMessage()' and 'ShowErrors()' that are useful for displaying semi-standardized messages in actions..... you just have to supply the text for them.

Here's what I normally do:

a) When calling Redirect($id,'defaultadmin',$returnid,$parms)  I set a message into the parms array.

i.e:

Code: Select all

$parms = array();
$parms['message'] = $this->Lang('blah');
$this->Redirect($id,'defaultadmin',$returnid,$parms);
Then in the defaultadmin action...

Code: Select all

if( isset($params['message']) )
{
  echo $this->ShowMessage($params['message']);
}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Module Development: Possible to display a message on next page?

Post by calguy1000 »

The params are supplied as an argument to the DoAction method. and don't exist before that.

I've setup something similar in CGExtensions, take a look at that (from svn)
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Post Reply

Return to “Developers Discussion”