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,
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 ...
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
Good luck.
EDIT : My bad, i’ve found an error in the code. It’s fix now. Verify it’s the same for you.
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] ) ; } }
['images','Images'],
['galleries','Galleries'],
//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 );
$fckphp_config['ResourceTypes'] = array('files','images','flash','media','galleries');
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
- 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.
Maybe later you could add options like "Authorized folder" for each type in the MCPUK.
Hope this help.
I am having this same issue. I can’t link to images. Anyone find a workaround for the newer versions?
/* McCommented if ( !bHasType || aTypes[i][0] == oConnector.ResourceType ) AddSelectOption( cmbTypeObj, aTypes[i][1], aTypes[i][0] ) ; */
/*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 */
/* 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 */