Page 1 of 1
loading content into editor
Posted: Mon Aug 14, 2006 6:52 am
by ezhs8554
I am wanting to create a script that will scan a folder on the sever and then create links to the html pages in the folder. When clicked the links need to load the content of the selected html file into the tiny mce wysiwyg editor and allow the user to edit the file.
I am have no idea of how to go about creating editing links that load the contents of the file to the editor. Could someone help me with some code for this.
Re: loading content into editor
Posted: Tue Aug 15, 2006 1:51 am
by jmut
ezhs8554 wrote:I am wanting to create a script that will scan a folder on the sever and then create links to the html pages in the folder. When clicked the links need to load the content of the selected html file into the tiny mce wysiwyg editor and allow the user to edit the file.
I am have no idea of how to go about creating editing links that load the contents of the file to the editor. Could someone help me with some code for this.
Well after you create the links (many ways to read content from a folder):
Code: Select all
//1 . for php 5 check http://www.php.net/~helly/php/ext/spl/
//2.
glob()
//3. classical
readdir() //etc.
Then you can either:
1. click on the link and refresh the whole page ....(getting content with
for example) and putting contents withing textarea that tinymce is editing. -> most compitable , recommended on not heavy page
2. You could you AJAX stuff to do the same stuff without refreshing the whole page. -> fancy , using javascript, recommend on heavy page
3. You could load whole content in advance and then switch it with javascript -> not recommended
Posted: Tue Aug 15, 2006 10:05 am
by ronverdonk
Just sent you some code that will accomplish what you are looking for. Because it is a little much (3 files) I sent them via separate mail.
Posted: Wed Aug 16, 2006 7:42 am
by ezhs8554
Thank you ronverdonk for the code you sent me it was exactly what i needed.