Problem : CE as file manager does not insert file in input.

Last post 11-28-2008, 2:12 PM by Adam. 1 replies.
Sort Posts: Previous Next
  •  11-28-2008, 5:09 AM 46380

    Problem : CE as file manager does not insert file in input.

    I work with CE php and I'd like to use CE asa file manager.
    I used this example (that doesn't works too) : http://phphtmledit.com/use-CuteEditor-as-file-manager.php
     
    When i choose a file the file url is not inserted inthe input as in the CE used as an image selector.
     
    I tried to find the problem but all seems to bee good.
     
    Any ideas ?
     
  •  11-28-2008, 2:12 PM 46406 in reply to 46380

    Re: Problem : CE as file manager does not insert file in input.

    The online demo is fixed.
     
    Please use the following code:
     
    <?php include_once("CuteEditor_Files/include_CuteEditor.php") ; ?>
    <html> 
        <head>
      <title>Use CuteEditor as file manager -- PHP Content Management, PHP WYSIWYG, PHP HTML Editor, PHP Text Editor</title>
       <link rel="stylesheet" href="php.css" type="text/css" />
     </head>
        <body>
     <form name="theForm" action="Get_HtmlContent.php" method="post">
         <h1>Use CuteEditor as a file manager</h1>
         <hr />
         <div class="infoBox">This example demonstrates how to use CuteEditor as an image selector.</div>
         <br />
            <input name="imageFld" type="text" id="imageFld" style="width:300px;" />
            <input name="Change" id="Change" type="button" value="File Manager" onclick="callInsertImage()" />  
          <br />
             
              <?php
                  $editor=new CuteEditor();
                  $editor->ID="Editor1";
                  $editor->Text="";
                  $editor->FilesPath="CuteEditor_Files";
                  $editor->ShowBottomBar=false;
                  $editor->AutoConfigure="None";
                  $editor->ThemeType="OfficeXP";
                  $editor->Width=1;
                  $editor->Height=1;
                  $editor->Draw();
                  $ClientID=$editor->ClientID();
                  $editor=null;
                 
                  //use $_POST["Editor1"]to catch the data
              ?>
          <br/><br/> 
                    
                  <Script Language="javascript">
                    function callInsertImage() 
                    { 
                        var editor1 = document.getElementById('CE_Editor1_ID');
                        editor1.FocusDocument(); 
                        var editdoc = editor1.GetDocument(); 
                        editor1.ExecCommand('new');
                        editor1.ExecCommand('insertdocument');
                        InputURL();
                        document.getElementById("imageFld").focus();
                    }   
                   
                    function InputURL()
                    {
                        var editor1 = document.getElementById('CE_Editor1_ID');
                        var editdoc = editor1.GetDocument(); 
                        var links = editdoc.getElementsByTagName("a");
                      if(links.length>0&&links[links.length-1].href!="") 
                        { 
                          document.getElementById("imageFld").value = links[links.length-1].href;
                        } 
                        else
                        {
                          setTimeout(InputURL,500);
                        } 
                    }      
                </script>
      </form>
     </body>
    </html>

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML