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
    That is the RFileManager deciding what files to list depending on how you accessed it. This is its default behaviour.
    If you accessed it through the insert link, or accessed RFM without TinyMCE, all files will be listed.
    If you accessed it through insert image, only images are listed.

    That behaviour is controlled by a URL parameter, type=0/1/2/3 (those are the numbers if I remember correctly.
      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.
      • 42562
      • 1,145 Posts
      Quote from: rx2 at Aug 21, 2015, 11:06 PM
      This is a great extra and I have it functioning with one exception. ...
      I attempted to add the usergroup in like this:
      if ($modx->user->isMember('Administrator','Content Editor'))
      ...But it didn't change so I commented the entire section out. Not being a programmer, I figure I have done this erroneously. I gather the name is just a name and it doesn't really identify the id of the group? Or is it that group name has spaces? How does one do this properly?
      Sorry I missed this your post.

      To check if a user is in this OR that group, use array:
      https://rtfm.modx.com/revolution/2.x/developing-in-modx/other-development-resources/class-reference/moduser/moduser.ismember
      $modx->user->isMember(array('Administrator','Content Editor'));

      If Content Editor is the valid name of your group, it will work, no need for ids.
      Personally, I have grown scareful of spaces and underscores in MODx.

      Cheers,
      Thanks for reporting.
        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.
      • Thanks, the check user link is what I used for a reference to attempt to get it to work, so I had:

        //limit access to File Manager, by usergroup or any other criterion you like
        if ($modx->user->isMember('Administrator','Content Editor')) {
        } 
        else {
          die('<div style="position: fixed; margin: auto;width: 400px;height:200px;text-align:center;top:0;bottom:0;left:0;right:0;"><h1>IT SEEMS YOU DO NOT HAVE PERMISSION TO USE THIS COOL MANAGER</h1>BEG SOMEONE TO ADD YOU TO THE ADMINISTRATOR USERGROUP</div>');
        }
        


        But no change. I will try it again and flush all sessions and manually delete the core/cache folder.
        • The other thing I find is that when I create a new resource, I have to save it first before TinyMCE shows up in the Content area. Is there a way to make it show up when you create a new resource?
            • 42562
            • 1,145 Posts
            I figured that TinymceWrapper ought not to be intrusive.
            Many people (including me) want their code to be left alone until otherwise declared.
            The shock of seeing an RTE load automatically and garble up your code can be deadly.

            The plugin reads the Rich Text checkbox value of an existing Resource.
            A new resource is not a valid resource (at least not yet) until saved, even if the checkbox is clicked automatically.
            I can add this as an option.

            Thanks, the check user link is what I used for a reference to attempt to get it to work, so I had:
            //limit access to File Manager, by usergroup or any other criterion you like
            if ($modx->user->isMember('Administrator','Content Editor')) {
            } 
            else {
              die('<div style="position: fixed; margin: auto;width: 400px;height:200px;text-align:center;top:0;bottom:0;left:0;right:0;"><h1>IT SEEMS YOU DO NOT HAVE PERMISSION TO USE THIS COOL MANAGER</h1>BEG SOMEONE TO ADD YOU TO THE ADMINISTRATOR USERGROUP</div>');

            }
            You are still forgetting the word array Look at my above response.
            Or try this
            if ($modx->user->isMember('Administrator') || $modx->user->isMember('Content Editor')) {
            } 
            

            If nothing works, test with a safely named user group, no spaces (ContentEditor)
              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.
            • I'll test that soon. I did indeed miss the word array. Fortunately though not a programmer I am familiar with arrays and that does make sense. Thanks.

              I appreciate the logic behind not showing the RTE instantly, but for clients who don't know HTML, it's an extra step to be able to input copy.
              • The array for the RFM permissions worked. Thank you.
                  • 37105
                  • 194 Posts
                  Quote from: donshakespeare at Aug 23, 2015, 08:14 PM
                  I figured that TinymceWrapper ought not to be intrusive.
                  Many people (including me) want their code to be left alone until otherwise declared.
                  The shock of seeing an RTE load automatically and garble up your code can be deadly.

                  The plugin reads the Rich Text checkbox value of an existing Resource.
                  A new resource is not a valid resource (at least not yet) until saved, even if the checkbox is clicked automatically.
                  I can add this as an option.

                  Clean argument not loading the RTE on creating new resource, but sometimes it's needed to load the RTE on create. Is it possible to override this setting somewhere in the code?
                  A setting to enable/disable this one is a nice feature request I suggest smiley
                    Codeplaza Webdesign: for professional websites at low cost
                    • 42562
                    • 1,145 Posts
                    This might be a quick fix, it works but I have not tested it to see if it breaks any other features.

                    In plugin code, find:
                        if (isset($scriptProperties['resource']) && $resource->get('richtext')) {

                    Replace with:
                     if ($modx->getOption('richtext_default')) {

                    If user has richtext_default set to yes, in System Settings TinyMCE with load for all resources, existing and new.

                    Please test.

                    Will add it as option in future release.
                      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.
                      • 37105
                      • 194 Posts
                      Quote from: donshakespeare at Aug 24, 2015, 03:00 PM
                      This might be a quick fix, it works but I have not tested it to see if it breaks any other features.

                      In plugin code, find:
                          if (isset($scriptProperties['resource']) && $resource->get('richtext')) {

                      Replace with:
                       if ($modx->getOption('richtext_default')) {

                      If user has richtext_default set to yes, in System Settings TinyMCE with load for all resources, existing and new.

                      Please test.

                      Will add it as option in future release.

                      Thanks for the quick fix. Did alter the code and now the wrapper is loading fine on creating new resource! Till now I don't see any other issues due to changing the code. smiley
                        Codeplaza Webdesign: for professional websites at low cost