Added rich editor user preferences.
This commit is contained in:
parent
e0f5ef792d
commit
a7bcc52fc9
3 changed files with 63 additions and 44 deletions
|
|
@ -653,52 +653,47 @@ NOTE: WebGUI uses a great variety of rich editors. Not all of them are capable o
|
|||
|
||||
sub HTMLArea {
|
||||
my ($output, $rows, $columns, $htmlArea);
|
||||
my $browser = HTTP::BrowserDetect->new($session{env}{HTTP_USER_AGENT});
|
||||
my $button = '<input type="button" onClick="openEditWindow(this.form.'.$_[0]->{name}.')" value="'
|
||||
.WebGUI::International::get(171).'" style="font-size: 8pt;"><br>';
|
||||
$output = '<script language="JavaScript">function fixChars(element) {element.value = element.value.replace(/~V/mg,"-");}</script>';
|
||||
if ($session{setting}{richEditor} eq "edit-on-pro") {
|
||||
if ($session{user}{richEditor} eq "editOnPro2") {
|
||||
$output .= '<script language="JavaScript">
|
||||
var formObj;
|
||||
function openEditWindow(obj) {
|
||||
formObj = obj;
|
||||
window.open("'.$session{config}{extrasURL}.'/eopro.html","editWindow","width=720,height=450,resizable=1");
|
||||
}
|
||||
</script>';
|
||||
} else {
|
||||
my $browser = HTTP::BrowserDetect->new($session{env}{HTTP_USER_AGENT});
|
||||
if ($browser->ie && $browser->version >= 5.5) {
|
||||
if ($_[0]->{popupToggle}) {
|
||||
$output .= '<script language="JavaScript">
|
||||
var formObj;
|
||||
var extrasDir="'.$session{config}{extrasURL}.'";
|
||||
function openEditWindow(obj) {
|
||||
formObj = obj;
|
||||
window.open("'.$session{config}{extrasURL}.'/htmlArea/editor.html","editWindow","width=490,height=400,resizable=1"); }
|
||||
function setContent(content) {
|
||||
formObj.value = content;
|
||||
} </script>';
|
||||
$output .= $button;
|
||||
} else {
|
||||
$output .= '<script language="Javascript1.2" src="'.$session{config}{extrasURL}
|
||||
.'/htmlArea/editor.js"></script>'."\n";
|
||||
$output .= '<script>'."\n";
|
||||
$output .= '_editor_url = "'.$session{config}{extrasURL}.'/htmlArea/";'."\n";
|
||||
$output .= '</script>'."\n";
|
||||
$htmlArea = 1;
|
||||
}
|
||||
} elsif ($browser->ie && $browser->version >= 5) {
|
||||
} </script>';
|
||||
} elsif ($session{user}{richEditor} eq "htmlArea" && $browser->ie && $browser->version >= 5.5) {
|
||||
if ($session{user}{richEditorMode} eq "popup" || $_[0]->{popupToggle}) {
|
||||
$output .= '<script language="JavaScript">
|
||||
var formObj;
|
||||
var extrasDir="'.$session{config}{extrasURL}.'";
|
||||
function openEditWindow(obj) {
|
||||
formObj = obj;
|
||||
window.open("'.$session{config}{extrasURL}.'/ie5edit.html","editWindow","width=490,height=400,resizable=1"); }
|
||||
function setContent(content) {
|
||||
formObj.value = content;
|
||||
} </script>';
|
||||
var formObj;
|
||||
var extrasDir="'.$session{config}{extrasURL}.'";
|
||||
function openEditWindow(obj) {
|
||||
formObj = obj;
|
||||
window.open("'.$session{config}{extrasURL}.'/htmlArea/editor.html","editWindow","width=490,height=400,resizable=1"); }
|
||||
function setContent(content) {
|
||||
formObj.value = content;
|
||||
} </script>';
|
||||
$output .= $button;
|
||||
} else {
|
||||
$output .= '<script language="Javascript1.2" src="'.$session{config}{extrasURL}
|
||||
.'/htmlArea/editor.js"></script>'."\n";
|
||||
$output .= '<script>'."\n";
|
||||
$output .= '_editor_url = "'.$session{config}{extrasURL}.'/htmlArea/";'."\n";
|
||||
$output .= '</script>'."\n";
|
||||
$htmlArea = 1;
|
||||
}
|
||||
} elsif ($session{user}{richEditor} eq "classic" && $browser->ie && $browser->version >= 5) {
|
||||
$output .= '<script language="JavaScript">
|
||||
var formObj; var extrasDir="'.$session{config}{extrasURL}.'";
|
||||
function openEditWindow(obj) {
|
||||
formObj = obj;
|
||||
window.open("'.$session{config}{extrasURL}.'/ie5edit.html","editWindow","width=490,height=400,resizable=1"); }
|
||||
function setContent(content) { formObj.value = content; } </script>';
|
||||
$output .= $button;
|
||||
### UNCOMMENT THIS WHEN MOZILLA 1.3 COMES OUT
|
||||
# } elsif ($browser->gecko && $browser->version >= 1.3) {
|
||||
# } elsif ($session{user}{richEditor} eq "wendedit" && $browser->gecko && $browser->version >= 1.3) {
|
||||
# $output .= '<script language="JavaScript">
|
||||
# var formObj;
|
||||
## var extrasDir="'.$session{config}{extrasURL}.'";
|
||||
|
|
@ -709,8 +704,8 @@ sub HTMLArea {
|
|||
# formObj.value = content;
|
||||
# } </script>';
|
||||
# $output .= $button;
|
||||
} else {
|
||||
$output .= '<script language="JavaScript">
|
||||
} elsif ($session{user}{richEditor} eq "lastResort") {
|
||||
$output .= '<script language="JavaScript">
|
||||
var formObj;
|
||||
var extrasDir="'.$session{config}{extrasURL}.'";
|
||||
function openEditWindow(obj) {
|
||||
|
|
@ -720,8 +715,7 @@ sub HTMLArea {
|
|||
function setContent(content) {
|
||||
formObj.value = content;
|
||||
} </script>';
|
||||
$output .= $button;
|
||||
}
|
||||
$output .= $button;
|
||||
}
|
||||
$rows = $_[0]->{rows} || ($session{setting}{textAreaRows}+7);
|
||||
$columns = $_[0]->{columns} || ($session{setting}{textAreaCols}+5);
|
||||
|
|
|
|||
|
|
@ -49,8 +49,7 @@ sub www_editUserSettings {
|
|||
$f->yesNo("useKarma",WebGUI::International::get(539),$session{setting}{useKarma});
|
||||
$f->integer("karmaPerLogin",WebGUI::International::get(540),$session{setting}{karmaPerLogin});
|
||||
$f->interval("sessionTimeout",WebGUI::International::get(142),WebGUI::DateTime::secondsToInterval($session{setting}{sessionTimeout}));
|
||||
#$f->yesNo("usernameBinding",WebGUI::International::get(306),$session{setting}{usernameBinding});
|
||||
$f->yesNo("selfDeactivation","Allow users to deactivate their account",$session{setting}{selfDeactivation});
|
||||
$f->yesNo("selfDeactivation",WebGUI::International::get(885),$session{setting}{selfDeactivation});
|
||||
$f->select("authMethod",$session{authentication},WebGUI::International::get(119),[$session{setting}{authMethod}]);
|
||||
foreach (keys %{$session{authentication}}) {
|
||||
$f->raw(WebGUI::Authentication::settingsForm($_));
|
||||
|
|
@ -79,11 +78,10 @@ sub www_editCompanyInformation {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_editContentSettings {
|
||||
WebGUI::Privilege::adminOnly() unless (WebGUI::Privilege::isInGroup(3));
|
||||
my ($output, %htmlFilter, %editor, $f, $pages);
|
||||
my ($output, %htmlFilter, $f, $pages);
|
||||
$pages = WebGUI::SQL->buildHashRef("select pageId,menuTitle from page order by menuTitle");
|
||||
%htmlFilter = ('none'=>WebGUI::International::get(420), 'most'=>WebGUI::International::get(421),
|
||||
'javascript'=>WebGUI::International::get(526), 'all'=>WebGUI::International::get(419));
|
||||
%editor = ('built-in'=>WebGUI::International::get(495), 'edit-on-pro'=>WebGUI::International::get(494));
|
||||
$output .= helpIcon(29);
|
||||
$output .= '<h1>'.WebGUI::International::get(525).'</h1>';
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
|
|
@ -100,7 +98,6 @@ sub www_editContentSettings {
|
|||
$f->integer("textAreaRows",WebGUI::International::get(463),$session{setting}{textAreaRows});
|
||||
$f->integer("textAreaCols",WebGUI::International::get(464),$session{setting}{textAreaCols});
|
||||
$f->integer("textBoxSize",WebGUI::International::get(465),$session{setting}{textBoxSize});
|
||||
$f->select("richEditor",\%editor,WebGUI::International::get(496),[$session{setting}{richEditor}]);
|
||||
$f->submit;
|
||||
$output .= $f->print;
|
||||
return _submenu($output);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue