We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42562
    • 1,145 Posts
    Yes correct! elFinder per se and in se, has not the issue, but my rather mistaken integration
      TinymceWrapper: Complete back/frontend content solution.
      Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
      5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
      • 34118
      • 45 Posts
      Hi DonS,

      I think I've got the same fault as here - https://forums.modx.com/thread/?thread=97694&page=16
      That without the elFinderConnector Default Property Set myModxPermission being set to unlocked there is no way to upload files using the TopNav or RTE elFinders.

      I'm writing a mega user experience post. Tentatively entitled - "TinymceWrapper: its part in my downfall". But found this after a week of clicking on nearly everything trying to get stuff to work.

      The Snippet elFinderConnector Properties.
      I leave the Default and create a new Property Set called elfinderC-PS. Here I change myModxPermission to unlocked and location2 I give a more meaningful name for my test. "Assets Folder elFinderC-PS". Helps my ensure I know what I'm looking at.
      This will function as the pset.

      The Tinymcewrapper Plugin Properties.
      I created a new property set called TMCEW-PS and to ensure something is happening I change the titles as follows:
      elFinderBrowserRTEtitle to "elFinder Awesome RTE Browser".
      elFinderBrowserTopNAVtitle to "elFinder Awesome TopNav Browser"
      And I've even worked out the clever bit that the System Events tab allows 'binding' of the new property set by changing every event that states Default to TMCEW-PS.

      So, the elFinder.html gets a pset via URL Parameters and the TopNav and RTE elFinders should get their Property Set via the System Events??? I think.
      But by Viewing the elFinder Resource no URLs are appended. Fair, enough perhaps the idea these are added manually.
      However, there appears to be no clear mechansism to 'bind' the elFinderC-PS I created earlier - to get the myModxPermission active.

      Found these in the Plugin Properties. Brainwave - added &pset=`elfinderC-PS` at the end. (By default no pset is mentioned).

      elFinderBrowserRTEurl  - 
      [[~[[TinymceWrapperGRF? &knownField=`pagetitle` &kF=`pagetitle` &kFv=`tw_elfinder_browser` &gNuFv=`id`]]? &scheme=`full` &rememberLastDir=`1` &defaultView=`icons` &unlocked=`1` &theme=`windows10` &pset=`elFinderC-PS`]]
      elFinderBrowserTopNAVurl 
      [[~[[TinymceWrapperGRF? &knownField=`pagetitle` &kF=`pagetitle` &kFv=`tw_elfinder_browser` &gNuFv=`id`]]? &scheme=`full` &rememberLastDir=`1` &defaultView=`icons` &unlocked=`1` &theme=`windows10` &pset=`elFinderC-PS`]]


      But brainwave failed.

      And did this http://www.mywebsite.co.uk/tinymcewrapper/elfinder?pset=elfinderC-PS
      And the little locked icons disappear. Good. And the Read changes to read and write. Excellent. But still the Upload won't work "Permission Denied". So the elFinder interface thinks Uploads are allowed but they fail in practise.

      In summary unlocked=`1` and setting a pset via the URL or the Property as above doesn't appear to work. The only way to reliably make Uploads work is to simply turn the Default Property Set myModxPermission to "Default Unlocked". Odd as the "Default unlocked" isn't the default...

      Bug or something I've done wrong? [ed. note: parthian last edited this post 6 years, 11 months ago.]
        • 42562
        • 1,145 Posts
        RE: parthian I think you are a part-time genius, and I award you for your diligence and careful following of the instructions (or lack thereof)

        Pardon me. I have re-written elFinder integration to bypass all this nonsense hoops and loops. It plugs straight into MODX' Media Sources.
        I'd wait for the release.

        For now, I'd admit, that at the time I wrote this old elFinder bridge, I had eaten of the insane root that holds our brains captive.
          TinymceWrapper: Complete back/frontend content solution.
          Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
          5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
          • 34118
          • 45 Posts
          In nature's infinite book of secrecy
          A little I can read.

          Soothsayer, scene ii
          Antony and Cleopatra
          Going to cinema shortly to a Royal Shakespeare Company play of the same.

          One of your earlier works Don S. You could write then: you can find your voice for manuals once again...


          Truth lies within a little and certain compass, but error is immense. - James Agee

          When I get time, docs will come, unless some user beats me to it. Don S. on Structures Forum

          I'm not going anywhere near Structures.

          I'm frightened.

          A little Doc work will go a long way. Not sure whether to add my longer version of the above (it's pretty big). Looks superceeded. As was my investigations of TinyJSONGallery thingy. Double Sigh!

            • 53491
            • 1 Posts
            My first time here, so pardon if this has already been tackled before: is there any reason why Responsive File Manager is set to create folders with permission of 0766 and that uploaded files are set to 0755?

            It drove me nuts on why I'm unable to view my uploaded files, only to realize that they have these unusual permissions. I've already edited the necessary files in my installation (assets/components/tinymcewrapper/responsivefilemanager/filemanager/upload.php and /assets/components/tinymcewrapper/responsivefilemanager/filemanager/include/utils.php), but I'm a little worried that those permissions had a special purpose. Do they?
              • 36760
              • 136 Posts
              Hopefully this thread is still active. I'm back after several months and some time spent working on my "edit a database from a TinyMCE dialog" project. I've made a lot of progress, but I'm stuck at the last part: getting the data from my selected database entry into the content area of the TinyMCE editor.

              I have the plugin file: plugin.js. This works fine, it adds the button to the TinyMCE editor which opens the dialog.
              tinymce.PluginManager.add('example', function(editor, url) {
                editor.addButton('example', {
                  text: 'My button',
                  icon: false,
                  onclick: function() {
                    editor.windowManager.open({
              		title: 'My html dialog',
              		url: 'dialog.html',
              	  });
                  }
                });
              });

              I then have the dialog.html file. This includes the DataTables setup for database management.
              https://pastebin.com/vjGhXRHN (pastebin due to the lengthy file)

              The key piece (I think) is the button created inside DataTables, which should insert the data into the TinyMCE editor. Alternatively, I think I could create a button through TinyMCE on the dialog itself to handle inserting, but I couldn't find a way to do that when using a custom html dialog.
              {
              	 extend: 'selectedSingle',
              	 text:   'Insert into Content' ,
              	 action: function ( e, dt, node, config ) {
              		 var idx = table.cell('.selected', 0).index();
              		 var data = table.row( idx.row ).data();
              		 console.log(data);
              		 console.log(data.name);
              		 //window.opener.tinymce.activeEditor.selection.setContent('Testing');
              		tinyMCE.activeEditor.setContent('Testing');
              		//tinymce.activeEditor.selection.setContent('Testing');
              	 }
               }

              As you can see, I've tried several different ways to insert the content. Using the different methods all produce a result similar to this in the Chrome Console, with no "Testing" text being added to the editor.
              Object {DT_RowId: "row_12", id: "12", type: "spell", name: "Testing Spell", icon: "icon.jpg"}
              Testing Spell
              dialog.html:69 Uncaught TypeError: Cannot read property 'setContent' of null
                  at t.action (dialog.html:69)
                  at r (dataTables.buttons.min.js:13)
                  at HTMLAnchorElement.<anonymous> (dataTables.buttons.min.js:14)
                  at HTMLAnchorElement.dispatch (jquery-1.12.4.js:5226)
                  at HTMLAnchorElement.elemData.handle (jquery-1.12.4.js:4878)

              The data is being pulled from DataTables properly, I just can't figure out how to send it along to TinyMCE. Searching around on Google has shown possible solutions, but those people were using the built in TinyMCE dialog and they didn't work for me.

              I've also tried adding a TinyMCE initialization to my dialog.html file, but that didn't seem to make a difference. The "Testing" content was never added to the editor.
              tinyMCE.init({
                setup: function(editor) {
              	editor.on('init', function() {
              	  tinymce.activeEditor.setContent('Testing');
              	  tinymce.editors[0].setContent('Testing');
              	});
                }
              }); 


              I appreciate any help!
                • 42562
                • 1,145 Posts
                I am glad your project came a long way. That is just awesome how you pursue things. I like it!

                Your present issue now is a very small one, you may be pleased to know.

                Problem (JavaScript. sour child-parent relationship - typical family problems)
                Uncaught TypeError: Cannot read property 'setContent' of null

                Cause
                dialog.html is an iframe, therefore not part of the present DOM in which you have this TinyMCE and activeEditor
                      editor.windowManager.open({
                        title: 'My html dialog',
                        url: 'dialog.html', //iframe
                      });

                Solution
                Find a way to pass the content from iframe to parent document. Try:
                parent.tinymce.activeEditor.setContent('Testing');
                parent.tinymce.activeEditor.windowManager.close();


                Now you can proceed to conquer the whole world.
                Cheers

                PS
                If I have completely misunderstood your problem, ignore this message.
                  TinymceWrapper: Complete back/frontend content solution.
                  Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                  5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                  • 36760
                  • 136 Posts
                  That did the trick! I went through so many TinyMCE help topics and never saw a mention of "parent." I suppose I should have tried it based on jQuery alone. Thanks for the help!
                    • 42562
                    • 1,145 Posts
                    Hi donshakespeare!

                    Thank you for your awesome tinymcewrapper plugin!
                    I've searched the past days to find a solution to prevent tinymcewrapper cleanup for the symbol "&".
                    My problem is that I want to implement a chunk with a parameter (eg. [[chunk? ¶m=`test`]]) but tinymcewrapper cleans the "&" symbol to & and so my chunk won't work.
                    In my search I found some options for tinymce ('invalid_elements', 'custom_elements' or 'entities') but neither of them seemed to work after I wrote them to the system settings of tinymcewrapper.

                    Is there a possible solution to prevent the code cleanup for the symbol "&"?

                    Thanks in advance,
                    wm

                    For now the only option is to disable RTE for code-heavy content. But this is not the answer you seek ...
                    I'll roll a plugin that should be able to achieve this highly-demanded feature.

                    https://www.tinymce.com/docs/configure/content-filtering/#entity_encoding
                    The base entities < > & ' and " will always be entity encoded into their named equivalents. Though ' and " will only be encoded within attribute values and < > will only be encoded within text nodes. This is correct according too the HTML and XML specs.
                      TinymceWrapper: Complete back/frontend content solution.
                      Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                      5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                      • 53612
                      • 4 Posts
                      I've searched the past days to find a solution to prevent tinymcewrapper cleanup for the symbol "&".
                      My problem is that I want to implement a chunk with a parameter (eg. [[chunk? ¶m=`test`]]) but tinymcewrapper cleans the "&" symbol to & and so my chunk won't work.
                      In my search I found some options for tinymce ('invalid_elements', 'custom_elements' or 'entities') but neither of them seemed to work after I wrote them to the system settings of tinymcewrapper.

                      Is there a possible solution to prevent the code cleanup for the symbol "&"?