Re: Add Admin configuration menu item (again)
Quote:
Originally Posted by
lat9
@reetp, since you are adding only to configuration elements, that filename is not needed.
It's used if you are providing a new, separate, tool/item for the admin processing and defines the file name (no .php extension) that is associated with your new tool and is used in the tool's admin-page registration.
OK - got that thank you.
One last....$zco_notify
The old code had a line like this for notifying a clean install (though I am not sure if it actually worked)
Code:
$zco_notifier->notify('SOCIAL_MEDIA_EXTRA_FUNCTIONS_INSTALL_END', array('group_id' => $group_id));
I was wondering about a good install/failed install for the logs e.g.
Code:
global $db, $zco_notifier;
$project = PROJECT_VERSION_MAJOR . '.' . PROJECT_VERSION_MINOR;
// Are we a supported version ?
if (PROJECT_VERSION_MAJOR > '1' || PROJECT_VERSION_MINOR >= '5.5') {
// Do some stuff
// Notify a good install
$zco_notifier->notify('SOCIAL_MEDIA_EXTRA_FUNCTIONS_INSTALL_END', array('group_id' => $group_id));
} else {
// Notify a Failed installed
$zco_notifier->notify('SOCIAL_MEDIA_EXTRA_FUNCTIONS_INSTALL_FAIL', ' Version Fail < 1.5 :- ' . $project);
}
Is this correct syntax ?
Where do I define the notifys? I thought possibly in admin/includes/languages/english/extra_definitions/social_media_icons.php but I wasn't sure.
B. Rgds
John
Re: Add Admin configuration menu item (again)
Quote:
Originally Posted by
reetp
OK - got that thank you.
One last....$zco_notify
The old code had a line like this for notifying a clean install (though I am not sure if it actually worked)
Code:
$zco_notifier->notify('SOCIAL_MEDIA_EXTRA_FUNCTIONS_INSTALL_END', array('group_id' => $group_id));
I was wondering about a good install/failed install for the logs e.g.
Code:
global $db, $zco_notifier;
$project = PROJECT_VERSION_MAJOR . '.' . PROJECT_VERSION_MINOR;
// Are we a supported version ?
if (PROJECT_VERSION_MAJOR > '1' || PROJECT_VERSION_MINOR >= '5.5') {
// Do some stuff
// Notify a good install
$zco_notifier->notify('SOCIAL_MEDIA_EXTRA_FUNCTIONS_INSTALL_END', array('group_id' => $group_id));
} else {
// Notify a Failed installed
$zco_notifier->notify('SOCIAL_MEDIA_EXTRA_FUNCTIONS_INSTALL_FAIL', ' Version Fail < 1.5 :- ' . $project);
}
Is this correct syntax ?
Where do I define the notifys? I thought possibly in admin/includes/languages/english/extra_definitions/social_media_icons.php but I wasn't sure.
B. Rgds
John
$zco_notify type actions are ZC internal "gosub" callers. They tell the internal system: I am here, if you are listening (observer) then do whatever you do when you know I have gotten to this point.
It can be used to provide some sort of standard "I'm done" type notification, but there are other ways to target that type of reaction as well, can use the messageStack to display a message, can make an admin log entry (suggested for PCI compliance) to identify a change in the database, etc...
A notifier/observer pair as coded above is good for repeated work/incorporation of other actions, data changes, database manipulation, etc...
Re: Add Admin configuration menu item (again)
Quote:
Originally Posted by
mc12345678
It can be used to provide some sort of standard "I'm done" type notification, but there are other ways to target that type of reaction as well, can use the messageStack to display a message, can make an admin log entry (suggested for PCI compliance) to identify a change in the database, etc...
Ahhh OK thanks. I was trying to get a log entry.
Being totally dense and a 'non-coder' i.e. amateur hack can you give me a rough idea of how you get a log entry or point me to some docs on the subject?
B. Rgds
John
Re: Add Admin configuration menu item (again)
Quote:
Originally Posted by
reetp
Ahhh OK thanks. I was trying to get a log entry.
Being totally dense and a 'non-coder' i.e. amateur hack can you give me a rough idea of how you get a log entry or point me to some docs on the subject?
B. Rgds
John
So the operations are covered under the three classes related to event logging in admin/includes/classes, but a generic function that works with ZC 1.5.3 (I think or its 1.5.4 can't recall) and above without any additional code (there is a plugin by lat9 that supports backwards compatibility to 1.5.0 and above).
Code:
zen_record_admin_activity('my message to log.', 'warning');
That is an example with a warning style entry, but the others are covered in at least one of the three classes.
Pretty much can look for anywhere in the admin that say a customer's data is modified, or a sales record is modified for an example.