We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27442
    • 103 Posts
    Quote from: BlueIndigo at Oct 17, 2008, 08:25 PM

    Quote from: mcclausky at Oct 17, 2008, 04:19 PM

    Quote from: sjh_vt at Aug 08, 2008, 12:09 AM

    Yes, thanks for that. The installer for the new plugin for TinyMCE 3.1.x seems to be using a different mcpuk instead of the one in the manager folder, but the modification works. The TinyMCE installer creates and uses /assets/plugins/tinymce3101/mcpuk. Use the frmresourcetype.html file there once you upgrade.

    Hello, smiley

    I have TinyMCE 3101 but there’s no assets/plugins/tinymce3101/mcpuk folder. The only folders below tinymce3101/ are: jscripts and lang. Should I use the mcpuk folder located in manager\media\browser ?

    Thanks.

    Mc


    Yep, i think you have to use manager/media/browser/mcpuk/frmresourcetype.html like i said in previous post ...



    Right, the path that I posted fell under a particular set of conditions: that was for a 0.9.5.? (or some earlier version) modx installation where TinyMCE had been upgraded (from whatever verions of TinyMCE that it originally came with) using the TinyMCE from the download repository. A fresh 0.9.6.2 installation [with TinyMCE 3.2.0.1 built in] seems to be back to using the manager/media/browser/ path for mcpuk
      • 18878
      • 210 Posts
      Quote from: BlueIndigo at Oct 17, 2008, 09:00 PM

      Yes, I know this problem. In fact it’s not really a problem : you can still select the folder you want.

      Well, I’ve take a look and here is what you can try :

      Edit the file manager/media/browser/mcpuk/js/common.js (make a backup before)
      Add this function :
      function AddSelectOptionSelected( selectElement, optionText, optionValue, optionSelected )
      {
      	var oOption = document.createElement("OPTION") ;
      
      	oOption.text	= optionText ;
      	oOption.value	= optionValue ;	
      	
      	oOption.setAttribute('selected', 'selected');
      
      	selectElement.options.add(oOption) ;
      
      	return oOption ;
      }

      (you can see that is a copy of the AddSelectOption function, I’ve just added the line oOption.setAttribute(’selected’, ’selected’); )

      Save. Now edit the file manager/media/browser/mcpuk/frmresourcetype.html (make a backup)
      Replace
      AddSelectOption( cmbTypeObj, aTypes[i][1],aTypes[i][0] ) ;

      By
      	if ( !bHasType || aTypes[i][0] == oConnector.ResourceType)  // IF type is the same, we have to make the option "selected"
      	{
      		AddSelectOptionSelected( cmbTypeObj, aTypes[i][1],aTypes[i][0] ) ;
      	} else 
      	{// IF not, only add this option
      		AddSelectOption( cmbTypeObj, aTypes[i][1],aTypes[i][0] ) ;
      	}
      	}
      


      Save. Upload. Test.

      I can’t test now, so you have to tell me if it works grin

      Good luck.

      EDIT : My bad, i’ve found an error in the code. It’s fix now. Verify it’s the same for you.

      BlueIndigo:

      Thanks a lot!! It works perfectly laugh

      The only thing I noticed is that this part of the code:
      if ( !bHasType || aTypes[i][0] == oConnector.ResourceType)  // IF type is the same, we have to make the option "selected"
      	{
      		AddSelectOptionSelected( cmbTypeObj, aTypes[i][1],aTypes[i][0] ) ;
      	} else 
      	{// IF not, only add this option
      		AddSelectOption( cmbTypeObj, aTypes[i][1],aTypes[i][0] ) ;
      	}
      	}
      

      ...has an extra unnecessary } , so I removed it.

      Thanks again!

      Mc
        • 3638
        • 21 Posts

        No prob wink glad to help you.

        (I’ve modified the "}" in the previous post)
          • 9649
          • 33 Posts
          I was searching for a solution to enabling another folder to be active in the drop down list when inserting images through tinymce/mcpuk so that I could enable the ’galleries’ folder that maxigallery uses. This will allow me to reuse images that I have already uploaded into maxigallery in other pages.

          I found the below post which helped initially to show the full list of resource types but didn’t show any other folders in the ’assets’ folder.

          But I cracked it!


          • First make the change that BlueIndigo supplied below;
          • Then in the same file ’frmresourcetype.html’ you need the find the line:
          ['images','Images'],

          • Copy and paste that line so it is duplicated and change the new line to:
          ['galleries','Galleries'],

          • Then find the file: manager/media/browser/mcpuk/connectors/php/config.php
          • At around line 171 is the //Image area array:
          //Image area
          $fckphp_config['ResourceAreas']['images'] =array(
          	'AllowedExtensions'	=> $upload_images,
          	'AllowedMIME'		=>	array(),
          	'MaxSize'		=>	$upload_maxsize,
          	'DiskQuota'		=>	-1,
          	'HideFolders'		=>	array("^\."),
          	'HideFiles'		=>	array("^\."),
          	'AllowImageEditing'	=>	true //Not yet complete, but you can take a look and see
          	);

          • Copy and paste this section again and rename ’images’ to ’galleries’
          • This is important tso that when you select the Galleries folder from the list it actually shows all images with image type extensions ie. jpg, png, gif etc.
          • Then the last step is to add ’galleries’ as a ResourceType at the end of that file
          • It will now be about line 284 to now look like this:

          $fckphp_config['ResourceTypes'] = array('files','images','flash','media','galleries');



          And that is it - all worked perfectly for me smiley

          Hope this helps someone out there!

          --------------------------------


          Quote from: BlueIndigo at Jul 17, 2008, 10:23 AM


          I was searching for the same problem and after a while playing with files I’ve found a little trick to do.

          What I’ve done :

          • Search for the file : manager/media/browser/mcpuk/frmresourcetype.html
          • Backup it grin
          • Edit this file
          • Search for the "window.onload" function, line 40 for me
          • In this function, find the line (start line 46 for me)
          if ( !bHasType || aTypes[i][0] == oConnector.ResourceType ) AddSelectOption( cmbTypeObj, aTypes[i][1],aTypes[i][0] ) ;

          • Replace it by (in fact, you comment the if test so the AddSelectOption will be always run
          /*if ( !bHasType || aTypes[i][0] == oConnector.ResourceType )*/ AddSelectOption( cmbTypeObj, aTypes[i][1],aTypes[i][0] ) ;

          • Save
          • It’s ok now, you can always access to Files, Media, Image, Flash folder

          That’s it. It’s not really beautiful but I don’t know how to do this in an other way. tongue

          Maybe later you could add options like "Authorized folder" for each type in the MCPUK.

          Hope this help.

            • 1330
            • 79 Posts
            I am having this same issue. I can’t link to images. Anyone find a workaround for the newer versions?
              • 21459
              • 10 Posts
              I’m not sure this is what you’re looking for, but if you want to create a LINK to an image file, you first have to set the File Manager to accept image files as uploads (even if you don’t want to upload anything). To do this (in MODx 1.0.2):
              - Go to Tools > Configuration > File Manager (the last tab).
              - In the second option, called "Uploadable File Types", add the desired file extensions.

              As soon as this type of upload is permitted, the image files within the "Files" folder are displayed and you can select them as links.

              Is this what you needed?
              Nicochto
                • 18878
                • 210 Posts
                Quote from: amazon3d at Mar 25, 2009, 02:50 AM

                I am having this same issue. I can’t link to images. Anyone find a workaround for the newer versions?


                Here’s the solution:

                Open manager\media\browser\mcpuk\frmresourcetype.html. In order to enable the Resource Browser to display all File Types (images, files, media, etc), comment line 46 and 47:
                /* McCommented
                      if ( !bHasType || aTypes[i][0] == oConnector.ResourceType ) 
                           AddSelectOption( cmbTypeObj, aTypes[i][1], aTypes[i][0] ) ; */


                And add the following lines after it:
                  /*McAdded */
                  /* http://modxcms.com/forums/index.php/topic,13450.msg181280.html#msg181280 */
                  // IF type is the same, we have to make the option ""selected""
                  if ( !bHasType || aTypes[i][0] == oConnector.ResourceType)  
                  {
                   AddSelectOptionSelected( cmbTypeObj, aTypes[i][1],aTypes[i][0] ) ;
                  }
                  else // IF not, only add this option
                  {
                   AddSelectOption( cmbTypeObj, aTypes[i][1],aTypes[i][0] ) ;
                  }
                  /* END McAdded */
                



                Then, open manager\media\browser\mcpuk\js\common.js, and to enable the Resource Browser to display all File Types, the following function has to be added at the beginning of everything:
                 /* McAdded */
                 /* http://modxcms.com/forums/index.php/topic,13450.msg181280.html#msg181280 */
                 function AddSelectOptionSelected( selectElement, optionText, optionValue, optionSelected )
                {
                 var oOption = document.createElement("OPTION") ;
                 oOption.text = optionText ;
                 oOption.value = optionValue ; 
                  oOption.setAttribute('selected', 'selected');
                 selectElement.options.add(oOption) ;
                 return oOption ;
                }
                /* End McAdded */ 
                


                Hope it helps.

                Mc
                  • 26931
                  • 2,314 Posts
                  Here’s the solution:
                  thanks mcclausky smiley
                    • 26931
                    • 2,314 Posts
                      • 36667
                      • 57 Posts
                      Peter Falkenberg Brown Reply #30, 14 years ago
                      Hi,

                      I tried the code solution above, using Evo 1.0.2 and TinyMCE 3.2.4.1,
                      modifying the files under manager.

                      Now, when I click on an image, and then select the file link option,
                      and go to the link tree, it no longer has the type value in the dropdown.

                      However, it still blocks me from going up to the parent dir, and then
                      selecting the images folder, to link to an image file.

                      And, when I use the images upload function from MCE, it only allows me to upload
                      images in the images folder, not the files folder.

                      I think the missing element is that we need to be able to traverse up to the assets
                      folder, and then down to the images folder, or better yet, in both the images and files
                      interfaces, not be blocked, and have access to any folder.

                      Thanks,

                      Peter Brown

                        Visit The Significato Journal ~ nectar for the soul ~ http://significatojournal.com