On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hello,

    I’m experiencing some strange behaviour with the Resource Browser at my host (linux server, Modx 0.9.6.2-rc2).

    When I log in with a Web-User account to the front-end site, the Resource Browser won’t display any files at all. However, the files will be normally displayed if I’m also logged to the manager. But what I’m trying to do is give the Web-Users the ability to browse and upload files, WITHOUT logging to the manager, because they’re just not suppossed to have a manager account. I know this can be achieved because I tested the same website on my local IIS development server and eveything works fine (no need to login to the manager).

    I was thinking that maybe it was some file permissions problem, but that’s not the case because my files, flash, images and media folders are all set to 777. I also checked the Tools=>Configuration=>Interfaces&Features=>Web Users settings and confirmed that it’s set to YES. Weird, ’cause It’s just like this setting was being ignored on Linux.

    The code I’m using to generate the TinyMCE Editor is:
    <script language="javascript" type="text/javascript" src="assets/plugins/tinymce3101/jscripts/tiny_mce/tiny_mce.js"></script>
    <script language="javascript" type="text/javascript">
    
    // Configuration detail check http://wiki.moxiecode.com/index.php/TinyMCE:Configuration
    tinyMCE.init({
    	theme : "advanced",
    	mode : "exact", // textareas:    Converts all textarea elements to editors when the page loads. exact: Converts elements of the specified names, as listed in the elements option.
    // This option should contain a comma separated list of element id's to convert into editor instances. This option is only used if mode is set to "exact".
    //	ie:	elements : "elm1,elm2"
           elements : "content",
           relative_urls : true,
           external_link_list_url : "[(base_url)]assets/plugins/tinymce3101/tinymce.linklist.php",
           file_browser_callback : "myFileBrowser",
           theme_advanced_toolbar_location : "top",
           theme_advanced_toolbar_align : "left",
           theme_advanced_statusbar_location : "bottom",
           plugins : "style,advimage,advlink,searchreplace,print,contextmenu,paste,fullscreen,nonbreaking,xhtmlxtras,visualchars,media,table",
           theme_advanced_buttons1 : "undo,redo,selectall,separator,pastetext,pasteword,separator,search,replace,separator,nonbreaking,hr,charmap,separator,image,link,unlink,anchor,media,separator,cleanup,removeformat,separator,fullscreen,code",
           theme_advanced_buttons2 : "bold,italic,underline,strikethrough,sub,sup,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,table,forecolor,backcolor,styleprops",
           theme_advanced_buttons3 : "styleselect,formatselect,fontselect,fontsizeselect"
    });
    
    function myFileBrowser (field_name, url, type, win) {		
           var cmsURL = '/manager/media/browser/mcpuk/browser.php?Connector=/manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath=/&editor=tinymce3&editorpath=/assets/plugins/tinymce3101';
    
    		switch (type) {
    			case "image":
    				type = 'images';
    				break;
    			case "media":
    				break;
    			case "flash": 
    				break;
    			case "file":
    				type = 'files';
    				break;
    			default:
    				return false;
    		}
    		if (cmsURL.indexOf("?") < 0) {
    		    //add the type as the only query parameter
    		    cmsURL = cmsURL + "?type=" + type;
    		}
    		else {
    		    //add the type as an additional query parameter
    		    // (PHP session ID is now included if there is one at all)
    		    cmsURL = cmsURL + "&type=" + type;
    		}
    		
    		tinyMCE.activeEditor.windowManager.open({
    		    file : cmsURL,
    		    width : screen.width * 0.7,  // Your dimensions may differ - toy around with them!
    		    height : screen.height * 0.7,
    		    resizable : "yes",
    		    inline : "yes",  // This parameter only has an effect if you use the inlinepopups plugin!
    		    close_previous : "no"
    		}, {
    		    window : win,
    		    input : field_name
    		});
    		return false;
    	}
    </script>


    Please, any help will be greatly appreciated.

    Mc
    • Anyone please embarrassed