We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7072 ☆ A M B ☆
    • 43 Posts
    Hi All,

    I am writing a plugin to run when a user is deleted. I want to show either a console window or just a simple message box showing details about what has been deleted e.g.:

    "
    Deleting extended user data...
    1.234 Messages removed successfully...
    567 Images removed successfully...
    89 Valuable data removed successfully...
    Facebook data removed successfully...
    Twitter data removed successfully...
    User was successfully removed!
    "

    $modx->event->output('MESSAGE') can only be used for errors hence it stops the execution.

    So does anyone have any suggestions to how I can do this in my plugin?


      • 18373 ☆ A M B ☆
      • 3,141 Posts
      You'd probably need to find a way to hook into the JS that sends the request to delete the user (e.g. override a click handler) to open up the MODx.Console and to send along the register and topic variables to the connector which instantiates the registry..

      .. then in the processor (or the plugin) you should be able of sending data to the console by using $modx->log(modX::LOG_LEVEL_{LEVEL}, 'Foobar messages removed');

      Does sound like a challenge tho.. be sure to report back when you have it working laugh
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 7072 ☆ A M B ☆
        • 43 Posts
        Quote from: markh at Jul 01, 2014, 09:15 AM
        You'd probably need to find a way to hook into the JS that sends the request to delete the user (e.g. override a click handler) to open up the MODx.Console and to send along the register and topic variables to the connector which instantiates the registry..

        .. then in the processor (or the plugin) you should be able of sending data to the console by using $modx->log(modX::LOG_LEVEL_{LEVEL}, 'Foobar messages removed');

        Does sound like a challenge tho.. be sure to report back when you have it working laugh


        Yeah I had a feeling there wouldn't be any easy solution wink

        My fallback solution is just to create a little log report with the data.