"...HTMLArea will give them too much power to potentially screw up the page..."
Well, don't let them change the ENTIRE PAGE! :) Just the
smallest amount necessary. Now then, if they need to able
to change, say, some text that is located inside a table,
well, first off the WYSIWYG editor will allow them to add
rows and so forth, but secondly, maybe you should determine
all the fields that your user can change and provide a
standard form so they can only change the values, not the
presentation.
And yes, HTMLArea really only works well on Windows boxes,
but 99% of the users "out there" have Windows. The latest
versions of Firebird and Mozilla will render HTMLArea
V3.0, but i have had intermittent results with those
browsers on Linux boxes - some work and some don't. But
remember that you don't have to run IIS or anything like
that to get HTMLArea to work. It is a client side
technology, and surely your user has a Windows box
available. (I actually had a client that only used Macs,
and thus i had to provide a file upload alternative).
As for the last question ... i would rather read in the
file, display it for the user somehow, and then write the
entire file back out instead of using in-place editting.
Having to fork and exec another shell to the Perl
interpreter should be avoided when it can.
Best of luck to you! :)
UPDATE:
Here is a quicky script that might help you out. As long as you can set the permissions
for the store file (i named it CONTENT with no extension for no real reason)
you should be good to go. I used CGI.pm, mainly because it is readily available and it
handles HTML entity escaping for you.
#!/usr/bin/perl -T
use strict;
use warnings;
use CGI qw(:standard);
print header,start_html('mini cms');
if (param('content')) {
open FILE,'>','CONTENT' or error("Can't write content file: $!");
print FILE param('content');
close FILE;
}
open FILE,'<','CONTENT' or error("Can't read content file: $!");
my $content = do{local $/; <FILE>};
close FILE;
print start_form,
textarea(content => $content, 10,50),br,
submit,
end_form,
div({id=>'content'},$content),
;
sub error {
print pre(shift),end_html;
exit;
}
| [reply] [d/l] |