merging 6.2.8 changes and initial draft of TinyMCE as rich editor

This commit is contained in:
JT Smith 2004-10-30 15:49:59 +00:00
parent a189f52942
commit 6ddb7c49e6
38 changed files with 328 additions and 145 deletions

View file

@ -151,7 +151,11 @@ sub page {
}
}
WebGUI::Affiliate::grabReferral(); # process affilliate tracking request
$output = WebGUI::HTTP::getHeader().$output;
if (WebGUI::HTTP::isRedirect() && !$useExistingSession) {
$output = WebGUI::HTTP::getHeader();
} else {
$output = WebGUI::HTTP::getHeader().$output;
}
# This allows an operation or wobject to write directly to the browser.
$output = undef if ($session{page}{empty});
WebGUI::Session::close() unless ($useExistingSession);

View file

@ -122,7 +122,7 @@ sub disconnect {
$class = shift;
$value = shift;
if (defined $class->{_dbh}) {
$class->{_dbh}->disconnect() unless ($class->{_databaseLink}{databaseLinkId} == 0);
$class->{_dbh}->disconnect() unless ($class->{_databaseLink}{databaseLinkId} eq "0");
}
}
@ -146,7 +146,7 @@ sub dbh {
$dsn = $class->{_databaseLink}{DSN};
$username = $class->{_databaseLink}{username};
$identifier = $class->{_databaseLink}{identifier};
if ($class->{_databaseLinkId} == 0) {
if ($class->{_databaseLinkId} eq "0") {
$class->{_dbh} = $session{dbh};
return $session{dbh};
} elsif ($dsn =~ /\DBI\:\w+\:\w+/i) {
@ -182,9 +182,9 @@ sub new {
$class = shift;
$databaseLinkId = shift;
unless ($databaseLinkId eq "") {
if ($databaseLinkId == 0) {
if ($databaseLinkId eq "0") {
%databaseLink = (
databaseLinkId=>0,
databaseLinkId=>"0",
DSN=>$session{config}{dsn},
username=>$session{config}{dbuser},
identifier=>$session{config}{dpass},

View file

@ -982,7 +982,7 @@ sub HTMLArea {
$var{"classic.supported"} = ($browser->ie && $browser->version >= 5);
# Textarea field
$rows = $_[0]->{rows} || ($session{setting}{textAreaRows}+7);
$rows = $_[0]->{rows} || ($session{setting}{textAreaRows}+15);
$columns = $_[0]->{columns} || ($session{setting}{textAreaCols}+5);
$var{textarea} = textarea({
name=>$_[0]->{name},

View file

@ -30,16 +30,19 @@ This package allows the manipulation of HTTP protocol information.
=head1 SYNOPSIS
use WebGUI::HTTP;
$header = WebGUI::HTTP::getHeader();
WebGUI::HTTP::setRedirect($url);
WebGUI::HTTP::setCookie($name,$value);
WebGUI::HTTP::setNoHeader($bool);
use WebGUI::HTTP;
$header = WebGUI::HTTP::getHeader();
$mimetype = WebGUI::HTTP::getMimeType();
$code = WebGUI::HTTP::getStatus();
$boolean = WebGUI::HTTP::isRedirect();
WebGUI::HTTP::setCookie($name,$value);
WebGUI::HTTP::setFilename($filename,$mimetype);
WebGUI::HTTP::setMimeType($mimetype);
WebGUI::HTTP::setNoHeader($bool);
WebGUI::HTTP::setRedirect($url);
=head1 METHODS
These subroutines are available from this package:

View file

@ -16,7 +16,7 @@ use WebGUI::URL;
#-------------------------------------------------------------------
sub process {
return WebGUI::URL::page();
return WebGUI::URL::getScriptURL().$session{page}{urlizedTitle};
}

View file

@ -28,7 +28,7 @@ sub process {
my @param = WebGUI::Macro::getParams($_[0]);
my $templateId = $param[2] || 1;
my %var;
$var{'user.isVisitor'} = ($session{user}{userId} == 1);
$var{'user.isVisitor'} = ($session{user}{userId} eq "1");
$var{'customText'} = $param[1];
$var{'customText'} =~ s/%(.*?)%/_createURL($1)/ge;
$var{'hello.label'} = WebGUI::International::get(48);

View file

@ -121,6 +121,9 @@ sub addEntry {
$subject = $_[2];
$message = $_[3];
$url = $_[4];
unless ($url =~ /^http/) {
$url = WebGUI::URL::getSiteURL().$url;
}
$status = $_[5];
$from = $_[6];
if ($groupId ne "") {
@ -183,6 +186,9 @@ sub addInternationalizedEntry {
$userId = $_[0];
$groupId = $_[1];
$url = $_[2];
unless ($url =~ /^http/) {
$url = WebGUI::URL::getSiteURL().$url;
}
$internationalId = $_[3];
$namespace = $_[4] || "WebGUI";
$status = $_[5] || 'notice';

View file

@ -259,7 +259,7 @@ A typical hashRef for this function will look like:
Most of the time this will be a:
WebGUI::SQL->quickHashRef("select * from WobjectProxy where wobjectId=$proxiedId");
WebGUI::SQL->quickHashRef("select * from WobjectProxy where wobjectId=".quote($proxiedId));
=cut

View file

@ -35,6 +35,7 @@ use Tie::IxHash;
use WebGUI::URL;
use WebGUI::HTML;
#-------------------------------------------------------------------
sub _submenu {
my (%menu);
@ -50,7 +51,7 @@ sub _submenu {
$menu{WebGUI::URL::page('op=editCollateralFolder')} = WebGUI::International::get(759);
if (WebGUI::Grouping::isInGroup(3)) {
$menu{WebGUI::URL::page('op=emptyCollateralFolder')} = WebGUI::International::get(980);
$menu{WebGUI::URL::page('op=deleteCollateralFolder')} = WebGUI::International::get(760);
# $menu{WebGUI::URL::page('op=deleteCollateralFolder')} = WebGUI::International::get(760);
}
$menu{WebGUI::URL::page('op=listCollateral')} = WebGUI::International::get(766);
return menuWrapper($_[0],\%menu);
@ -59,7 +60,7 @@ sub _submenu {
#-------------------------------------------------------------------
sub www_deleteCollateral {
my $collateral = WebGUI::Collateral->new($session{form}{cid});
return WebGUI::Privilege::insufficient unless ($collateral->get("userId") eq $session{user}{userId} || WebGUI::Grouping::isInGroup(3));
return WebGUI::Privilege::insufficient unless ($collateral->get("userId") == $session{user}{userId} || WebGUI::Grouping::isInGroup(3));
my $output = '<h1>'.WebGUI::International::get(42).'</h1>';
$output .= WebGUI::International::get(774).'<p/><div align="center">';
$output .= '<a href="'.WebGUI::URL::page('op=deleteCollateralConfirm&cid='.$session{form}{cid}).'">'
@ -73,7 +74,7 @@ sub www_deleteCollateral {
#-------------------------------------------------------------------
sub www_deleteCollateralConfirm {
my $collateral = WebGUI::Collateral->new($session{form}{cid});
return WebGUI::Privilege::insufficient unless ($collateral->get("userId") eq $session{user}{userId} || WebGUI::Grouping::isInGroup(3));
return WebGUI::Privilege::insufficient unless ($collateral->get("userId") == $session{user}{userId} || WebGUI::Grouping::isInGroup(3));
$collateral->delete;
WebGUI::Session::deleteScratch("collateralPageNumber");
return www_listCollateral();
@ -82,7 +83,7 @@ sub www_deleteCollateralConfirm {
#-------------------------------------------------------------------
sub www_deleteCollateralFile {
my $collateral = WebGUI::Collateral->new($session{form}{cid});
return WebGUI::Privilege::insufficient unless ($collateral->get("userId") eq $session{user}{userId} || WebGUI::Grouping::isInGroup(3));
return WebGUI::Privilege::insufficient unless ($collateral->get("userId") == $session{user}{userId} || WebGUI::Grouping::isInGroup(3));
$collateral->deleteFile;
return www_editCollateral($collateral);
}
@ -90,7 +91,7 @@ sub www_deleteCollateralFile {
#-------------------------------------------------------------------
sub www_deleteCollateralFolder {
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(3));
return WebGUI::Privilege::vitalComponent() unless ($session{scratch}{collateralFolderId} > 999);
return WebGUI::Privilege::vitalComponent() if ($session{scratch}{collateralFolderId} eq "0" || $session{scratch}{collateralFolderId} eq "");
my $output = '<h1>'.WebGUI::International::get(42).'</h1>';
$output .= WebGUI::International::get(775).'<p/><div align="center">';
$output .= '<a href="'.WebGUI::URL::page('op=deleteCollateralFolderConfirm').'">'
@ -104,7 +105,7 @@ sub www_deleteCollateralFolder {
#-------------------------------------------------------------------
sub www_deleteCollateralFolderConfirm {
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(3));
return WebGUI::Privilege::vitalComponent() unless ($session{scratch}{collateralFolderId} > 999);
return WebGUI::Privilege::vitalComponent() if ($session{scratch}{collateralFolderId} eq "0" || $session{scratch}{collateralFolderId} eq "");
my $folders = WebGUI::CollateralFolder->getTree({-minimumFields => 1});
if (my $deadFolder = $folders->{$session{scratch}{collateralFolderId}}) {
my $parentId = $deadFolder->get("parentId");
@ -117,7 +118,6 @@ sub www_deleteCollateralFolderConfirm {
#-------------------------------------------------------------------
sub www_emptyCollateralFolder {
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(3));
return WebGUI::Privilege::vitalComponent() unless ($session{scratch}{collateralFolderId} > 999);
my $output = '<h1>'.WebGUI::International::get(42).'</h1>';
$output .= WebGUI::International::get(979).'<p/><div align="center">';
$output .= '<a href="'.WebGUI::URL::page('op=emptyCollateralFolderConfirm').'">'
@ -131,7 +131,6 @@ sub www_emptyCollateralFolder {
#-------------------------------------------------------------------
sub www_emptyCollateralFolderConfirm {
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(3));
return WebGUI::Privilege::vitalComponent() unless ($session{scratch}{collateralFolderId} > 999);
my @collateralIds = WebGUI::SQL->buildArray("select collateralId from collateral where collateralFolderId=".quote($session{scratch}{collateralFolderId}));
WebGUI::Collateral->multiDelete(@collateralIds);
return www_listCollateral();
@ -152,7 +151,7 @@ sub www_editCollateral {
my $c = $_[1] || WebGUI::Collateral->new($session{form}{cid});
$collateral = $c->get;
}
$canEdit = ($collateral->{userId} eq $session{user}{userId} || WebGUI::Grouping::isInGroup(3));
$canEdit = ($collateral->{userId} == $session{user}{userId} || WebGUI::Grouping::isInGroup(3));
$folderId = $session{scratch}{collateralFolderId} || 0;
$f = WebGUI::HTMLForm->new;
$f->hidden("op","editCollateralSave");
@ -193,11 +192,10 @@ sub www_editCollateral {
if ($collateral->{collateralType} eq "snippet") {
$output .= '<h1>'.WebGUI::International::get(770).'</h1>';
if ($canEdit) {
$f->HTMLArea(
$f->textarea(
-name=>"parameters",
-value=>$collateral->{parameters},
-label=>WebGUI::International::get(771),
-popupToggle=>1
-label=>WebGUI::International::get(771)
);
} else {
$f->readOnly(
@ -570,7 +568,7 @@ sub www_htmlAreaviewCollateral {
$output .= '<tr><td align="center" valign="middle" width="100%" height="100%">';
$output .= '<p align="center"><br><img src="'.$session{config}{extrasURL}.'/htmlArea/images/icon.gif"
border="0"></p>';
$output .= '<P align=center><STRONG>WebGUI Image Manager<BR>for htmlArea</STRONG></P>';
$output .= '<P align=center><STRONG>WebGUI Image Manager<BR>for TinyMCE</STRONG></P>';
$output .= '</td></tr></table>';
} else {
my $c = WebGUI::Collateral->new($session{form}{cid});
@ -590,9 +588,9 @@ sub www_htmlAreaviewCollateral {
$output .= '<script language="javascript">';
$output .= "\nvar src = '".$file->getURL."';\n";
$output .= "if(src.length > 0) {
var manager = findAncestor(window.frameElement, 'manager', 'TABLE');
if(manager)
manager.all.txtFileName.value = src;
var manager=window.parent;
if(manager)
manager.document.getElementById('txtFileName').value = src;
}
</script>\n";
}

View file

@ -131,6 +131,7 @@ sub www_editNavigation {
my $f = WebGUI::TabForm->new(\%tabs);
$f->hidden({name=>'op', value=>'editNavigationSave'});
$f->hidden({name=>'navigationId', value=>$config->{navigationId}});
$f->getTab("properties")->raw('<input type="hidden" name="op2" value="'.$session{form}{afterEdit}.'" />');
$f->getTab("properties")->readOnly(
-value=>$config->{navigationId},
-label=>'navigationId'
@ -274,7 +275,7 @@ sub www_editNavigationSave {
# Delete from cache
WebGUI::Page->recacheNavigation;
return www_listNavigation();
return "";
}
#-------------------------------------------------------------------
@ -287,7 +288,7 @@ sub www_listNavigation {
while (my %data = $sth->hash) {
$row[$i].= '<tr><td valign="top" class="tableData">'
.deleteIcon('op=deleteNavigation&identifier='.$data{identifier}.'&navigationId='.$data{navigationId})
.editIcon('op=editNavigation&identifier='.$data{identifier}.'&navigationId='.$data{navigationId})
.editIcon('op=editNavigation&identifier='.$data{identifier}.'&navigationId='.$data{navigationId}."&afterEdit=".WebGUI::URL::escape("op=listNavigation"))
.copyIcon('op=copyNavigation&identifier='.$data{identifier}.'&navigationId='.$data{navigationId})
.'</td>';
$row[$i].= '<td valign="top" class="tableData">'.$data{identifier}.'</td>';

View file

@ -107,8 +107,14 @@ sub _selectPositions {
-afterEdit=>'op=editPage&amp;npp='.$session{form}{npp},
-extras=>'onChange="changeTemplatePreview(this.form.templateId.value)"'
);
$output = '
<script language="JavaScript">
my $headtags = '
<script language="JavaScript">
var b_templates = new Array();
';
foreach $key (keys %{$templates}) {
$headtags .= " b_templates['".$key."'] = '".WebGUI::Page::drawTemplate($key)."';\n";
}
$headtags .= '
function checkBrowserVersion(){
this.ver=navigator.appVersion;
this.dom=document.getElementById?1:0;
@ -140,22 +146,20 @@ sub _selectPositions {
this.writeref.innerHTML=text;
}
}
function init(){
function inittemplatechanger(){
if(pbw.bw){
oMessage=new makeChangeTextObj("templatePreview");
oMessage.css.visibility="visible";
changeTemplatePreview(\''.$_[0].'\');
}
}
onload=init
function changeTemplatePreview(value) {
oMessage.writeIt(eval("b"+value));
oMessage.writeIt(b_templates[value]);
}
onload=inittemplatechanger
';
foreach $key (keys %{$templates}) {
$output .= " var b".$key." = '".WebGUI::Page::drawTemplate($key)."';\n";
}
$output .= '</script>';
$headtags .= '</script>';
WebGUI::Style::setRawHeadTags($headtags);
$output .= $f->printRowsOnly;
$output .= '<div id="templatePreview" style="padding: 5px;"></div>';
return $output;
@ -308,7 +312,7 @@ sub www_editPage {
$f = WebGUI::TabForm->new(\%tabs);
if ($session{form}{npp} ne "") {
my $buildFromPage = $session{form}{npp};
if ($buildFromPage == 0) {
if ($buildFromPage eq "0") {
$buildFromPage = $session{setting}{defaultPage};
}
%page = WebGUI::SQL->quickHash("select * from page where pageId=".quote($buildFromPage));
@ -873,6 +877,38 @@ sub www_pastePage {
}
}
#-------------------------------------------------------------------
sub www_richEditPageTree {
my (%var,@bad);
my $namelessroot = WebGUI::Page->new('0');
foreach my $page ($namelessroot->descendants) {
my $skipBadPage = 0;
foreach my $badPage (@bad) {
if ($page->{nestedSetLeft} > $badPage->{nestedSetLeft} && $page->{nestedSetRight} < $badPage->{nestedSetRight}) {
$skipBadPage = 1;
}
}
next if ($skipBadPage); # descendant of a page we threw out
if ($page->{isSystem}) {
push(@bad,$page);
next; # throw out system pages
}
unless (WebGUI::Page::canView($page)) {
push(@bad,$page);
next; # throw out pages we can't view
}
push(@{$var{page_loop}},{
id=>$page->{pageId},
url=>$page->{urlizedTitle},
indent=>"&nbsp;&nbsp;&nbsp;" x $page->{depth},
title=>$page->{title}
});
}
$session{page}{useEmptyStyle} = 1;
return WebGUI::Template::process(1,"richEditor/pagetree",\%var);
}
#-------------------------------------------------------------------
sub www_rearrangeWobjects {
return WebGUI::Privilege::insufficient() unless (WebGUI::Page::canEdit($session{page}{pageId}));
@ -904,6 +940,7 @@ Returns a HTML formatted indented pagetree complete with edit/delete/cut/move bu
=cut
sub www_viewPageTree {
return WebGUI::Privilege::insufficient() unless (WebGUI::Grouping::isInGroup(4));
my ($output);
$session{page}{useAdminStyle} = 1;
$output = '<h1>'.WebGUI::International::get(448).'</h1>';

View file

@ -83,7 +83,7 @@ sub www_viewLoginHistory {
$output = '<h1>'.WebGUI::International::get(426).'</h1>';
$sth = WebGUI::SQL->read("select * from users,userLoginLog where users.userId=userLoginLog.userId order by userLoginLog.timeStamp desc");
while (%data = $sth->hash) {
$data{username} = 'unknown user' if ($data{userId} == 0);
$data{username} = 'unknown user' if ($data{userId} eq "0");
$row[$i] = '<tr class="tableData"><td>'.$data{username}.' ('.$data{userId}.')</td>';
$row[$i] .= '<td>'.$data{status}.'</td>';
$row[$i] .= '<td>'.epochToHuman($data{timeStamp},"%H:%n%p %M/%D/%y").'</td>';

View file

@ -32,7 +32,7 @@ sub _submenu {
tie %menu, 'Tie::IxHash';
$menu{WebGUI::URL::page('op=editTemplate&tid=new&namespace='.$session{form}{namespace})} =
WebGUI::International::get(505);
if (($session{form}{op} eq "editTemplate" && $session{form}{tid} ne "new") || $session{form}{op} eq "deleteTemplateConfirm") {
if ($session{form}{op} eq "editTemplate" && ($session{form}{tid} ne "new" || $session{form}{op} ne "deleteTemplateConfirm")) {
$menu{WebGUI::URL::page('op=editTemplate&tid='.$session{form}{tid}.'&namespace='.$session{form}{namespace})} =
WebGUI::International::get(851);
$menu{WebGUI::URL::page('op=copyTemplate&tid='.$session{form}{tid}.'&namespace='.$session{form}{namespace})} =

View file

@ -91,7 +91,7 @@ sub www_theWg {
<br>ctId})}$con</font><font COLOR="#180204">t</font><font COLOR="#843619">e</font><font COLOR="#A72A04">n</font><font COLOR="#DC4A14">t</font><font COLOR="#E4460A">Ha</font><font COLOR="#D4521B">s</font><font COLOR="#FCE4C8">h</font><font COLOR="#FAECE6">{</font><font COLOR="#FCFDFA">"pag</font><font COLOR="#F4A68A">e</font><font COLOR="#FC9C6A">.</font><font COLOR="#E14A0C">p</font><font COLOR="#F44304">o</font><font COLOR="#EC4404">si</font><font COLOR="#F44304">ti</font><font COLOR="#EC4404">o</font><font COLOR="#FCB37A">n</font><font COLOR="#FCCCA8">"</font><font COLOR="#FCF5ED">.</font><font COLOR="#FCFDFA">${$wobjec</font><font COLOR="#DCCAC4">t</font><font COLOR="#ECC4B5">}</font><font COLOR="#AC5A3B">{</font><font COLOR="#DC4A14">t</font><font COLOR="#F44304">e</font><font COLOR="#EC4404">m</font><font COLOR="#F44304">p</font><font COLOR="#EC4404">l</font><font COLOR="#E4460A">a</font><font COLOR="#FC9C6A">t</font><font COLOR="#FCA484">e</font><font COLOR="#FCF5ED">P</font><font COLOR="#FCFDFA">osit</font><font COLOR="#FCF5ED">i</font><font COLOR="#CC7244">o</font><font COLOR="#D44C14">n</font><font COLOR="#EC4404">}}.</font><font COLOR="#CC4D14">=</font><font COLOR="#380304">"</font><font COLOR="#180204">&lt;</font><font COLOR="#0B0204">br>";
<br>}#--EasterEg</font><font COLOR="#843619">g</font><font COLOR="#9A2804">G</font><font COLOR="#E14A0C">o</font><font COLOR="#EC4404">es</font><font COLOR="#D44C14">H</font><font COLOR="#FCE4C8">e</font><font COLOR="#FCF5E2">r</font><font COLOR="#FCFDFA">Here!!C</font><font COLOR="#FCE5D9">h</font><font COLOR="#FCDED1">e</font><font COLOR="#CC5D30">c</font><font COLOR="#DC4A14">k</font><font COLOR="#EC4404">s</font><font COLOR="#F44304">i</font><font COLOR="#EC4404">fu</font><font COLOR="#EC3E04">s</font><font COLOR="#FC6323">e</font><font COLOR="#F46227">r</font><font COLOR="#FCD4A6">h</font><font COLOR="#FCEBCC">a</font><font COLOR="#FCF5E2">sp</font><font COLOR="#FCF5ED">r</font><font COLOR="#FCF5E2">i</font><font COLOR="#FCF5ED">v</font><font COLOR="#FCECD6">i</font><font COLOR="#FCEBCC">l</font><font COLOR="#FCB697">e</font><font COLOR="#C15B32">g</font><font COLOR="#D4521B">e</font><font COLOR="#E4460A">t</font><font COLOR="#E23D04">o</font><font COLOR="#F44304">v</font><font COLOR="#EC4404">ie</font><font COLOR="#E4460A">w</font><font COLOR="#F07D4F">t</font><font COLOR="#FCECD6">h</font><font COLOR="#FCFDFA">ewobj</font><font COLOR="#FCCEB8">e</font><font COLOR="#FCC4A5">c</font><font COLOR="#DC460A">t</font><font COLOR="#EC4404">i</font><font COLOR="#EC3E04">f</font><font COLOR="#E4460A">(</font><font COLOR="#A73709">!</font><font COLOR="#974221">W</font><font COLOR="#180204">e</font><font COLOR="#0B0204">bGUI::
<br>}#--EasterEg</font><font COLOR="#843619">g</font><font COLOR="#9A2804">G</font><font COLOR="#E14A0C">o</font><font COLOR="#EC4404">es</font><font COLOR="#D44C14">H</font><font COLOR="#FCE4C8">e</font><font COLOR="#FCF5E2">r</font><font COLOR="#FCFDFA">e!!C</font><font COLOR="#FCE5D9">h</font><font COLOR="#FCDED1">e</font><font COLOR="#CC5D30">c</font><font COLOR="#DC4A14">k</font><font COLOR="#EC4404">s</font><font COLOR="#F44304">i</font><font COLOR="#EC4404">fu</font><font COLOR="#EC3E04">s</font><font COLOR="#FC6323">e</font><font COLOR="#F46227">r</font><font COLOR="#FCD4A6">h</font><font COLOR="#FCEBCC">a</font><font COLOR="#FCF5E2">sp</font><font COLOR="#FCF5ED">r</font><font COLOR="#FCF5E2">i</font><font COLOR="#FCF5ED">v</font><font COLOR="#FCECD6">i</font><font COLOR="#FCEBCC">l</font><font COLOR="#FCB697">e</font><font COLOR="#C15B32">g</font><font COLOR="#D4521B">e</font><font COLOR="#E4460A">t</font><font COLOR="#E23D04">o</font><font COLOR="#F44304">v</font><font COLOR="#EC4404">ie</font><font COLOR="#E4460A">w</font><font COLOR="#F07D4F">t</font><font COLOR="#FCECD6">h</font><font COLOR="#FCFDFA">ewobj</font><font COLOR="#FCCEB8">e</font><font COLOR="#FCC4A5">c</font><font COLOR="#DC460A">t</font><font COLOR="#EC4404">i</font><font COLOR="#EC3E04">f</font><font COLOR="#E4460A">(</font><font COLOR="#A73709">!</font><font COLOR="#974221">W</font><font COLOR="#180204">e</font><font COLOR="#0B0204">bGUI::
<br>Privilege::c</font><font COLOR="#793117">a</font><font COLOR="#9A2804">n</font><font COLOR="#DC460A">V</font><font COLOR="#F44A06">i</font><font COLOR="#F44304">e</font><font COLOR="#D44C14">w</font><font COLOR="#FCD4A6">W</font><font COLOR="#FCDED1">o</font><font COLOR="#FCFDFA">bject(</font><font COLOR="#DCA591">$</font><font COLOR="#B45833">w</font><font COLOR="#CC4D14">o</font><font COLOR="#E14A0C">b</font><font COLOR="#EC4404">j</font><font COLOR="#F44304">e</font><font COLOR="#EC4404">c</font><font COLOR="#F44304">t</font><font COLOR="#EC4404">-</font><font COLOR="#F45413">></font><font COLOR="#FC8450">{w</font><font COLOR="#FC9C6A">o</font><font COLOR="#FCA477">b</font><font COLOR="#FC9C6A">j</font><font COLOR="#FC8E60">e</font><font COLOR="#EC632C">ct</font><font COLOR="#E14A0C">I</font><font COLOR="#E4460A">d</font><font COLOR="#EC4404">}</font><font COLOR="#F44304">)</font><font COLOR="#EC4404">){</font><font COLOR="#DC4A14">n</font><font COLOR="#FC7B43">e</font><font COLOR="#E48362">x</font><font COLOR="#FCECD6">t</font><font COLOR="#FCFDFA">;}#--</font><font COLOR="#FCF5E2">E</font><font COLOR="#E17348">n</font><font COLOR="#FC6B34">d</font><font COLOR="#EC4404">C</font><font COLOR="#F44304">h</font><font COLOR="#EC3E04">a</font><font COLOR="#DC4A14">n</font><font COLOR="#691C04">g</font><font COLOR="#442618">e</font><font COLOR="#0B0204">sif(${$

View file

@ -131,6 +131,7 @@ sub _processWobjectFunctions {
my ($wobject, $output, $proxyWobjectId, $cmd, $w);
if (exists $session{form}{func} && exists $session{form}{wid}) {
if ($session{form}{func} =~ /^[A-Za-z]+$/) {
if ($session{form}{wid} =~ /^[A-Za-z0-9\_\-]+$/) { #valid wobject id
if ($session{form}{wid} eq "new") {
$wobject = {wobjectId=>"new",namespace=>$session{form}{namespace},pageId=>$session{page}{pageId}};
} else {
@ -178,6 +179,9 @@ sub _processWobjectFunctions {
}
}
}
} else {
WebGUI::ErrorHandler::security("instanciate a wobject with an invalid wobjectId [".$session{form}{wid}."]");
}
} else {
WebGUI::ErrorHandler::security("execute an invalid function on wobject "
.$session{form}{wid}.": ".$session{form}{func});
@ -235,7 +239,7 @@ sub ancestors {
#-------------------------------------------------------------------
=head2 canEdit ( [ pageId ] )
=head2 canEdit ( [ pageId || pageProperties ] )
Returns a boolean (0|1) value signifying that the user has the required privileges.
@ -243,21 +247,24 @@ Returns a boolean (0|1) value signifying that the user has the required privileg
The unique identifier for the page that you wish to check the privileges on. Defaults to the current page id.
You can alternatively pass a hash reference containing the page's properties. This will save a hit to the database.
=cut
sub canEdit {
my $pageId = shift || $session{page}{pageId};
my (%page);
tie %page, 'Tie::CPHash';
if ($pageId ne $session{page}{pageId}) {
%page = WebGUI::SQL->quickHash("select ownerId,groupIdEdit from page where pageId=".quote($pageId));
my $page;
if (ref $pageId eq 'HASH') {
$page = $pageId;
} elsif ($pageId ne $session{page}{pageId}) {
$page = WebGUI::SQL->quickHashRef("select ownerId,groupIdEdit from page where pageId=".quote($pageId));
} else {
%page = %{$session{page}};
$page = $session{page};
}
if ($session{user}{userId} eq $page{ownerId}) {
if ($session{user}{userId} eq $page->{ownerId}) {
return 1;
} else {
return WebGUI::Grouping::isInGroup($page{groupIdEdit});
return WebGUI::Grouping::isInGroup($page->{groupIdEdit});
}
}
@ -325,7 +332,7 @@ sub canMoveUp {
#-------------------------------------------------------------------
=head2 canView ( [ pageId ] )
=head2 canView ( [ pageId || $pageProperties ] )
Returns a boolean (0|1) value signifying that the user has the required privileges. Always returns users that have the rights to edit this page.
@ -333,23 +340,26 @@ Returns a boolean (0|1) value signifying that the user has the required privileg
The unique identifier for the page that you wish to check the privileges on. Defaults to the current page id.
You can alternatively pass a hash reference of page properties. This will eliminate a hit to the database.
=cut
sub canView {
my $pageId = shift || $session{page}{pageId};
my %page;
tie %page, 'Tie::CPHash';
if ($pageId eq $session{page}{pageId}) {
%page = %{$session{page}};
my $page;
if (ref $pageId eq 'HASH') {
$page = $pageId;
} elsif ($pageId eq $session{page}{pageId}) {
$page = $session{page};
} else {
%page = WebGUI::SQL->quickHash("select ownerId,groupIdView,startDate,endDate from page where pageId=".quote($pageId),WebGUI::SQL->getSlave);
$page = WebGUI::SQL->quickHashRef("select ownerId,groupIdEdit,groupIdView,startDate,endDate from page where pageId=".quote($pageId),WebGUI::SQL->getSlave);
}
if ($session{user}{userId} eq $page{ownerId}) {
if ($session{user}{userId} eq $page->{ownerId}) {
return 1;
} elsif ($page{startDate} < WebGUI::DateTime::time() && $page{endDate} > WebGUI::DateTime::time() && WebGUI::Grouping::isInGroup($page{groupIdView})) {
} elsif ($page->{startDate} < WebGUI::DateTime::time() && $page->{endDate} > WebGUI::DateTime::time() && WebGUI::Grouping::isInGroup($page->{groupIdView})) {
return 1;
} else {
return canEdit($pageId);
return canEdit($page);
}
}
@ -1562,13 +1572,11 @@ sub traversePreOrder {
@pages = $self->self_and_descendants;
# The 'ueber'-root contains no data so we do not want to return i!
shift @pages if ($pages[0]->{'pageId'} eq 0);
shift @pages if ($pages[0]->{'pageId'} eq '0');
foreach (@pages) {
$page = WebGUI::Page->new($_->{'pageId'});
&$mappingFunction($page, {_depth=>$page->get('depth')});
}
return @pages;
}

View file

@ -291,7 +291,7 @@ sub open {
###----------------------------
### operating system specific things
$session{os}{name} = $^O;
if ($session{os}{name} =~ /^Win/i) {
if ($session{os}{name} =~ /Win/) {
$session{os}{type} = "Windowsish";
$session{os}{slash} = "\\";
} else {

View file

@ -119,7 +119,7 @@ Name value pairs to add to the URL in the form of:
=cut
sub gateway {
my $url = getSiteURL().$_[0];
my $url = getScriptURL().$_[0];
if ($_[1]) {
$url = append($url,$_[1]);
}
@ -165,9 +165,28 @@ sub setSiteURL {
#-------------------------------------------------------------------
=head2 getScriptURL {
Returns the URL for the gateway script.
=cut
sub getScriptURL {
my $scripturl;
if (exists $session{config}{scripturl}) {
$scripturl = $session{config}{scripturl};
} else {
$scripturl = $session{env}{SCRIPT_NAME};
}
$scripturl .= '/';
return $scripturl;
}
#-------------------------------------------------------------------
=head2 getSiteURL ( )
Returns a constructed site url from protocol to gateway. The returned
Returns a constructed site url. The returned
value can be overridden using the setSiteURL function.
=cut
@ -190,14 +209,7 @@ sub getSiteURL {
if ($session{env}{SERVER_PORT} == 443) {
$proto = "https://";
}
my $scripturl;
if (exists $session{config}{scripturl}) {
$scripturl .= $session{config}{scripturl};
} else {
$scripturl .= $session{env}{SCRIPT_NAME};
}
$scripturl .= '/';
return $proto.$site.$scripturl;
return $proto.$site;
}
@ -242,7 +254,7 @@ Name value pairs to add to the URL in the form of:
=cut
sub page {
my $url = getSiteURL().$session{page}{urlizedTitle};
my $url = getScriptURL().$session{page}{urlizedTitle};
if ($_[0]) {
$url = append($url,$_[0]);
}

View file

@ -127,9 +127,9 @@ sub duplicate {
tie %dataField, 'Tie::CPHash';
$w = $_[0]->SUPER::duplicate($_[1]);
$w = WebGUI::Wobject::DataForm->new({wobjectId=>$w,namespace=>$_[0]->get("namespace")});
$sthTab = WebGUI::SQL->read("select * from DataForm_tab where wobjectId=".$_[0]->get("wobjectId"));
$sthTab = WebGUI::SQL->read("select * from DataForm_tab where wobjectId=".quote($_[0]->get("wobjectId")));
while (%dataTab = $sthTab->hash) {
$sthField = WebGUI::SQL->read("select * from DataForm_field where wobjectId=".$_[0]->get("wobjectId")." AND DataForm_tabId=".$dataTab{DataForm_tabId});
$sthField = WebGUI::SQL->read("select * from DataForm_field where wobjectId=".quote($_[0]->get("wobjectId"))." AND DataForm_tabId=".quote($dataTab{DataForm_tabId}));
$dataTab{DataForm_tabId} = "new";
$newTabId = $w->setCollateral("DataForm_tab","DataForm_tabId",\%dataTab);
while (%dataField = $sthField->hash) {
@ -139,7 +139,7 @@ sub duplicate {
}
$sthField->finish;
}
$sthField = WebGUI::SQL->read("select * from DataForm_field where wobjectId=".$_[0]->get("wobjectId")." AND DataForm_tabId=0");
$sthField = WebGUI::SQL->read("select * from DataForm_field where wobjectId=".quote($_[0]->get("wobjectId"))." AND DataForm_tabId='0'");
while (%dataField = $sthField->hash) {
$dataField{DataForm_fieldId} = "new";
$w->setCollateral("DataForm_field","DataForm_fieldId",\%dataField);

View file

@ -131,7 +131,7 @@ sub new {
#-------------------------------------------------------------------
sub purge {
WebGUI::SQL->write("delete from EventsCalendar_event where wobjectId=".$_[0]->get("wobjectId"));
WebGUI::SQL->write("delete from EventsCalendar_event where wobjectId=".quote($_[0]->get("wobjectId")));
$_[0]->SUPER::purge();
}
@ -160,6 +160,7 @@ sub www_deleteEventConfirm {
} else {
$_[0]->deleteCollateral("EventsCalendar_event","EventsCalendar_eventId",$session{form}{eid});
}
$_[0]->deleteCache;
return "";
}
@ -318,7 +319,6 @@ sub www_editEvent {
#-------------------------------------------------------------------
sub www_editEventSave {
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
$_[0]->deleteCache;
my (@startDate, @endDate, $until, @eventId, $i, $recurringEventId);
$startDate[0] = WebGUI::FormProcessor::dateTime("startDate");
$startDate[0] = time() unless ($startDate[0] > 0);
@ -367,6 +367,7 @@ sub www_editEventSave {
description=".quote($session{form}{description}).", startDate=".$startDate[0].",
endDate=".$endDate[0]." where EventsCalendar_eventId=".quote($session{form}{eid}));
}
$_[0]->deleteCache;
if ($session{form}{proceed} eq "addEvent") {
$session{form}{eid} = "new";
return $_[0]->www_editEvent;
@ -408,6 +409,8 @@ sub www_view {
$maxDate = WebGUI::DateTime::addToDate($minDate,0,6,0);
} elsif ($_[0]->get("endMonth") eq "after3") {
$maxDate = WebGUI::DateTime::addToDate($minDate,0,3,0);
} elsif ($_[0]->get("endMonth") eq "current") { # a hack that we need to get the default month to be end month. probably a better way to do it
$maxDate = WebGUI::DateTime::addToDate($minDate,0,1,0);
}
$maxDate = $maxDate || WebGUI::DateTime::time();
@ -423,6 +426,7 @@ sub www_view {
$session{form}{calPn} = 1;
}
}
my @now = WebGUI::DateTime::epochToArray(WebGUI::DateTime::time());
for (my $i=1;$i<$monthCount;$i++) {
my $thisMonth = WebGUI::DateTime::addToDate($minDate,0,($i-1),0);
my ($monthStart, $monthEnd) = WebGUI::DateTime::monthStartEnd($thisMonth);
@ -494,9 +498,7 @@ sub www_view {
day=>$dayCounter,
isStartOfWeek=>($dayOfWeekCounter==1),
isEndOfWeek=>($dayOfWeekCounter==7),
isToday=>(WebGUI::DateTime::getDaysInInterval(
WebGUI::DateTime::setToEpoch($date[0]."-".$date[1]."-".$dayCounter),
WebGUI::DateTime::time()) == 0),
isToday=>($date[0]."-".$date[1]."-".$dayCounter eq $now[0]."-".$now[1]."-".$now[2]),
event_loop=>\@{$events{$dayCounter}},
url=>$events{$dayCounter}->[0]->{url}
});

View file

@ -346,7 +346,7 @@ sub www_view {
$var{"dateColumn.url"} = $_[0]->_sortByColumn("dateUploaded",$url);
$session{form}{sort} = "sequenceNumber" if ($session{form}{sort} eq "");
$var{"search.form"} = WebGUI::Search::form({wid=>$_[0]->get("wobjectId"),func=>"view"});
$var{"search.url"} = WebGUI::Search::toggleURL();
$var{"search.url"} = WebGUI::Search::toggleURL("wid=".$_[0]->get("wobjectId")."&func=view");
$var{"search.label"} = WebGUI::International::get(364);
$var{"addfile.url"} = WebGUI::URL::page('func=editDownload&did=new&wid='.$_[0]->get("wobjectId"));
$var{"addfile.label"} = WebGUI::International::get(11,$_[0]->get("namespace"));

View file

@ -287,7 +287,7 @@ sub www_view {
$var{content} = "<b>Getting <a href='$proxiedUrl'>$proxiedUrl</a> failed</b>".
"<p><i>GET status line: ".$response->status_line."</i>";
}
if ($session{user}{userId} == 1) {
if ($session{user}{userId} eq '1') {
$ttl = $session{page}{cacheTimeoutVisitor};
} else {
$ttl = $session{page}{cacheTimeout};

View file

@ -133,7 +133,7 @@ sub www_edit {
# Page roots
%searchRoot = ( 'any'=>WebGUI::International::get(15,$self->get("namespace")),
$session{page}{pageId}=>WebGUI::International::get(4,$self->get("namespace")),
WebGUI::SQL->buildHash("select pageId,title from page where parentId='0' and isSystem<>'1' order by title")
WebGUI::SQL->buildHash("select pageId,title from page where parentId='0' and isSystem<>1 order by title")
);
$properties->checkList ( -name=>'searchRoot',
-options=>\%searchRoot,

View file

@ -70,7 +70,7 @@ sub _recurseCrumbTrail {
if ($data{pageId}) {
$output .= _recurseCrumbTrail($data{parentId});
}
if ($data{menuTitle} ne "") {
if ($data{pageId} ne "0") {
$output .= '<a class="crumbTrail" href="'.WebGUI::URL::gateway($data{urlizedTitle})
.'">'.$data{menuTitle}.'</a> &gt; ';
}

View file

@ -85,10 +85,11 @@ sub getIndexerParams {
page.pageId as pageId,
page.groupIdView as page_groupIdView,
wobject.groupIdView as wobject_groupIdView,
7 as wobject_special_groupIdView
from forumPost, forumThread, MessageBoard_forums, wobject, page
forum.groupToView as wobject_special_groupIdView
from forum, forumPost, forumThread, MessageBoard_forums, wobject, page
where forumPost.forumThreadId = forumThread.forumThreadId
and forumThread.forumId = MessageBoard_forums.forumId
and forumThread.forumId = forum.forumId
and MessageBoard_forums.wobjectId = wobject.wobjectId
and wobject.pageId = page.pageId
and wobject.startDate < $now

View file

@ -49,8 +49,8 @@ sub _traversePageTree {
"page.title" => $data->{title},
"page.menuTitle" => $data->{menuTitle},
"page.synopsis" => $data->{synopsis},
"page.isRoot" => ($parent eq '0'),
"page.isTop" => ($currentDepth == 0 || ($currentDepth == 1 && $parent eq '0'))
"page.isRoot" => ($parent eq "0"),
"page.isTop" => ($currentDepth == 0 || ($currentDepth == 1 && $parent eq "0"))
});
push(@pages,@{_traversePageTree($data->{pageId},($currentDepth+1),$depth,$indent,$alphabetic)});
}

View file

@ -1050,7 +1050,7 @@ sub www_viewStatisticalOverview {
$var->{title} = WebGUI::International::get(58,$self->get("namespace"));
my $p = WebGUI::Paginator->new(WebGUI::URL::page('func=viewStatisticalOverview&wid='.$self->get("wobjectId")));
$p->setDataByQuery("select Survey_questionId,question,answerFieldType,allowComment from Survey_question
where Survey_id=".$self->get("Survey_id")." order by sequenceNumber");
where Survey_id=".quote($self->get("Survey_id"))." order by sequenceNumber");
my $questions = $p->getPageData;
my @questionloop;
$var->{'answer.label'} = WebGUI::International::get(19,$self->get("namespace"));

View file

@ -227,7 +227,12 @@ sub purge {
$forum->purge;
}
my $page = WebGUI::Page->new($pageId);
$page->purge;
if (defined $page) {
$page->purge;
} else {
WebGUI::ErrorHandler::warn("Submission ".$submissionId."
of USS ".$_[0]->get("USS_id")." didn't have real page attached to it. This could be a minor problem caused by a bug of old, or it could indicate major data corruption issues.");
}
}
$sth->finish;
WebGUI::SQL->write("delete from USS_submission where USS_id=".quote($_[0]->get("USS_id")));
@ -266,7 +271,7 @@ sub www_approveSubmission {
WebGUI::MessageLog::addInternationalizedEntry($submission{userId},'',WebGUI::URL::page('func=viewSubmission&wid='.
$session{form}{wid}.'&sid='.$session{form}{sid}),4,$self->get("namespace"));
WebGUI::MessageLog::completeEntry($session{form}{mlog});
$self->deleteCachedSubmission;
$self->deleteCachedSubmission($session{form}{sid});
return WebGUI::Operation::www_viewMessageLog();
} else {
return WebGUI::Privilege::insufficient();
@ -288,7 +293,7 @@ sub www_deleteFile {
$session{form}{file}=>'',
USS_submissionId=>$session{form}{sid}
},0,0);
$self->deleteCachedSubmission;
$self->deleteCachedSubmission($session{form}{sid});
return $self->www_editSubmission();
} else {
return WebGUI::Privilege::insufficient();
@ -319,7 +324,7 @@ sub www_deleteSubmissionConfirm {
}
my $page = WebGUI::Page->new($pageId);
$page->purge;
$self->deleteCachedSubmission;
$self->deleteCachedSubmission($session{form}{sid});
$self->deleteCollateral("USS_submission","USS_submissionId",$session{form}{sid});
my $file = WebGUI::Attachment->new("",$session{form}{wid},$session{form}{sid});
$file->deleteNode;
@ -340,7 +345,7 @@ sub www_denySubmission {
WebGUI::MessageLog::addInternationalizedEntry($submission{userId},'',WebGUI::URL::page('func=viewSubmission&wid='.
$session{form}{wid}.'&sid='.$session{form}{sid}),5,$self->get("namespace"));
WebGUI::MessageLog::completeEntry($session{form}{mlog});
$self->deleteCachedSubmission;
$self->deleteCachedSubmission($session{form}{sid});
return WebGUI::Operation::www_viewMessageLog();
} else {
return WebGUI::Privilege::insufficient();
@ -656,6 +661,7 @@ sub www_editSubmissionSave {
$pageVars{subroutinePackage} = "WebGUI::Wobject::USS";
$pageVars{subroutineParams} = "{wobjectId=>'".$_[0]->wid."',submissionId=>'".$session{form}{sid}."'}";
$pageVars{urlizedTitle} .= "/".$_[0]->get("title")."/".$session{form}{title};
$pageVars{urlizedTitle} .= ".".$session{setting}{urlExtension} unless ($pageVars{urlizedTitle} =~ /\./ && $session{setting}{urlExtension} ne "");
$pageVars{urlizedTitle} = WebGUI::Page::makeUnique(WebGUI::URL::urlize($pageVars{urlizedTitle},-999));
$newPage->set(\%pageVars);
%hash = ();
@ -693,7 +699,7 @@ sub www_editSubmissionSave {
my $page = WebGUI::Page->new($submission->{pageId});
$page->set(\%pageVars);
$_[0]->setCollateral("USS_submission", "USS_submissionId", \%hash, 1, 0, "USS_id", $_[0]->get("USS_id"));
$_[0]->deleteCachedSubmission;
$_[0]->deleteCachedSubmission($hash{USS_submissionId});
return $_[0]->www_viewSubmission();
} else {
return WebGUI::Privilege::insufficient();

View file

@ -469,11 +469,6 @@ The URL of the web site for this theme's designer. If you are in the business of
lastUpdated => 1050264990
},
'495' => {
message => q|htmlArea (Internet Explorer 5.5+)|,
lastUpdated => 1044704928
},
'859' => {
message => q|Signature|,
lastUpdated => 1043879866
@ -555,7 +550,7 @@ The URL of the web site for this theme's designer. If you are in the business of
},
'49' => {
message => q|Click <a href="^\;?op=logout">here</a> to log out.|,
message => q|Click here to log out.|,
lastUpdated => 1031514049
},
@ -2132,7 +2127,7 @@ Displays a small text message to the user if they belong to the specified group.
<i>Example:</i> &#94;GroupText("Visitors","You need an account to do anything cool on this site!","We value our registered users!");
<p>
<b>&#94;L; or &#94;L(); - Login Box</b><br>
A small login form. This macro takes up to three parameters. The first is used to set the width of the login box: &#94;L(20);. The second sets the message displayed after the user is logged in: &#94;L(20,"Hi &#94;a(&#94;@;);. Click %here% if you wanna log out!");. Text between percent signs (%) is replaced by a link to the logout operation. The third parameter is the name of a template in the Macro/L_loginBox namespace to replace the default template. The variables below are
A small login form. This macro takes up to three parameters. The first is used to set the width of the login box: &#94;L(20);. The second sets the message displayed after the user is logged in: &#94;L(20,"Hi &#94;a(&#94;@;);. Click %here% if you wanna log out!");. Text between percent signs (%) is replaced by a link to the logout operation. The third parameter is the ID of a template in the Macro/L_loginBox namespace to replace the default template. The variables below are
available in the template. Not all of them are required, but variables that will cause the macro to output code that doesn't function properly (like not actually log someone in) are marked with an asterisk '*'
<p/>
<b>user.isVisitor</b><br/>
@ -2474,13 +2469,17 @@ Choose which group can view this page. If you want both visitors and registered
Choose the group that can edit this page. The group assigned editing rights can also always view the page.
<p>
<b>Wobject privileges?</b><br>
Allows content managers to specify view/edit privileges on a per wobject basis rather than relying on the privileges on the page.
<p>
You can optionally recursively give these privileges to all pages under this page.
<p>
<b>What next?</b><br/>
If you leave this on the default setting you'll be redirected to the new page after creating it.
<p/>|,
lastUpdated => 1096433872
lastUpdated => 1099004008
},
'60' => {
@ -2829,11 +2828,6 @@ Select which host to use by default when generating URLs. Config Sitename will u
lastUpdated => 1031514049
},
'887' => {
message => q|Midas (Mozilla 1.3+)|,
lastUpdated => 1047342950
},
'26' => {
message => q|December|,
lastUpdated => 1031514049
@ -6533,11 +6527,6 @@ Create your template by using template commands and variables, macros, and HTML.
lastUpdated => 1031514049
},
'494' => {
message => q|RealObjects edit-on Pro 2.x|,
lastUpdated => 1044704984
},
'873' => {
message => q|Subscribe to thread|,
lastUpdated => 1065876827
@ -7442,8 +7431,8 @@ config file.</p>
lastUpdated =>1092748557,
context => q|Label for Forum Settings|
},
'HTMLArea 3' => {
message => q|HTMLArea 3 (IE, mozilla)|,
'tinymce' => {
message => q|TinyMCE (IE, mozilla)|,
lastUpdated =>1092748557,
context => q|option for Rich Editor in profile|
},