We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18878
    • 210 Posts
    Hi smiley

    I think FDM should have its own folder. It’s getting harder to accumulate all the posts in this sole thread.

    Well I have a couple of proplems, I hope someone can help:

    1) TinyMCE won’t load after a posting: suppose you are creating a new document with TinyMCE enabled for the content. Let’s say you submit the new document, but you forgot to fill a required field. An error messager will appear, but TinyMCE won’t load anymore!. I checked the source code and the these lines are missing:
    <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({
    etc
    etc
    etc
    


    Do you have the same problem? How can we solve it?

    2) Duplicaded rows on table site_tmplvar_contentvalues: Well, this one is not really a problem I guess, but I noticed that every time a new document is created, the data inserted on table site_tmplvar_contentvalues is being duplicated (double inserted). Something like this:
    [table]
    [tr]
    [td]id[/td]
    [td]tmplvarid[/td]
    [td]contentid[/td]
    [td]value[/td]
    [/tr]
    [tr]
    [td]752[/td]
    [td] 18[/td]
    [td]170[/td]
    [td]hi there[/td]
    [/tr]
    [tr]
    [td]753[/td]
    [td] 19[/td]
    [td]170[/td]
    [td]hello[/td]
    [/tr]
    [tr]
    [td]754[/td]
    [td] 18[/td]
    [td]170[/td]
    [td]hi there[/td]
    [/tr]
    [tr]
    [td]755[/td]
    [td] 19[/td]
    [td]170[/td]
    [td]hello[/td]
    [/tr]
    [/table]

    At first, this duplication looks like an error. I don’t know if it’s afffecting the behavior of the documents, because so far I didn’t notice any problem. What do you think?

    Please, your help will be appreciated.

    Mc
      • 22668
      • 718 Posts
      2mcclausky
      I’m using Tiny + FDM by inserting my Tiny JS code into fdmEform chunk.
      be happy grin
        • 18878
        • 210 Posts
        Quote from: Paprikas at Sep 08, 2008, 04:47 PM

        2mcclausky
        I’m using Tiny + FDM by inserting my Tiny JS code into fdmEform chunk.
        be happy grin

        Yes, I did exactly that. It works just fine when the page loads. But if you forget a required field, and the page posts back, then TinyMCE just doesn’t load anymore.
          • 22668
          • 718 Posts
          Quote from: mcclausky at Sep 08, 2008, 06:25 PM

          Yes, I did exactly that. It works just fine when the page loads. But if you forget a required field, and the page posts back, then TinyMCE just doesn’t load anymore.
          Ok. can you show me your fdmEform chunk?

          My chunk:
          <script language="javascript" type="text/javascript" src="/assets/plugins/tinymce3101/jscripts/tiny_mce/tiny_mce.js"></script>
          <script language="javascript" type="text/javascript">
          tinyMCE.init({
              mode : "exact",
              theme : "advanced",
              elements : "content",
              plugins : "safari,style,layer,table,advhr,advimage,advlink,iespell,insertdatetime,media,searchreplace,paste,fullscreen,visualchars,nonbreaking,pagebreak",
              theme_advanced_buttons1_add_before : "newdocument,separator",
              theme_advanced_buttons1_add : "fontselect,fontsizeselect",
              theme_advanced_buttons2_add : "separator,insertdate,inserttime,separator,forecolor,backcolor",
              theme_advanced_buttons2_add_before: "pastetext,pasteword,separator,search,replace,separator",
              theme_advanced_buttons3_add_before : "tablecontrols,separator",
              theme_advanced_buttons3_add : "iespell,media,advhr,separator,fullscreen",
              theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,attribs,|,visualchars,nonbreaking,pagebreak,|,insertfile,insertimage",
              theme_advanced_toolbar_location : "top",
              theme_advanced_toolbar_align : "left",
              theme_advanced_statusbar_location : "bottom",
              plugin_insertdate_dateFormat : "%Y-%m-%d",
              plugin_insertdate_timeFormat : "%H:%M:%S",
              external_link_list_url : "/assets/plugins/tinymce3101/tinymce.linklist.php",
              theme_advanced_resize_horizontal : false,
              theme_advanced_resizing : true,
              language : "ru",
              height : "300",
              width : "100%",
              
              relative_urls : true,
              document_base_url : "/",
              convert_urls : false,
              pagebreak_separator : "<!-- splitter -->",
              
              file_browser_callback : "myFileBrowser",
              apply_source_formatting : true
          });
          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 : "no",  // This parameter only has an effect if you use the inlinepopups plugin!
                  close_previous : "no"
              }, {
                  window : win,
                  input : field_name
              });
              return false;
          }
          </script>
          [+validationmessage+]
          <form method="post" action="[~[*id*]~]"  id="fdmForm">
            <input type="hidden" name="formid" value="fdmForm" />
            <input type="hidden" name="fdmid" value="[+fdmid+]" eform="::0::" />
            Pagetitle:<br />
            <input name="pagetitle" id="pagetitle" value="[+pagetitle+]" type="text" size="80" class="inputs" eform="Pagetitle:string:1" /><br />
             Content:<br />
            <textarea name="content" id="content" rows="5" cols="61" class="inputs" eform="Content:html:1">[+content+]</textarea><br />
            <input name="fdmsubmit" value="Send" type="submit" />
          </form>
            • 18878
            • 210 Posts
            Sure,

            Here’s the FDM call:
            [!FDM? &parent=`[*parent*]` &disableedit=`1` &disablepublish=`1` &disableunpublish=`1` &disabledelete=`1` &model=`149`  &editorpageid=`137` &id=`137` &eform_tpl=`McfdmEform_Events` &canpost=`Web - Site Admins` &script=`loadTinymce`  !]


            Here’s the McfdmEform_Events template chunk:
            [+validationmessage+]
            <form method="post" action="[~[*id*]~]"  id="fdmForm">
            		
            		<input type="hidden" name="formid" value="fdmForm" />
            		<input type="hidden" name="fdmid" value="[+fdmid+]" eform="::0::" />
              <h1>New Event</h1>
                <br>
                    Event Name:<input name="pagetitle" type="text" id="pagetitle" value="[+pagetitle+]" size="35" eform="Name cannot be empty:string:1" />
                    <br>
              Event Start Date:
              <input name="tvEasyEvents_Start" id="tvEasyEvents_Start" value="[+tvEasyEvents_Start+]" type="text" readonly="readonly" eform="Start Date cannot be empty:string:1" />
            <a href="#" onClick="javascript: displayCalendar('tvEasyEvents_Start');" title="Click to display calendar">
                    <img align="absmiddle" src="manager/media/calendar/img/cal.gif" width="16" height="16" border="0" alt="Click to display calendar" /></a>
                    <a href="#" onClick="document.forms['fdmForm'].elements['tvEasyEvents_Start'].value=''; return true;" >
                    <img align="absmiddle" src="manager/media/style/MODx/images/icons/event3.gif" width="16" height="16" border="0" alt="Click to erase date"></a>
                    <br>
             Event End Date:
              <input name="tvEasyEvents_End" id="tvEasyEvents_End" value="[+tvEasyEvents_End+]" type="text" readonly="readonly" />
                    <a href="#" onClick="javascript: displayCalendar('tvEasyEvents_End');" title="Click to display calendar">
                    <img align="absmiddle" src="manager/media/calendar/img/cal.gif" width="16" height="16" border="0" alt="Click to display calendar" /></a>
                    <a href="#" onClick="document.forms['fdmForm'].elements['tvEasyEvents_End'].value=''; return true;" >
                  <img align="absmiddle" src="manager/media/style/MODx/images/icons/event3.gif" width="16" height="16" border="0" alt="Click to erase date"></a>
                    <br>
                    <br>
              Hide time:
              <select name="tvEasyEvents_HideTime" id="tvEasyEvents_HideTime">
                  <option value="">NO</option>
                  <option value="Hide">YES</option>
              </select>
              <br>
              CONTENT: 
              <textarea name="content" cols="55" rows="15" id="content" eform="Content cannot be empty:html:1">[+content+]</textarea>
              <br>
            
                <input name="fdmsubmit" value="Publish Event" type="submit" />
                <a href="[~[*parent*]~]" tile="Cancel">Cancel</a>  
            
            </form>
            
            
            
            <script language="JavaScript" src="manager/media/script/datefunctions.js"></script>
            <script type="text/javascript">
            	 function displayCalendar(fieldName)
            	 {
            		var elm_txt = {}; // dummy
            		var pub = document.forms["fdmForm"].elements["" + fieldName + ""];		 
            		var nwpub_cal1 = new calendar1(pub,elm_txt);
            		nwpub_cal1.path="[(base_url)]manager/media/";
            		nwpub_cal1.year_scroll = true;
            		nwpub_cal1.time_comp = true;
            	 	nwpub_cal1.popup();
            	 }
            
            </script>




            And....here’s the loadTinymce chunk:
            <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>



            Thanks.

            Mc
              • 22668
              • 718 Posts
              And??
              I wrote
              I’m using Tiny + FDM by inserting my Tiny JS code into fdmEform chunk.
              Kill &script=`loadTinymce`
              Kill loadTinymce chunk.
              Move code frome loadTinymce chunk to McfdmEform_Events!!
              Something like this:
              <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>
              [+validationmessage+]
              <form method="post" action="[~[*id*]~]"  id="fdmForm">
              		
              		<input type="hidden" name="formid" value="fdmForm" />
              		<input type="hidden" name="fdmid" value="[+fdmid+]" eform="::0::" />
                <h1>New Event</h1>
                  <br>
                      Event Name:<input name="pagetitle" type="text" id="pagetitle" value="[+pagetitle+]" size="35" eform="Name cannot be empty:string:1" />
                      <br>
                Event Start Date:
                <input name="tvEasyEvents_Start" id="tvEasyEvents_Start" value="[+tvEasyEvents_Start+]" type="text" readonly="readonly" eform="Start Date cannot be empty:string:1" />
              <a href="#" onClick="javascript: displayCalendar('tvEasyEvents_Start');" title="Click to display calendar">
                      <img align="absmiddle" src="manager/media/calendar/img/cal.gif" width="16" height="16" border="0" alt="Click to display calendar" /></a>
                      <a href="#" onClick="document.forms['fdmForm'].elements['tvEasyEvents_Start'].value=''; return true;" >
                      <img align="absmiddle" src="manager/media/style/MODx/images/icons/event3.gif" width="16" height="16" border="0" alt="Click to erase date"></a>
                      <br>
               Event End Date:
                <input name="tvEasyEvents_End" id="tvEasyEvents_End" value="[+tvEasyEvents_End+]" type="text" readonly="readonly" />
                      <a href="#" onClick="javascript: displayCalendar('tvEasyEvents_End');" title="Click to display calendar">
                      <img align="absmiddle" src="manager/media/calendar/img/cal.gif" width="16" height="16" border="0" alt="Click to display calendar" /></a>
                      <a href="#" onClick="document.forms['fdmForm'].elements['tvEasyEvents_End'].value=''; return true;" >
                    <img align="absmiddle" src="manager/media/style/MODx/images/icons/event3.gif" width="16" height="16" border="0" alt="Click to erase date"></a>
                      <br>
                      <br>
                Hide time:
                <select name="tvEasyEvents_HideTime" id="tvEasyEvents_HideTime">
                    <option value="">NO</option>
                    <option value="Hide">YES</option>
                </select>
                <br>
                CONTENT: 
                <textarea name="content" cols="55" rows="15" id="content" eform="Content cannot be empty:html:1">[+content+]</textarea>
                <br>
              
                  <input name="fdmsubmit" value="Publish Event" type="submit" />
                  <a href="[~[*parent*]~]" tile="Cancel">Cancel</a>  
              
              </form>
              
              
              
              <script language="JavaScript" src="manager/media/script/datefunctions.js"></script>
              <script type="text/javascript">
              	 function displayCalendar(fieldName)
              	 {
              		var elm_txt = {}; // dummy
              		var pub = document.forms["fdmForm"].elements["" + fieldName + ""];		 
              		var nwpub_cal1 = new calendar1(pub,elm_txt);
              		nwpub_cal1.path="[(base_url)]manager/media/";
              		nwpub_cal1.year_scroll = true;
              		nwpub_cal1.time_comp = true;
              	 	nwpub_cal1.popup();
              	 }
              
              </script>
              
                • 18878
                • 210 Posts
                Quote from: Paprikas at Sep 09, 2008, 05:32 AM

                And??
                I wrote
                I’m using Tiny + FDM by inserting my Tiny JS code into fdmEform chunk.

                Sorry, I didn’t read your first post properly. Thanks for your suggestion, it works! laugh

                Mc
                  • 18878
                  • 210 Posts
                  I got another question smiley

                  Is it possible to create a document that has Jot comments? I mean a document with the following output:

                  The output: Generated Content
                  [!Jot!]

                  so the created page will work like a blog. For instance, I remember the NewsPublisher snippet had a parameter &footertpl where we could specify any chunk that would be part of the final output. Is there anything similar in FDM?

                  Thanks in advance!

                  Mc
                    • 17282
                    • 283 Posts
                    OK got this working great now, One peoblem .. I am seeing @CODE nest to the button, I have the latest version of Chunkie .. can anyone help please? many thanks smiley

                    Martyn
                      Everytime you use Flash ... a puppy dies .....
                      R.G Taylor
                      • 36592
                      • 970 Posts
                      Quote from: Lizard at Sep 10, 2008, 08:41 AM

                      OK got this working great now, One peoblem .. I am seeing @CODE nest to the button, I have the latest version of Chunkie .. can anyone help please? many thanks smiley
                      I’m not sure what you mean by "I have the latest version of Chunkie", but there’s a conflict of Chunkie class when used with Jot.
                      As described here, you have to modify the chunkie class name of FDM.

                      Change all instances to the word "CChunkie" in /snippets/FDM/includes/fdm.class.inc.php and /snippets/FDM/includes/fdmchunkie.class.inc.php to "fdmCChunkie".