We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18336
    • 3 Posts
    I want to be able to delete a resource while using quickmanager.
    But when I choose "edit resource" on the front-end I only get the "save" and "cancel" buttons, no "delete" and "preview" button. Does anybody know what I’m doing wrong?

    Is it already possible to add a delete button to the front-end buttons of quickmanager?

    Thank you so much!
      • 16610
      • 634 Posts
      Unfortunately QuickManager+ doesn’t have delete button feature. Preview button is removed deliberately since QM+ works only from preview/front-end.
        Mikko Lammi, Owner at Maagit
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        I believe that the idea was is that front-end editors should only be able to unpublish; then an admin user could go to the Manager and verify the deletion and do the actual deleting.

        Of course, "delete" only marks a resource for deletion, and you have to empty the trash to really remove it, but what’s the purpose of adding the complexity of two more functions to QM when unpublish will have the same effect.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 36805
          • 354 Posts
          I use QM+ to edit ditto listed subdocuments. In the document tree it is very complex. Hence, in our case, QM inline buttons are a huge improvement.

          I didn’t notice the missing delete until just now. I don’t want to send my end users to the backend for deletion of these subpages. To them they are part of the page instead of a page itself. I really just use this setup because MODx doesn’t allow tv arrays.

          How can I hack a delete button back into the QM+ docform OR get an inline delete button? I know it must be purged afterwards but I can educate them accordingly.

          Any help would be much appreciated.
            • 16610
            • 634 Posts
            Quote from: MrDutchy at Mar 16, 2011, 02:38 AM

            How can I hack a delete button back into the QM+ docform OR get an inline delete button? I know it must be purged afterwards but I can educate them accordingly.

            You don’t need to hack to implement delete button:
            http://modxcms.com/forums/index.php/topic,59918.msg340779.html#msg340779

            Edit... Ah, but this won’t work in your case since you are using inline buttons. In this special case I would write a custom snippet (not connected with QM+) with custom delete buttons showing in Ditto listing.
              Mikko Lammi, Owner at Maagit
              • 36805
              • 354 Posts
              I’d rather have the delete button in the modal docform QM+ provides.

              If a snippet with a delete link is easier I’d implement it that way though. But I wouldn’t know how.

              It is completely undocumented what kind of urls trigger a manager action. Since the backend runs in a frame I’m not sure how to figure it out. Maybe I should ask elsewhere, I’m not sure.
                • 16610
                • 634 Posts
                If you want to hack it, you’ll have to add the delete button to line 701 in file "assets/plugins/qm/qm.inc.php". Look for MODX manager source how the delete button is implemented.
                  Mikko Lammi, Owner at Maagit
                  • 36805
                  • 354 Posts
                  Thanks that works, sort of. But if I do it that way I can’t make it close the modal box and refresh the orginal page. Today I did a lot of digging around and I can’t think of an easy way.

                  So for now the modal box will remain and the page will not refresh. I suppose my manual will have to mention "After deletion Click X and press F5". Better than nothing though wink
                    • 36805
                    • 354 Posts
                    I’ve hacked qm.inc.php to providee a working delete button, which closes the colorbox too. Afterwards it redirects to the parent of the deleted document. I’ve attached my version to this post. It is based on the latest QM+ 1.5.5.

                    It is kind of crude but effective. Specifically:The delete button text is hardcoded and it does not have a javascript confirm dialog.

                    If someone wants to use it (at own risk): check 2 additional event triggers for the QM+ plugin:

                    • OnBeforeDocFormDelete
                    • OnDocFormDelete