Saving to a file after editing

Last post 06-12-2009, 9:30 AM by alan.pieroway. 4 replies.
Sort Posts: Previous Next
  •  06-09-2009, 12:55 AM 52879

    Saving to a file after editing

    1. <?php include_once("CuteEditor_Files/include_CuteEditor.php") ;   
    2.     $editor=new CuteEditor();  
    3.     $editor->ID="Editor1";  
    4.     $editor->EditorBodyStyle="font:normal 12px arial;";  
    5.     $editor->EditorWysiwygModeCss="php.css";  
    6.     $editor->FilesPath="CuteEditor_Files";  
    7.     $editor->LoadHTML("language/enHome.inc");  
    8.     $editor->SaveFile("language/enHometwo.inc");  
    9.     $editor->Draw();  
    10.     $editor=null;  
    11.     //use $_POST["Editor1"]to catch the data   
    12. ?> 
               
    above is my sample code, almost straight from the cute help files.
    this is my first attempt at using cuteeditor for php
     
    as you can see i am loading a file "language/enHome.inc"
    and expecting it to save to a file "language/enHome2.inc"
     
    there content of the file is not code, it's just simple html.... a few <h1 /> <p></p> etcs around some text.
     
    what should i expect to happen when i click the SAVE icon.
     
    does it acutally save the file to the server, or am i expected to grab it and save it myself somehow.
     
    needless to say it isn't saving to the new file.  i've set practically all my folders and files to have permission 777 just in case.. although i don't like doing that if i don't need too.
     
    should i be seeing a 'your file has been saved' type dialog? anything to say something happened?
     
    if so, please point to an appropriate round trip example.
     
    regards,
    al
     
     
     
     
  •  06-10-2009, 12:13 PM 52954 in reply to 52879

    Re: Saving to a file after editing

    looking for some answers here people. 
     
    the  $editor->SaveFile("document.html"); isn't well documented.
     
    what is it for?
     
    need an answer before i can continue with my clients project.
     
    al
  •  06-10-2009, 1:20 PM 52960 in reply to 52954

    Re: Saving to a file after editing

  •  06-10-2009, 1:24 PM 52962 in reply to 52960

    Re: Saving to a file after editing

    what's the difference between SaveFile() and $editor->LoadHTML("some.txt"); then?
     
    according to the help page you refer to they both load the contents of a HTML file into the CuteEditor control
     
    are you sure this isn't a case of everyone assuming it does the same thing and no one ever actually bothering to find out if the SaveFile() actually does anything?

    if they do the same thing then SaveFile() or LoadHTML() should be changed.  bad naming for one of them.
     
    al
  •  06-12-2009, 9:30 AM 53071 in reply to 52962

    Re: Saving to a file after editing

    got it. thanks. me being stupid. not really examining the sample code.
    the save() does do something.... saving actually. if it's surrounded by the proper <form>
View as RSS news feed in XML