Add an option to disable a given rich editor Asset site wide.

Added new column in table(default 0), label, hoverHelp and help field entry.
This commit is contained in:
Colin Kuskie 2006-02-14 23:43:32 +00:00
parent cd6759f311
commit ac39689ddb
5 changed files with 36 additions and 0 deletions

View file

@ -27,6 +27,8 @@
if they are separated by commas. Whitespace is ignored. The upgrade if they are separated by commas. Whitespace is ignored. The upgrade
script will migrate the data automatically, and hoverHelp documentation script will migrate the data automatically, and hoverHelp documentation
has been updated to reflect the changes as well. has been updated to reflect the changes as well.
- The Rich Editor now has a master reset that allows disabling any individual
Rich Editor across the entire site without querying the user.
6.8.7 6.8.7
- fix [ 1431098 ] op=becomeUser can become non-existent userIds - fix [ 1431098 ] op=becomeUser can become non-existent userIds

View file

@ -31,6 +31,7 @@ updateTemplates();
updateDatabaseLinksAndSQLReport(); updateDatabaseLinksAndSQLReport();
addWorkflow(); addWorkflow();
ipsToCIDR(); ipsToCIDR();
addDisabletoRichEditor();
finish($session); # this line required finish($session); # this line required
@ -393,6 +394,12 @@ sub removeFiles {
rmtree('../../lib/WebGUI/Asset/Wobject/IndexedSearch'); rmtree('../../lib/WebGUI/Asset/Wobject/IndexedSearch');
} }
#-------------------------------------------------
sub addDisabletoRichEditor {
print "\tUpdating Rich Editor to add master disable.\n" unless ($quiet);
$session->db->write("alter table RichEdit add column disableRichEditor int(11) default '0'");
}
#------------------------------------------------- #-------------------------------------------------
sub ipsToCIDR { sub ipsToCIDR {
print "\tTranslating IP addresses to CIDR format.\n" unless ($quiet); print "\tTranslating IP addresses to CIDR format.\n" unless ($quiet);

View file

@ -68,6 +68,10 @@ sub definition {
tableName=>'RichEdit', tableName=>'RichEdit',
className=>'WebGUI::Asset::RichEdit', className=>'WebGUI::Asset::RichEdit',
properties=>{ properties=>{
disableRichEditor=>{
fieldType=>'yesNo',
defaultValue=>0
},
askAboutRichEdit=>{ askAboutRichEdit=>{
fieldType=>'yesNo', fieldType=>'yesNo',
defaultValue=>0 defaultValue=>0
@ -266,6 +270,12 @@ sub getEditForm {
-hoverHelp=>$i18n->get('toolbar buttons description'), -hoverHelp=>$i18n->get('toolbar buttons description'),
-value=>$buttonGrid -value=>$buttonGrid
); );
$tabform->getTab("properties")->yesNo(
-value=>$self->getValue("disableRichEditor"),
-label=>$i18n->get('disable rich edit'),
-hoverHelp=>$i18n->get('disable rich edit description'),
-name=>"disableRichEditor"
);
$tabform->getTab("properties")->yesNo( $tabform->getTab("properties")->yesNo(
-value=>$self->getValue("askAboutRichEdit"), -value=>$self->getValue("askAboutRichEdit"),
-label=>$i18n->get('using rich edit'), -label=>$i18n->get('using rich edit'),
@ -390,6 +400,7 @@ sub getToolbar {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub getRichEditor { sub getRichEditor {
my $self = shift; my $self = shift;
return '' if $self->getValue('disableRichEditor');
my $nameId = shift; my $nameId = shift;
my @toolbarRow1 = split("\n",$self->getValue("toolbarRow1")); my @toolbarRow1 = split("\n",$self->getValue("toolbarRow1"));
push(@toolbarRow1,"contextmenu") if ($self->getValue("enableContextMenu")); push(@toolbarRow1,"contextmenu") if ($self->getValue("enableContextMenu"));

View file

@ -6,6 +6,11 @@ our $HELP = {
title => 'rich edit add/edit title', title => 'rich edit add/edit title',
body => 'rich edit add/edit body', body => 'rich edit add/edit body',
fields => [ fields => [
{
title => 'disable rich edit',
description => 'disable rich edit description',
namespace => 'Asset_RichEdit',
},
{ {
title => 'using rich edit', title => 'using rich edit',
description => 'using rich edit description', description => 'using rich edit description',

View file

@ -365,6 +365,17 @@ our $I18N = {
lastUpdated => 1119584956, lastUpdated => 1119584956,
}, },
'disable rich edit' => {
message => q|Disable this Rich Editor?|,
lastUpdated => 1139957794,
},
'disable rich edit description' => {
message => q|This is a master disable for the rich editor, and will turn off the Rich
Edit across the entire site without any user intervention.|,
lastUpdated => 1139958262,
},
'using rich edit description' => { 'using rich edit description' => {
message => q|Ask the user whether or not to use the Rich Editor on this form.|, message => q|Ask the user whether or not to use the Rich Editor on this form.|,
lastUpdated => 1119584875, lastUpdated => 1119584875,