diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index eb4271d4c..659a624bd 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,5 +1,5 @@ 7.2.0 - + - Added server side spellchecker (Martin Kamerbeek / Procolix) 7.1.2 diff --git a/docs/gotcha.txt b/docs/gotcha.txt index 075dd8e75..9a13f0804 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -7,6 +7,15 @@ upgrading from one version to the next, or even between multiple versions. Be sure to heed the warnings contained herein as they will save you many hours of grief. +7.2.0 +-------------------------------------------------------------------- + * Server side spellchecking has been added to this release. You must + install Text::Aspell, and any dictionary you like. If you want to + use spellchecking you have to setup the dictionaries you want your + users to use in the config file. Also you'll have to check the + spellchecker checkbox in the RichEdit asset you're using. + + 7.0.8 -------------------------------------------------------------------- * 7.0.7 was released with a critical bug that broke the search engine diff --git a/docs/upgrades/upgrade_7.1.2-7.2.0.pl b/docs/upgrades/upgrade_7.1.2-7.2.0.pl index a8bf45b0a..66372d097 100644 --- a/docs/upgrades/upgrade_7.1.2-7.2.0.pl +++ b/docs/upgrades/upgrade_7.1.2-7.2.0.pl @@ -20,17 +20,21 @@ my $quiet; # this line required my $session = start(); # this line required -# upgrade functions go here +createDictionaryStorage($session); finish($session); # this line required -##------------------------------------------------- -#sub exampleFunction { -# my $session = shift; -# print "\tWe're doing some stuff here that you should know about.\n" unless ($quiet); -# # and here's our code -#} +#------------------------------------------------- +sub createDictionaryStorage { + my $session = shift; + print "\tCreating the directory for the personal dictionaries.\n" unless ($quiet); + + my $dictionaryDirectory = $session->config->get('uploadsPath') .'/dictionaries'; + + mkdir $dictionaryDirectory unless (-e $dictionaryDirectory); + mkdir $dictionaryDirectory.'/oldIds' unless (-e $dictionaryDirectory.'/oldIds'); +} diff --git a/etc/WebGUI.conf.original b/etc/WebGUI.conf.original index bfe87d1bf..f2aa06d77 100644 --- a/etc/WebGUI.conf.original +++ b/etc/WebGUI.conf.original @@ -402,6 +402,23 @@ "WebGUI::Image::Graph::XYGraph::Line" ], +# Here you can define the dictionaries that are available through the tinyMCE spellchecker. You should set +# id to the name the dictionary is known by ASpell (eg. en or en_US or nl), use the name parameter to set +# the name the dictionary is displayed with in tinyMCE. To set the default dictionary please set the 'default' +# parameter. + +#"availableDictionaries" : [ +# { +# "id" : "en", +# "name" : "English", +# "default" : "1" +# }, +# { +# "id" : "nl", +# "name" : "Dutch" +# } +#], + # Optional script to run upon successful login. The script can contain macros # ex: /data/WebGUI/sbin/doLogin.pl --configFile=dev.localhost.localdomain.conf --loginPage=^PageUrl(); diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index 251975dbb..eb73bca23 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -56,7 +56,10 @@ sub handler { return Apache2::Const::DECLINED if ($r->uri =~ m/^$url/); } my $uploads = $config->get("uploadsURL"); - if ($r->uri =~ m/^$uploads/) { + if ($r->uri =~ m!^uploads/dictionaries!) { + # Do not allow web-access to personal dictionaries. + $r->push_handlers(PerlAccessHandler => sub { return 401 } ); + } elsif($r->uri =~ m/^$uploads/) { $r->push_handlers(PerlAccessHandler => sub { return uploadsHandler($r, $configFile); } ); } else { $r->push_handlers(PerlResponseHandler => sub { return contentHandler($r, $configFile); } ); diff --git a/lib/WebGUI/Asset/RichEdit.pm b/lib/WebGUI/Asset/RichEdit.pm index 3d922d83f..cffeaa2ab 100644 --- a/lib/WebGUI/Asset/RichEdit.pm +++ b/lib/WebGUI/Asset/RichEdit.pm @@ -19,6 +19,7 @@ use WebGUI::Asset; use WebGUI::Form; use WebGUI::Utility; use WebGUI::International; +use Text::Aspell; our @ISA = qw(WebGUI::Asset); @@ -217,6 +218,7 @@ sub getEditForm { 'fullscreen' => $i18n->get('fullscreen'), 'zoom' => $i18n->get('zoom'), 'print' => $i18n->get('print'), + 'spellchecker' => $i18n->get('Server Side Spell Checker'), # 'advlink' => "Advanced Link", # 'spacer' => "Toolbar Spacer", # 'separator' => "Toolbar Separator", @@ -229,6 +231,7 @@ sub getEditForm {