1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ModerationQueue Extend

Discussion in 'XenForo Development Discussions' started by Stepel, Nov 13, 2014.

  1. Stepel

    Stepel Member

    Hi all,

    I added option to ModerationQueue (one more than, delete, approve, nothing). Its 'moveToTrash'.

    I extended ModerationQueueHandler for Post and for Thread. I modified template to add input:radio.
    But SAVE BUTTON in Mod Queue call action "actionSave" in ControllerPublic\ModerationQueue.php

    There is
    and in method saveModerationQueueChanges($queue) i had to add my code lines..to do "moveToTrash" action :(

    else if ($change['action'] == 'moveToTrash') {
    It works as I want.. but I don't want to modify core files..:( What is the best way to do that ?

    replace SAVE BUTTON action by different action and extend more classes ? :/
  2. Aayush

    Aayush Well-Known Member

    You could extend the saveModerationQueueChanges() by using XFCP and extending the XenForo_Model_ModerationQueue. You can then call the parent method, but it would have a caveat. Calling the parent method will first get all the content for populating moderation queues, but since it doesn't return the entries or anything, you'll have to query again to get the entries again and loop through the entries to trash. I would advise to clone the parent method and extend it without calling the parent function. This will work fine over minor updates but it might break over future major updates.
  3. Stepel

    Stepel Member

    Do you mean that i should extend XenForo_Model_ModerationQueue by method which is called the same (saveModerationQueueChanges()) ? like overriding ?
    So better solution is change controller action (in form in moderation queue, by "template modifications") example from ModerationQueue/Save to ModerationQueue/mySave

    and extend then XenForo_Model_ModerationQueue by my own method
    mySaveModerationQueueChanges($queue); ?
  4. Aayush

    Aayush Well-Known Member

    Ya, both ways would work, I can't comment which one is better cause it's just a matter of personal preference.

Share This Page