added image picker for rich edit
This commit is contained in:
parent
4704e4c55f
commit
7d6b93ff62
6 changed files with 143 additions and 298 deletions
|
|
@ -722,6 +722,41 @@ sub file {
|
|||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 files ( hashRef )
|
||||
|
||||
Returns a multiple file upload control.
|
||||
|
||||
=head3 name
|
||||
|
||||
The name field for this form element.
|
||||
|
||||
=cut
|
||||
|
||||
sub files {
|
||||
WebGUI::Style::setScript($session{config}{extrasURL}.'/FileUploadControl.js',{type=>"text/javascript"});
|
||||
my $uploadControl = '<div id="fileUploadControl"> </div>
|
||||
<script>
|
||||
var images = new Array();
|
||||
';
|
||||
opendir(DIR,$session{config}{extrasPath}.'/fileIcons');
|
||||
my @files = readdir(DIR);
|
||||
closedir(DIR);
|
||||
foreach my $file (@files) {
|
||||
unless ($file eq "." || $file eq "..") {
|
||||
my $ext = $file;
|
||||
$ext =~ s/(.*?)\.gif/$1/;
|
||||
$uploadControl .= 'images["'.$ext.'"] = "'.$session{config}{extrasURL}.'/fileIcons/'.$file.'";'."\n";
|
||||
}
|
||||
}
|
||||
$uploadControl .= 'var uploader = new FileUploadControl("fileUploadControl", images);
|
||||
uploader.addRow();
|
||||
</script>';
|
||||
return $uploadControl;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 filterContent ( hashRef )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue