What does the module do?
What does the module do?
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
It is a model dialog (aka popup) that is designed to go off only once by setting a session variable. Upon logging off the session is destroyed, causing my popup to go off once again. So I reset the session variable after the session destroy to keep it from appearing.
Well I'm not sure if I got it 100% right but it seems to be working.
I created a new observer class in /includes/classes/observers
That part I think I understand. Although I'm unsure what the $callingClass could be used for.PHP Code:<?php
class popup extends base {
function popup() {
$this->attach($this, array('NOTIFY_HEADER_END_LOGOFF'));
}
function update(&$callingClass, $notifier, $paramsArray) {
$_SESSION['popup'] = 1;
}
}
?>
Next I created an autoloader to load my class in /includes/auto_loaders/config.popup.php
I guess what throws me here is the 10 and 90. I suppose these tell zen cart when to load the particular code. I suppose the first line loads the class and then the second line runs the popup() code which hooks it into the notifier.PHP Code:<?php
$autoLoadConfig[10][] = array('autoType'=>'class',
'loadFile'=>'observers/class.popup.php');
$autoLoadConfig[90][] = array('autoType'=>'classInstantiate',
'className'=>'popup',
'objectName'=>'popup');
?>
I guess for my purposes this really doesn't matter? That is to say none of my code conflicts with anything else really so when it loads up doesn't matter, just a matter of loading it.
Another approach you could take, again without modifying core files, is to create a file named header_php_popup.php in the /includes/modules/pages/logoff directory, and include the code there. It will be run after the header_php.php file finishes processing and will provide you the same functionality without the complexity of using a notifier.