Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14
  1. #11
    Join Date
    Nov 2008
    Posts
    46
    Plugin Contributions
    0

    Default Re: Add Admin configuration menu item (again)

    Quote Originally Posted by lat9 View Post
    @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

  2. #12
    Join Date
    Jul 2012
    Posts
    16,446
    Plugin Contributions
    17

    Default Re: Add Admin configuration menu item (again)

    Quote Originally Posted by reetp View Post
    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...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #13
    Join Date
    Nov 2008
    Posts
    46
    Plugin Contributions
    0

    Default Re: Add Admin configuration menu item (again)

    Quote Originally Posted by mc12345678 View Post
    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

  4. #14
    Join Date
    Jul 2012
    Posts
    16,446
    Plugin Contributions
    17

    Default Re: Add Admin configuration menu item (again)

    Quote Originally Posted by reetp View Post
    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.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Trying to add backup_mysql menu item to admin
    By diytools in forum Basic Configuration
    Replies: 18
    Last Post: 25 Mar 2016, 04:45 AM
  2. How do i add an item to the admin menu
    By tcarden in forum General Questions
    Replies: 1
    Last Post: 17 Apr 2013, 11:12 PM
  3. Replies: 9
    Last Post: 9 Mar 2009, 08:31 PM
  4. Add Item to Admin Menu
    By jacque427 in forum Customization from the Admin
    Replies: 1
    Last Post: 21 Sep 2006, 01:56 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR