We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25551 ☆ A M B ☆
    • 1,231 Posts

    Hey I installed Tinymce30 that is in the downloads area and I tried the the code below but it will not load Tinymce... I changed all the tinymce303 to tinymce30 as that’s the folder in my plugins area but it will not load up. The older script worked for the default tinymce version that comes with MODx. Any ideas why it won’t load?

    Thanks, Ross


    EDIT

    I forgot to set the exacts parameter in the code below.... WORKING!

    Is there a way you can specify an images folder for the Tinymce so users can’t see the images in the assets/images folder or delete them? It would be cool if you could specify a separate folder from this or even give individual folders to users.

    By the way FDM is amazing Soda... Dimmy has helped me a great deal getting this working and it’s truly a nice snippet. I checked your site out and it’s really cool, just a shame I don’t speak French to read it.

    Ross

    Quote from: endif at Mar 18, 2008, 06:30 AM


    <script language="javascript" type="text/javascript" src="[(base_url)]assets/plugins/tinymce303/jscripts/tiny_mce/tiny_mce.js"></script>
    <script language="javascript" type="text/javascript" src="[(base_url)]assets/plugins/tinymce303/xconfig.js"></script>
    <script language="javascript" type="text/javascript">
    	tinyMCE.init({
    		  theme : "advanced",
    		  mode : "exact",
    		  width : "100%",
    		  height : "400",
    		  relative_urls : true,
    		  document_base_url : "/",
    		  remove_script_host : true,
    		  language : "de",
    		  elements : "fdmContent",
    		  valid_elements : tinymce_valid_elements,
    		  extended_valid_elements : tinymce_extended_valid_elements,
    		  invalid_elements : tinymce_invalid_elements,
    		  entity_encoding : "named",
    		  cleanup: true,
    		  apply_source_formatting : true,
    		  remove_linebreaks : false,
    		  convert_fonts_to_spans : "true",
    		  file_browser_callback : "myFileBrowser",
    		  external_link_list_url : "/assets/plugins/tinymce303/tinymce.linklist.php",
    		  theme_advanced_blockformats : "p,h1,h2,h3,h4,h5,h6,div,blockquote,code,pre,address",
    		  plugins : "style,advimage,advlink,searchreplace,print,contextmenu,paste,fullscreen,nonbreaking,xhtmlxtras,visualchars,media",
    		  theme_advanced_buttons0 : "",
    		  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,print,code,help",
    		  theme_advanced_buttons2 : "bold,italic,underline,strikethrough,sub,sup,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect,separator,styleprops",
    		  theme_advanced_buttons3 : "",
    		  theme_advanced_buttons4 : "",
    		  theme_advanced_toolbar_location : "top",
    		  theme_advanced_toolbar_align : "left",
    		  theme_advanced_path_location : "bottom",
    		  theme_advanced_disable : "",
    		  theme_advanced_resizing : false,
    		  theme_advanced_resize_horizontal : false,
    		  plugin_insertdate_dateFormat : "%Y-%m-%d",
    		  plugin_insertdate_timeFormat : "%H:%M:%S",
    		  button_tile_map : false 
    
    	});
    	function myFileBrowser (field_name, url, type, win) {		
    		var cmsURL = '/assets/plugins/tinymce303/mcpuk/browser.php?Connector=/assets/plugins/tinymce303/mcpuk/connectors/php/connector.php&ServerPath=/&editor=tinymce3&editorpath=/assets/plugins/tinymce303';    // script URL - use an absolute path!
    		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>
    


      Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
      AugmentBLU - MODX Partner

      BLUcart - MODX Revolution E-Commerce & Shopping Cart
      • 25551 ☆ A M B ☆
      • 1,231 Posts
      Ok tinymce works now.... I just noticed the latest version here is 309 and this works nicely but if I sign in as a webuser and edit the document... tinymce shows up as it should. When i click insert media of image the pop appears but when I click browse images or media there is nothing in the images folder and I can not upload. I assume there’s a permissions issue with a webuser accessing this area via tinymce or something?

      Any help available for this or is this the wrong thread for this issue?

      Ross

      The URL in the bar when the browse image folder appears is this

      http://www.Mysite./assets/plugins/tinymce309/mcpuk/browser.php?Connector=/assets/plugins/tinymce309/mcpuk/connectors/php/connector.php&ServerPath=/&editor=tinymce3&editorpath=/assets/plugins/tinymce309&type=images

      would this explain the problem or it this totally irrelevant?
        Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
        AugmentBLU - MODX Partner

        BLUcart - MODX Revolution E-Commerce & Shopping Cart
        • 6726
        • 7,075 Posts
        Yes you can’t access the ressources browser from the frontend, security indeed... I believe that there is a new feature in 0.9.6.2 RC1 which allow you to grant access to the resource browser for trusted webusers, I noticed this when I translated to french the language file.

        Indeed I checked if you need this install 0.9.6.2 RC1 and go to Tools > Configuration > Interface and Features :

        [tt]Web Users? Yes/ No

        Do you want to allow a web user the ability to use the resource browser? WARNING: Allowing web users the use of the resource browser exposes the files available to manager users. Only use this option for trusted web users.[/tt]

        :)
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l&#39;outil id
          • 25551 ☆ A M B ☆
          • 1,231 Posts
          OH i’m using 0.9.6.1p2 ....... I never knew there was another update!

          Now i’m going to have to find the easiest way to upgrade my MODx now :’(

          That’s if I can find 0.9.6.2 RC1

          Thanks David.
            Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
            AugmentBLU - MODX Partner

            BLUcart - MODX Revolution E-Commerce & Shopping Cart
            • 6726
            • 7,075 Posts
            It’s not really an upgrade - 0.9.6.2 is not a final version but a Release Candidate.
            It should be pretty stable though. You might have noticed MODx betas are pretty ironed out and stable already. This is a RC, pre-release stage, and that’s better than a beta... I have upgraded several sites with no issue so far and I have some complex MODx setups tongue

            That won’t be hard to find, it’s on the alpha/beta/preview, there is a link on the MODx download page wink
            http://modxcms.com/beta.html

            As far as upgrading goes, it’s pretty easy with MODx, follow the instruction and it will go smooth smiley
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l&#39;outil id
              • 25551 ☆ A M B ☆
              • 1,231 Posts
              Ok updated and I see the option to allow web users.... I enabled it and signed in to my webuser account. I loaded the edit page and tinymce appears. I clicked add image and then browse for file, the popup window appears which says images folder but there’s nothing in it, I can’t create folders nor upload. It says access denied?
                Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                AugmentBLU - MODX Partner

                BLUcart - MODX Revolution E-Commerce & Shopping Cart
                • 6726
                • 7,075 Posts
                Didn’t use this feature yet, but your problem could be related to permission after you uploaded the files, did you check the permission ?
                a CHMOD might be necessary...
                  .: COO - Commerce Guys - Community Driven Innovation :.


                  MODx est l&#39;outil id
                  • 25551 ☆ A M B ☆
                  • 1,231 Posts
                  Could you tell me which folders I need to check other than the ones I’ll list here.... Also do I need to change anything within the MODx manager config area at all other than allow webusers?

                  Folders I think need looked at... correct me if I need to add or check others.

                  Folder Permissions using FTP
                  assets/images 755
                  assets/media 755

                  Interface & Features
                  Enable Resource Browser : yes
                  Web Users : yes
                  Rewrite browser paths : yes
                  Resource Path : /home/sites/mysite/public_html/assets/
                  Resource URL: http://mysite.com/assets/


                  File manager settings

                  File Manager Path: /home/sites/mysite/public_html/
                  New File Permissions : 0644
                  New Folder Permissions : 0755

                  Thanks, Ross
                    Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                    AugmentBLU - MODX Partner

                    BLUcart - MODX Revolution E-Commerce & Shopping Cart
                    • 6726
                    • 7,075 Posts
                    This seems OK to me...

                    I’ll try to check out what has been changed in the core code and if I can figure this out, otherwise I’ll track down who made the change enabling webusers to use the resources browser (think it was Jeff aka Bravado) and point him towards this thread...
                      .: COO - Commerce Guys - Community Driven Innovation :.


                      MODx est l&#39;outil id
                      • 6726
                      • 7,075 Posts
                      I think I have found the difference between 0.9.6.1 and 0.9.6.2 to make it possible for web users to access the resource browser from the frontend, it’s in [tt]manager/media/browser/mcpuk/connectors/php/config.php[/tt]

                      In 0.9.6.1 you have :

                      /** 
                      * Security check user MUST be logged into manager
                      * before being able to run this script
                      */
                      startCMSSession();
                      if(!isset($_SESSION[’mgrValidated’])) {
                      die("<b>INCLUDE_ORDERING_ERROR</b>

                      Please use the MODx Content Manager instead of accessing this file directly.");
                      }

                      and 0.9.6.2 RC1 :

                      /** 
                      * Security check user MUST be logged into manager
                      * before being able to run this script
                      */
                      startCMSSession();
                      if(!isset($_SESSION[’mgrValidated’])) {
                      if(!isset($_SESSION[’webValidated’])){
                      die("<b>INCLUDE_ORDERING_ERROR</b>

                      Please use the MODx Content Manager instead of accessing this file directly.");
                      }
                      }

                      I’ve seen nothing else in this file that would explain the permission issue, but then again I am no coder.
                      (BTW, I am pretty sure Bravado is the one who updated the file, but I am not sure since there is no changelog in the file itself)

                      I have a question : are path set to absolute or relative ?
                        .: COO - Commerce Guys - Community Driven Innovation :.


                        MODx est l&#39;outil id