diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index ea3a6977c..777dd26e1 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -39,6 +39,9 @@ performance. - fix [ 1190834 ] Pagination of event calendar does not work for firefox - Navigation depthIs template variables now allow for negative values. + - Renamed layout asset to page. + - CS Post reply URLs are now shortened to an incremented reply number. + - Added a Rich Editor Configuration asset. 6.5.6 diff --git a/docs/upgrades/upgrade_6.5.6-6.6.0.pl b/docs/upgrades/upgrade_6.5.6-6.6.0.pl index 73543425b..8dc41817e 100644 --- a/docs/upgrades/upgrade_6.5.6-6.6.0.pl +++ b/docs/upgrades/upgrade_6.5.6-6.6.0.pl @@ -5,6 +5,7 @@ use File::Path; use Getopt::Long; use strict; use WebGUI::Asset; +use WebGUI::Asset::Template; use WebGUI::Session; use WebGUI::SQL; @@ -192,6 +193,15 @@ WebGUI::SQL->write("insert into settings values ('commerceViewShoppingCartTempla print "\tAdding product managers group\n" unless ($quiet); WebGUI::SQL->write("insert into groups (groupId, groupName, description) values (14, 'Product Managers', 'The group that is allowed to edit, delete and create products.')"); +#-------------------------------------------- +print "\tRemoving rich editor templates.\n" unless ($quiet); +my $sth = WebGUI::SQL->read("select assetId from template where namespace='richEditor'"); +while (my ($assetId) = $sth->array) { + my $asset = WebGUI::Asset::Template->new($assetId); + $asset->purge; +} +$sth->finish; + WebGUI::Session::close(); diff --git a/docs/upgrades/upgrade_6.5.6-6.6.0.sql b/docs/upgrades/upgrade_6.5.6-6.6.0.sql index c3c430520..9ad7611ec 100644 --- a/docs/upgrades/upgrade_6.5.6-6.6.0.sql +++ b/docs/upgrades/upgrade_6.5.6-6.6.0.sql @@ -50,7 +50,6 @@ alter table transaction add column shippingStatus varchar(15) default 'NotShippe alter table transaction add column trackingNumber varchar(255); create table RichEdit ( assetId varchar(22) not null primary key, - templateId varchar(22) not null default 'PBtmpl0000000000000180', askAboutRichEdit int not null default 0, preformated int not null default 0, editorWidth int not null default 0, @@ -58,12 +57,14 @@ create table RichEdit ( sourceEditorWidth int not null default 0, sourceEditorHeight int not null default 0, useBr int not null default 0, + nowrap int not null default 0, convertNewLinesToBr int not null default 0, removeLineBreaks int not null default 0, npwrap int not null default 0, directionality varchar(3) not null default 'ltr', toolbarLocation varchar(6) not null default 'bottom', cssFile varchar(255), + extendedValidElements text, toolbarRow1 text, toolbarRow2 text, toolbarRow3 text, diff --git a/lib/WebGUI/Asset/Post.pm b/lib/WebGUI/Asset/Post.pm index 534d8390e..de2fd47f3 100644 --- a/lib/WebGUI/Asset/Post.pm +++ b/lib/WebGUI/Asset/Post.pm @@ -39,6 +39,12 @@ our @ISA = qw(WebGUI::Asset); +#------------------------------------------------------------------- +sub canAdd { + my $class = shift; + $class->SUPER::canAdd(undef,'7'); +} + #------------------------------------------------------------------- sub canEdit { my $self = shift; @@ -640,6 +646,7 @@ sub processPropertiesFromFormPost { isHidden => 1, dateSubmitted=>time() ); + $data{url} = $self->fixUrl($self->getThread->get("url")."/1") if ($self->isReply); if ($self->getThread->getParent->canModerate) { $self->getThread->lock if ($session{form}{'lock'}); $self->getThread->stick if ($session{form}{stick}); diff --git a/lib/WebGUI/Asset/RichEdit.pm b/lib/WebGUI/Asset/RichEdit.pm index 45175c7b3..f33128c84 100644 --- a/lib/WebGUI/Asset/RichEdit.pm +++ b/lib/WebGUI/Asset/RichEdit.pm @@ -16,9 +16,10 @@ package WebGUI::Asset::RichEdit; use strict; use WebGUI::Asset; -use WebGUI::Asset::Template; +use WebGUI::Form; use WebGUI::Macro; use WebGUI::Session; +use WebGUI::Utility; our @ISA = qw(WebGUI::Asset); @@ -63,14 +64,14 @@ sub definition { tableName=>'RichEdit', className=>'WebGUI::Asset::RichEdit', properties=>{ - templateId=>{ - fieldType=>'template', - defaultValue=>'PBtmpl0000000000000180' - }, askAboutRichEdit=>{ fieldType=>'yesNo', defaultValue=>0 }, + extendedValidElements=>{ + fieldType=>'textarea', + defaultValue=>'a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]' + }, preformated=>{ fieldType=>'yesNo', defaultValue=>0 @@ -163,7 +164,7 @@ sub getEditForm { copy => "Copy", paste => "Paste", undo => "Undo", - redo => "Redo", + 'redo' => "Redo", bold => "Bold", italic => "Italic", underline => "Underline", @@ -176,7 +177,7 @@ sub getEditForm { numlist => "Numbered List", outdent => "Outdent", indent => "Indent", - sub => "Subscript", + 'sub' => "Subscript", sup => "Superscript", styleselect => "Apply Style", formatselect => "Apply Format", @@ -185,11 +186,11 @@ sub getEditForm { fontsizeselect => "Font Size", forecolor => "Foreground Color", backcolor => "Background Color", - link => "Create Hyperlink", + 'link' => "Create Hyperlink", # advlink => "Advanced Link", pagetree => "WebGUI Page Tree Link", anchor => "Anchor", - unlink => "Unlink", + 'unlink' => "Unlink", tablecontrols => "Table Controls", table => "Create Table", row_before => "Insert Table Row Before", @@ -222,29 +223,50 @@ sub getEditForm { # save => "Save", preview => "Preview", zoom => "Zoom", - print => "Print", + 'print' => "Print", + ); + my $buttonGrid = '
| Button | +Row 1 | +Row 2 | +Row 3 | +
| '.$buttons{$key}.' | +'.WebGUI::Form::checkbox({ + value=>$key, + name=>"toolbarRow1", + checked=>$checked1 + }).' | +'.WebGUI::Form::checkbox({ + value=>$key, + name=>"toolbarRow2", + checked=>$checked2 + }).' | +'.WebGUI::Form::checkbox({ + value=>$key, + name=>"toolbarRow3", + checked=>$checked3 + }).' | +
'.$self->getToolbar.'
'.$output if ($session{var}{adminOn} && !$calledAsWebMethod); - return $output unless ($self->getValue("processAsTemplate")); - return WebGUI::Asset::Template->processRaw($output); + return $output; } #------------------------------------------------------------------- sub www_edit { my $self = shift; return WebGUI::Privilege::insufficient() unless $self->canEdit; - $self->getAdminConsole->setHelp("snippet add/edit","Snippet"); return $self->getAdminConsole->render($self->getEditForm->print,"Edit Rich Editor Configuration"); } diff --git a/lib/WebGUI/Asset/Wobject/Layout.pm b/lib/WebGUI/Asset/Wobject/Layout.pm index 36787f173..40f255123 100644 --- a/lib/WebGUI/Asset/Wobject/Layout.pm +++ b/lib/WebGUI/Asset/Wobject/Layout.pm @@ -123,7 +123,7 @@ Returns the displayable name of this asset. =cut sub getName { - return "Layout"; + return WebGUI::International::get("layout","Asset_Layout"); } diff --git a/lib/WebGUI/i18n/English/Asset_Layout.pm b/lib/WebGUI/i18n/English/Asset_Layout.pm index 31edd9085..9b0fdd761 100644 --- a/lib/WebGUI/i18n/English/Asset_Layout.pm +++ b/lib/WebGUI/i18n/English/Asset_Layout.pm @@ -1,42 +1,48 @@ package WebGUI::i18n::English::Asset_Layout; our $I18N = { + 'layout' => { + message => q|Page|, + lastUpdated => 0, + context=>q|The name of the layout asset.| + }, + 'layout add/edit title' => { - message => q|Layout, Add/Edit|, + message => q|Page, Add/Edit|, lastUpdated => 1106683494, }, 'layout add/edit body' => { message => q| -Layout Assets are used to display multiple Assets on the same time, much like -Pages in version 5 of WebGUI. The Layout Asset consists of a template with -multiple content areas, and Assets that are children of the Layout can be assigned +
Page Assets are used to display multiple Assets on the same time, much like +Pages in version 5 of WebGUI. The Page Asset consists of a template with +multiple content areas, and Assets that are children of the Page can be assigned to be displayed in those areas. -
Layout Assets are Wobjects and Assets, and share the same properties of both. Layout +
Page Assets are Wobjects and Assets, and share the same properties of both. Page Assets also have these unique properties:
TemplateThe following variables are available in Layout Templates:
+ message => q|The following variables are available in Page Templates:
showAdmin
A conditional showing if the current user has turned on Admin Mode and can edit this Asset.
diff --git a/www/extras/tinymce/jscripts/webgui.js b/www/extras/tinymce/jscripts/webgui.js
new file mode 100644
index 000000000..f0ff302ee
--- /dev/null
+++ b/www/extras/tinymce/jscripts/webgui.js
@@ -0,0 +1,17 @@
+// WebGUI Specific javascript functions for TinyMCE
+
+function tinyMCE_WebGUI_URLConvertor(url, node, on_save) {
+ // Use default URL convertor, old 1.43 else 1.44+
+ if (typeof(TinyMCE_convertURL) != "undefined")
+ url = TinyMCE_convertURL(url, node, on_save);
+ else
+ url = tinyMCE.convertURL(url, node, on_save);
+ // Do custom WebUI convertion, replace back ^();
+ url = url.replace(new RegExp("%5E", "g"), "^");
+ url = url.replace(new RegExp("%3B", "g"), ";");
+ url = url.replace(new RegExp("%28", "g"), "(");
+ url = url.replace(new RegExp("%29", "g"), ")");
+ return url;
+}
+
+