rich editor a lot closer to working
This commit is contained in:
parent
16f38df1f6
commit
22347b8b39
3 changed files with 40 additions and 23 deletions
|
|
@ -234,6 +234,35 @@ while (my ($assetId) = $sth->array) {
|
||||||
}
|
}
|
||||||
$sth->finish;
|
$sth->finish;
|
||||||
|
|
||||||
|
#--------------------------------------------
|
||||||
|
print "\tAdding rich editor configurations.\n" unless ($quiet);
|
||||||
|
my $importNode = WebGUI::Asset->getImportNode;
|
||||||
|
$importNode->addChild({
|
||||||
|
className=>"WebGUI::Asset::RichEdit",
|
||||||
|
title=>"Content Manager's Rich Edit",
|
||||||
|
menuTitle=>"Content Manager's Rich Edit",
|
||||||
|
url=>"content_managers_rich_edit",
|
||||||
|
ownerUserId=>3,
|
||||||
|
groupIdView=>12,
|
||||||
|
groupIdEdit=>4,
|
||||||
|
toolbarRow1=>"bold\nitalic\njustifyleft\njustifyright\njustifycenter\njustifyfull\nindent\noutdent\nstyleselect\nremoveformat",
|
||||||
|
toolbarRow2=>"bullist\nnumlist\nsub\nsup\nlink\npagetree\nanchor\nunlink\nadvhr\nimage\ninsertImage\ncharmap\ncollateral",
|
||||||
|
toolbarRow3=>"tablecontrols\nvisualaid\npreview\nsource\nsearchreplace",
|
||||||
|
sourceEditorWidth=>600,
|
||||||
|
sourceEditorHeight=>500,
|
||||||
|
enableContextMenu=>1
|
||||||
|
},"PBrichedit000000000001");
|
||||||
|
$importNode->addChild({
|
||||||
|
className=>"WebGUI::Asset::RichEdit",
|
||||||
|
title=>"Forum Rich Edit",
|
||||||
|
menuTitle=>"Forum Rich Edit",
|
||||||
|
url=>"forum_rich_edit",
|
||||||
|
ownerUserId=>3,
|
||||||
|
groupIdView=>7,
|
||||||
|
groupIdEdit=>4,
|
||||||
|
toolbarRow1=>"bold\nitalic\nbullist\nnumlist\nlink\nunlink\ncode\nemotions"
|
||||||
|
},"PBrichedit000000000002");
|
||||||
|
|
||||||
|
|
||||||
WebGUI::Session::close();
|
WebGUI::Session::close();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ package WebGUI::Form;
|
||||||
use strict;
|
use strict;
|
||||||
use Tie::IxHash;
|
use Tie::IxHash;
|
||||||
use WebGUI::Asset;
|
use WebGUI::Asset;
|
||||||
|
use WebGUI::Asset::RichEdit;
|
||||||
use WebGUI::Asset::Template;
|
use WebGUI::Asset::Template;
|
||||||
use WebGUI::DateTime;
|
use WebGUI::DateTime;
|
||||||
use WebGUI::International;
|
use WebGUI::International;
|
||||||
|
|
@ -1141,6 +1142,10 @@ Returns an HTML area. An HTML area is different than a standard text area in tha
|
||||||
|
|
||||||
The name field for this form element.
|
The name field for this form element.
|
||||||
|
|
||||||
|
=head3 richEditorId
|
||||||
|
|
||||||
|
An asset Id of a rich editor to display for this field.
|
||||||
|
|
||||||
=head3 value
|
=head3 value
|
||||||
|
|
||||||
The default value for this form element.
|
The default value for this form element.
|
||||||
|
|
@ -1171,16 +1176,10 @@ This will be used if no value is specified.
|
||||||
|
|
||||||
sub HTMLArea {
|
sub HTMLArea {
|
||||||
my $params = shift;
|
my $params = shift;
|
||||||
my ($output, $rows, $columns, $htmlArea);
|
my $rows = $params->{rows} || ($session{setting}{textAreaRows}+20);
|
||||||
my %var;
|
my $columns = $params->{columns} || ($session{setting}{textAreaCols}+10);
|
||||||
# Store all scalar options in template variables
|
my $richEditId = $params->{richEditId} || "PBrichedit000000000001";
|
||||||
foreach (keys %{$params}) {
|
my $output = textarea({
|
||||||
$var{"form.".$_} = $params->{$_} unless (ref $params->{$_});
|
|
||||||
}
|
|
||||||
# Textarea field
|
|
||||||
$rows = $params->{rows} || ($session{setting}{textAreaRows}+20);
|
|
||||||
$columns = $params->{columns} || ($session{setting}{textAreaCols}+10);
|
|
||||||
$var{textarea} = textarea({
|
|
||||||
name=>$params->{name},
|
name=>$params->{name},
|
||||||
value=>$params->{value},
|
value=>$params->{value},
|
||||||
wrap=>$params->{wrap},
|
wrap=>$params->{wrap},
|
||||||
|
|
@ -1189,14 +1188,8 @@ sub HTMLArea {
|
||||||
extras=>$params->{extras}.' onBlur="fixChars(this.form.'.$params->{name}.')" id="'.$params->{name}.'"'.' mce_editable="true" ',
|
extras=>$params->{extras}.' onBlur="fixChars(this.form.'.$params->{name}.')" id="'.$params->{name}.'"'.' mce_editable="true" ',
|
||||||
defaultValue=>$params->{defaultValue}
|
defaultValue=>$params->{defaultValue}
|
||||||
});
|
});
|
||||||
# Other variables
|
$output .= WebGUI::Asset::RichEdit->new($richEditId)->view;
|
||||||
$var{"button"} = '<input type="button" onClick="openEditWindow(this.form.'.$params->{name}.')" value="'
|
return $output;
|
||||||
.WebGUI::International::get(171).'" style="font-size: 8pt;" /><br />';
|
|
||||||
if ($session{user}{richEditor} eq 'none') {
|
|
||||||
return $var{textarea};
|
|
||||||
} else {
|
|
||||||
#return WebGUI::Asset::Template->new($session{user}{richEditor})->process(\%var);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -854,11 +854,6 @@ As with any delete operation, you are prompted to be sure you wish to proceed wi
|
||||||
lastUpdated => 1031514049
|
lastUpdated => 1031514049
|
||||||
},
|
},
|
||||||
|
|
||||||
'171' => {
|
|
||||||
message => q|rich edit|,
|
|
||||||
lastUpdated => 1031514049
|
|
||||||
},
|
|
||||||
|
|
||||||
'445' => {
|
'445' => {
|
||||||
message => q|Preferences|,
|
message => q|Preferences|,
|
||||||
lastUpdated => 1031514049
|
lastUpdated => 1031514049
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue