We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 35549
    • 24 Posts
    Thanks for your interest in my modified version of newspublisher. In the meantime I merged the most recent changes from newspublisher-1.2.1 in and did some other small fixes.
    I also uploaded a transport package that can be easily installed in MODx. It is available here: https://github.com/marcsch/newspublisher/downloads.
    Additionally, I created a small list of all my changes (there are some others besides the image/file TV modifications). It is available here: https://github.com/marcsch/newspublisher/wiki/Newspublisher-modifications

    @rx2: Recently, I discovered (with some help) that it is possible to specify the manager (mgr) context within the Login snippet:
    [[!Login?contexts=`mgr,web`]]
    . This should remove the need for a second login.

    Just be aware of the fact that there might be some bugs around.... Moreover, I think the way how the "base path/-url" settings are passed to the popup window should be improved. Currently it is done with url parameters, which enables users to "break out" and view/modify files in toplevel directories.

    Anyway, I hope that this helps anyone.
    Markus
    • I'm trying to create a separate add-on for adding the file/image browser to any form in the front-end. So far I can actually get the file browser to work by piggy-backing on an installation of NewsPublisher for the action, but it doesn't refresh when uploading a new file - once the file browser is closed and opened again is the newly uploaded file is visible. Everything is so tangled up in various classes and actions and what-not that it's taking a while to get this broken out into a useable optional add-on.

      I suspect it'll have to end up being a full-blown component, to provide the action, and a rather complex snippet to allow for all the possible resource browser configuration parameters to be easily set as needed. Just inserting the javascript code with hard-coded values works (except for the refresh issue), but of course that's hardly acceptable for any kind of useful add-on.
        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
        • 35549
        • 24 Posts
        Did you try doing the same upload procedure from within the manager? I already noticed that files aren't shown after upload (in the manager). I suspect that this is a MODx bug. Only clicking on the folder on the left (which contains them) brings them to being displayed. For some reason this doesn't always seem to happen (only, if no folder was selected before). Can you reproduce this?

        Update: Maybe this can be fixed in 'assets/components/newspublisher/js/widgets/modx.np.browser.js'. This code is adapted from 'manager/assets/modext/core/modx.view.js'. So maybe I "imported" this bug.
        [ed. note: mschlegel last edited this post 12 years, 5 months ago.]
        • Yes, I did notice that in a file-type TV it will open in the folder specified in the path, and the uploaded file will not show until the folder in the left pane is clicked. Once the folder is clicked, then subsequent uploaded files will be displayed immediately. I also notice that when removing files you have to click on the folder in the left panel before the image in the left panel will not show. So a lot of functions aren't refreshing the file view panel.
            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
            • 3749
            • 24,544 Posts
            @Susan: There are a number of free file browser plugins for TinyMCE. The Image browser in NP just loads a small TinyMCE window with just the image browser button in it. It should be possible to do something similar with one of the available file browser plugins. I just haven't had the time. Unfortunately, most of the ones I looked at either had way too many functions (e.g., image editing), or didn't return the file path to TinyMCE (or both), but I suspect that one of them would work with a little tweaking.

            @mschlegel: You've probably thought of this already, but if the use is logged in to the Manager, it's possible for them to enter any Manager URL in the browser address bar and go to that Manager page, so it's critical to limit their mgr permissions before letting them in.
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
            • Have you looked at elFinder? http://elrte.org/elfinder

              The 2.0 beta is impressive. https://github.com/Studio-42/elFinder

              The connector can be run as a snippet, and there are a ton of configuration options to enable or disable its various features that could be initialized as snippet parameters.

              You guys should love it; it involves five class files as well as the connector! Also provides for database storage.

              It uses jQuery and jQuery UI.
              [ed. note: sottwell last edited this post 12 years, 5 months ago.]
                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
                • 3749
                • 24,544 Posts
                I finally got around to testing Markus' many improvements and am merging them into my version.

                @Markus: Can you hold off on any more commits until I've released V1.3.0 (or 2.0.0 -- I haven't decided)? I'm making (or have made) some additional changes to most of the files and we'll have merge conflicts otherwise. [ed. note: BobRay last edited this post 12 years, 4 months ago.]
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 35549
                  • 24 Posts
                  Bob, thanks for taking the time and looking at the changes. I certainly won't do anything...

                  Regarding security: Yes, the user will need manager access permissions. But I think, that the current file browser acces from within TinyMCE (inserting images...) isn't very much different from this, since it requires a mgr login, too. So, in any case (also if only using TinyMCE) it might be a good idea to limit permissions within the manager. I haven't tried, but it should be possible restrict access to the file browser exclusively. I hope that I'm getting this right, I'm not an expert of the Revolution security system...
                    • 3749
                    • 24,544 Posts
                    I've done some testing and it can be done with a fairly limited set of permissions. I'm thinking of installing a NewsPublisher policy with the package containing only the necessary permissions for handling resources and file/image browsing (plus some options for uploading and managing directories).

                    Susan, I did look at elFinder and it certainly looks promising, though Markus' solution seems to work very well and has the advantage of being synchronized with the current MODX version of TinyMCE. [ed. note: BobRay last edited this post 12 years, 5 months ago.]
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                    • I'm busy studying Revo core code, and as soon as I have a grip on it I'll be making connectors to use it with TinyMCE for both Evo and Revo.

                      http://elrte.org/redmine/boards/2/topics/1843
                        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