WebGUI 3.5.0 release

This commit is contained in:
JT Smith 2002-03-15 01:30:00 +00:00
parent 6633adf10d
commit 0df316d3f0
25 changed files with 599 additions and 158 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
package WebGUI;
our $VERSION = "3.4.1";
our $VERSION = "3.5.0";
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2002 Plain Black Software.

View file

@ -62,7 +62,7 @@ sub _createThumbnail {
if (isIn($_[0]->getType, qw(jpg jpeg gif png tif tiff bmp))) {
$image = Image::Magick->new;
$error = $image->Read($_[0]->getPath);
WebGUI::ErrorHandler::warning($error) if $error;
WebGUI::ErrorHandler::warn($error) if $error;
($x, $y) = $image->Get('width','height');
$n = $_[1] || $session{setting}{thumbnailSize};
$r = $x>$y ? $x / $n : $y / $n;

View file

@ -123,7 +123,9 @@ sub getMessage {
my (%message);
tie %message, 'Tie::CPHash';
%message = WebGUI::SQL->quickHash("select * from discussion where messageId='$_[0]'");
$message{message} =~ s/\n/\<br\>/g;
unless ($message{message} =~ /\<div\>/ig || $message{message} =~ /\<br\>/ig || $message{message} =~ /\<p\>/ig) {
$message{message} =~ s/\n/\<br\>/g;
}
return %message;
}

View file

@ -21,13 +21,13 @@ use WebGUI::URL;
sub _recurseCrumbTrail {
my ($sth, %data, $output);
tie %data, 'Tie::CPHash';
%data = WebGUI::SQL->quickHash("select pageId,parentId,title,urlizedTitle from page where pageId=$_[0]");
%data = WebGUI::SQL->quickHash("select pageId,parentId,menuTitle,urlizedTitle from page where pageId=$_[0]");
if ($data{pageId} > 1) {
$output .= _recurseCrumbTrail($data{parentId},$_[1]);
}
if ($data{title} ne "") {
$output .= '<a class="crumbTrail" href="'.WebGUI::URL::gateway($data{urlizedTitle})
.'">'.$data{title}.'</a>'.$_[1];
.'">'.$data{menuTitle}.'</a>'.$_[1];
}
return $output;
}

View file

@ -30,7 +30,7 @@ sub _replacement {
sub _reversePageTree {
my ($sth, @data, $output, $parentId);
($parentId) = WebGUI::SQL->quickArray("select parentId from page where pageId='$_[0]'");
$sth = WebGUI::SQL->read("select pageId,parentId,title,urlizedTitle from page where parentId=$_[0] order by sequenceNumber");
$sth = WebGUI::SQL->read("select pageId,parentId,menuTitle,urlizedTitle from page where parentId=$_[0] order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[0])) {
if ($_[1] == $data[0]) {

View file

@ -19,13 +19,16 @@ use WebGUI::Session;
sub _replacement {
my (@param, $temp);
@param = WebGUI::Macro::getParams($1);
$temp = '<a class="homeLink" href="'.WebGUI::URL::gateway('home').'">';
if ($param[0] ne "") {
$temp .= $param[0];
} else {
$temp .= WebGUI::International::get(47);
}
$temp .= '</a>';
$temp = WebGUI::URL::gateway('home');
if ($param[0] ne "linkonly") {
$temp = '<a class="homeLink" href="'.$temp.'">';
if ($param[0] ne "") {
$temp .= $param[0];
} else {
$temp .= WebGUI::International::get(47);
}
$temp .= '</a>';
}
return $temp;
}

View file

@ -37,7 +37,7 @@ sub traversePageTree {
$depth .= "&nbsp;&nbsp;&nbsp;";
}
if ($_[1] < $toLevel) {
$sth = WebGUI::SQL->read("select urlizedTitle, title, pageId from page where parentId='$_[0]' order by sequenceNumber");
$sth = WebGUI::SQL->read("select urlizedTitle, menuTitle, pageId from page where parentId='$_[0]' order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
$output .= $depth.'<a class="verticalMenu" href="'.

View file

@ -20,13 +20,16 @@ use WebGUI::URL;
sub _replacement {
my (@param, $temp);
@param = WebGUI::Macro::getParams($_[0]);
$temp = '<a class="myAccountLink" href="'.WebGUI::URL::page('op=displayAccount').'">';
if ($param[0] ne "") {
$temp .= $param[0];
} else {
$temp .= WebGUI::International::get(46);
}
$temp .= '</a>';
$temp = WebGUI::URL::page('op=displayAccount');
if ($param[0] ne "linkonly") {
$temp = '<a class="myAccountLink" href="'.$temp.'">';
if ($param[0] ne "") {
$temp .= $param[0];
} else {
$temp .= WebGUI::International::get(46);
}
$temp .= '</a>';
}
return $temp;
}

View file

@ -28,7 +28,7 @@ sub _replacement {
}
$temp = '<span class="horizontalMenu">';
$first = 1;
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=$session{page}{pageId} order by sequenceNumber");
$sth = WebGUI::SQL->read("select menuTitle,urlizedTitle,pageId from page where parentId=$session{page}{pageId} order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
if ($first) {

View file

@ -28,7 +28,7 @@ sub _replacement {
}
$temp = '<span class="horizontalMenu">';
$first = 1;
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=$session{page}{parentId} order by sequenceNumber");
$sth = WebGUI::SQL->read("select menuTitle,urlizedTitle,pageId from page where parentId=$session{page}{parentId} order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
if ($first) {

View file

@ -22,13 +22,15 @@ sub _replacement {
my ($temp, @param);
@param = WebGUI::Macro::getParams($_[0]);
$temp = WebGUI::URL::append($session{env}{REQUEST_URI},'makePrintable=1');
$temp = '<a class="makePrintableLink" href="'.$temp.'">';
if ($param[0] ne "") {
$temp .= $param[0];
} else {
$temp .= WebGUI::International::get(53);
}
$temp .= '</a>';
if ($param[0] ne "linkonly") {
$temp = '<a class="makePrintableLink" href="'.$temp.'">';
if ($param[0] ne "") {
$temp .= $param[0];
} else {
$temp .= WebGUI::International::get(53);
}
$temp .= '</a>';
}
return $temp;
}

View file

@ -30,7 +30,7 @@ sub _replacement {
$temp = '<span class="horizontalMenu">';
$first = 1;
($parentId) = WebGUI::SQL->quickArray("select pageId from page where urlizedTitle='$param[0]'");
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId='$parentId' order by sequenceNumber");
$sth = WebGUI::SQL->read("select menuTitle,urlizedTitle,pageId from page where parentId='$parentId' order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
if ($first) {

View file

@ -27,7 +27,7 @@ sub _replacement {
}
$temp = '<span class="horizontalMenu">';
$first = 1;
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=1 order by sequenceNumber");
$sth = WebGUI::SQL->read("select menuTitle,urlizedTitle,pageId from page where parentId=1 order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
if ($first) {

View file

@ -46,7 +46,7 @@ sub _recursePageTree {
while (($test) = WebGUI::SQL->quickArray("select urlizedTitle from page where urlizedTitle='$urlizedTitle'")) {
$urlizedTitle .= 2;
}
WebGUI::SQL->write("insert into page values ($newPageId,$_[1],".quote($package{title}).",$newParent{styleId},$session{user}{userId},$newParent{ownerView},$newParent{ownerEdit},$newParent{groupId},$newParent{groupView},$newParent{groupEdit},$newParent{worldView},$newParent{worldEdit},$package{sequenceNumber},".quote($package{metaTags}).",".quote($urlizedTitle).",$package{defaultMetaTags},".quote($package{template}).")");
WebGUI::SQL->write("insert into page values ($newPageId,$_[1],".quote($package{title}).",$newParent{styleId},$session{user}{userId},$newParent{ownerView},$newParent{ownerEdit},$newParent{groupId},$newParent{groupView},$newParent{groupEdit},$newParent{worldView},$newParent{worldEdit},$package{sequenceNumber},".quote($package{metaTags}).",".quote($urlizedTitle).",$package{defaultMetaTags},".quote($package{template}).",".quote($package{menuTitle}).",".quote($package{synopsis}).")");
_recursePageTree($package{pageId},$newPageId);
}
$a->finish;

View file

@ -71,12 +71,18 @@ sub www_addPage {
$output .= WebGUI::Form::hidden("root","1");
}
$output .= '<table>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,$session{form}{title}));
$output .= tableFormRow(WebGUI::International::get(99),
WebGUI::Form::text("title",20,128,$session{form}{title}));
$output .= tableFormRow(WebGUI::International::get(411),
WebGUI::Form::text("menuTitle",20,128,$session{form}{menuTitle}));
%hash = sortHash(WebGUI::Template::getList());
$array[0] = "Default";
$output .= '<script language="JavaScript"> function updateTemplateImage(template) { document.template.src = "'.$session{setting}{lib}.'/templates/"+template+".gif"; } </script>';
$output .= tableFormRow(WebGUI::International::get(356),WebGUI::Form::selectList("template",\%hash, \@array, 1, 0, "updateTemplateImage(this.form.template.value)").'<br><img src="'.$session{setting}{lib}.'/templates/Default.gif" name="template">');
$output .= tableFormRow(WebGUI::International::get(100),WebGUI::Form::textArea("metaTags",$session{form}{metaTags}));
$output .= tableFormRow(WebGUI::International::get(412),
WebGUI::Form::textArea("synopsis",$session{form}{synopsis}));
$output .= tableFormRow(WebGUI::International::get(100),
WebGUI::Form::textArea("metaTags",$session{form}{metaTags}));
$output .= tableFormRow(WebGUI::International::get(307),WebGUI::Form::checkbox("defaultMetaTags",1,1));
$output .= formSave();
$output .= '</table></form>';
@ -88,7 +94,7 @@ sub www_addPage {
#-------------------------------------------------------------------
sub www_addPageSave {
my ($urlizedTitle, $test, $nextSeq, $parentId);
my ($urlizedTitle, $test, $nextSeq, $parentId, $menuTitle);
if (WebGUI::Privilege::canEditPage()) {
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from page where parentId=$session{page}{pageId}");
if ($session{form}{title} eq "") {
@ -99,11 +105,16 @@ sub www_addPageSave {
} else {
$parentId = $session{page}{pageId};
}
if ($session{form}{menuTitle} eq "") {
$menuTitle = $session{form}{title};
} else {
$menuTitle = $session{form}{menuTitle};
}
$urlizedTitle = WebGUI::URL::urlize($session{form}{title});
while (($test) = WebGUI::SQL->quickArray("select urlizedTitle from page where urlizedTitle='$urlizedTitle'")) {
$urlizedTitle .= 2;
}
WebGUI::SQL->write("insert into page values (".getNextId("pageId").", $parentId, ".quote($session{form}{title}).", $session{page}{styleId}, $session{user}{userId}, $session{page}{ownerView}, $session{page}{ownerEdit}, $session{page}{groupId}, $session{page}{groupView}, $session{page}{groupEdit}, $session{page}{worldView}, $session{page}{worldEdit}, '$nextSeq', ".quote($session{form}{metaTags}).", '$urlizedTitle', '$session{form}{defaultMetaTags}', '$session{form}{template}')");
WebGUI::SQL->write("insert into page values (".getNextId("pageId").", $parentId, ".quote($session{form}{title}).", $session{page}{styleId}, $session{user}{userId}, $session{page}{ownerView}, $session{page}{ownerEdit}, $session{page}{groupId}, $session{page}{groupView}, $session{page}{groupEdit}, $session{page}{worldView}, $session{page}{worldEdit}, '$nextSeq', ".quote($session{form}{metaTags}).", '$urlizedTitle', '$session{form}{defaultMetaTags}', '$session{form}{template}', ".quote($menuTitle).", ".quote($session{form}{synopsis}).")");
return "";
} else {
return WebGUI::Privilege::insufficient();
@ -171,6 +182,8 @@ sub www_editPage {
$output .= '<tr><td colspan=2><b>'.WebGUI::International::get(103).'</b></td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),
WebGUI::Form::text("title",20,128,$session{page}{title}));
$output .= tableFormRow(WebGUI::International::get(411),
WebGUI::Form::text("menuTitle",20,128,$session{page}{menuTitle}));
$output .= tableFormRow(WebGUI::International::get(104),
WebGUI::Form::text("urlizedTitle",20,128,$session{page}{urlizedTitle}));
%hash = sortHash(WebGUI::Template::getList());
@ -178,6 +191,7 @@ sub www_editPage {
$output .= '<script language="JavaScript"> function updateTemplateImage(template) { document.template.src = "'.$session{setting}{lib}.'/templates/"+template+".gif"; } </script>';
$output .= tableFormRow(WebGUI::International::get(356),
WebGUI::Form::selectList("template",\%hash,\@array,1,0,"updateTemplateImage(this.form.template.value)").'<br><img src="'.$session{setting}{lib}.'/templates/'.$session{page}{template}.'.gif" name="template">');
$output .= tableFormRow(WebGUI::International::get(412),WebGUI::Form::textArea("synopsis",$session{page}{synopsis}));
$output .= tableFormRow(WebGUI::International::get(100),WebGUI::Form::textArea("metaTags",$session{page}{metaTags}));
$output .= tableFormRow(WebGUI::International::get(307),WebGUI::Form::checkbox("defaultMetaTags",1,$session{page}{defaultMetaTags}));
$output .= '<tr><td colspan=2><hr size=1><b>'.WebGUI::International::get(105).'</b></td></tr>';
@ -235,7 +249,7 @@ sub www_editPageSave {
while (($test) = WebGUI::SQL->quickArray("select urlizedTitle from page where urlizedTitle='$urlizedTitle' and pageId<>$session{page}{pageId}")) {
$urlizedTitle .= 2;
}
WebGUI::SQL->write("update page set title=".quote($session{form}{title}).", styleId=$session{form}{styleId}, ownerId=$session{form}{ownerId}, ownerView=$session{form}{ownerView}, ownerEdit=$session{form}{ownerEdit}, groupId='$session{form}{groupId}', groupView=$session{form}{groupView}, groupEdit=$session{form}{groupEdit}, worldView=$session{form}{worldView}, worldEdit=$session{form}{worldEdit}, metaTags=".quote($session{form}{metaTags}).", urlizedTitle='$urlizedTitle', defaultMetaTags='$session{form}{defaultMetaTags}', template='$session{form}{template}' where pageId=$session{page}{pageId}");
WebGUI::SQL->write("update page set title=".quote($session{form}{title}).", styleId=$session{form}{styleId}, ownerId=$session{form}{ownerId}, ownerView=$session{form}{ownerView}, ownerEdit=$session{form}{ownerEdit}, groupId='$session{form}{groupId}', groupView=$session{form}{groupView}, groupEdit=$session{form}{groupEdit}, worldView=$session{form}{worldView}, worldEdit=$session{form}{worldEdit}, metaTags=".quote($session{form}{metaTags}).", urlizedTitle='$urlizedTitle', defaultMetaTags='$session{form}{defaultMetaTags}', template='$session{form}{template}', menuTitle=".quote($session{form}{menuTitle}).", synopsis=".quote($session{form}{synopsis})." where pageId=$session{page}{pageId}");
if ($session{form}{recurseStyle} eq "yes") {
_recursivelyChangeStyle($session{page}{pageId});
}

View file

@ -142,6 +142,32 @@ sub buildHash {
}
#-------------------------------------------------------------------
=head2 errorCode {
Returns an error code for the current handler.
=cut
sub errorCode {
return $_[0]->{_sth}->err;
}
#-------------------------------------------------------------------
=head2 errorMessage {
Returns a text error message for the current handler.
=cut
sub errorMessage {
return $_[0]->{_sth}->errstr;
}
#-------------------------------------------------------------------
=head2 finish ( )

View file

@ -41,7 +41,10 @@ sub getStyle {
.$style{styleSheet}
.$session{page}{metaTags};
if ($session{page}{defaultMetaTags}) {
$header .= '<meta http-equiv="Keywords" name="Keywords" content="'.$session{page}{title}.', '.$session{setting}{companyName}.'">';
$header .= '<meta http-equiv="Keywords" name="Keywords" content="'.
$session{page}{title}.', '.$session{setting}{companyName}.'">';
$header .= '<meta http-equiv="Description" name="Description" content="'.
$session{page}{synopsis}.'">';
}
$header .= '</head>'.$style{header};
$footer = $style{footer}.'

View file

@ -16,6 +16,7 @@ use strict;
use Tie::CPHash;
use WebGUI::Attachment;
use WebGUI::DateTime;
use WebGUI::Discussion;
use WebGUI::International;
use WebGUI::Macro;
use WebGUI::Privilege;
@ -25,6 +26,31 @@ use WebGUI::SQL;
use WebGUI::URL;
use WebGUI::Widget;
#-------------------------------------------------------------------
sub _showReplies {
my ($sth, @data, $html, %board);
tie %board, 'Tie::CPHash';
%board = getProperties($namespace,$session{form}{wid});
$html .= '<table border=0 cellpadding=2 cellspacing=1 width="100%">';
$html .= '<tr><td class="tableHeader">'.WebGUI::International::get(229).'</td><td class="tableHeader">'.WebGUI::International::get(22,$namespace).'</td><td class="tableHeader">'.WebGUI::International::get(23,$namespace).'</td></tr>';
$sth = WebGUI::SQL->read("select messageId,subject,username,dateOfPost,userId from discussion where widgetId=$session{form}{wid} and pid=0 order by messageId desc");
while (@data = $sth->array) {
$html .= '<tr';
if ($data[0] == $session{form}{mid}) {
$html .= ' class="highlight"';
}
$html .= '><td class="tableData"><a href="'.WebGUI::URL::page('func=showMessage&mid='.
$data[0].'&wid='.$session{form}{wid}).'">'.substr($data[1],0,30).
'</a></td><td class="tableData"><a href="'.
WebGUI::URL::page('op=viewProfile&uid='.$data[4]).'">'.$data[2].
'</a></td><td class="tableData">'.epochToHuman($data[3],"%M/%D %H:%n%p").
'</td></tr>';
$html .= WebGUI::Discussion::traverseReplyTree($data[0],1);
}
$html .= '</table>';
return $html;
}
#-------------------------------------------------------------------
sub duplicate {
my (%data, $newWidgetId, $pageId, $file);
@ -40,12 +66,14 @@ sub duplicate {
WebGUI::SQL->write("insert into Article values ($newWidgetId, $data{startDate}, $data{endDate}, ".
quote($data{body}).", ".quote($data{image}).", ".quote($data{linkTitle}).", ".
quote($data{linkURL}).", ".quote($data{attachment}).", '$data{convertCarriageReturns}', ".
quote($data{alignImage}).")");
quote($data{alignImage}).", $data{allowDiscussion}, $data{groupToPost}, $data{groupToModerate}, $data{editTimeout})");
WebGUI::Discussion::duplicate($_[0],$newWidgetId);
}
#-------------------------------------------------------------------
sub purge {
purgeWidget($_[0],$_[1],$namespace);
WebGUI::Discussion::purgeWidget($_[0],$_[1]);
}
#-------------------------------------------------------------------
@ -85,6 +113,14 @@ sub www_add {
$output .= tableFormRow(WebGUI::International::get(8,$namespace),WebGUI::Form::text("linkURL",20,2048));
$output .= tableFormRow(WebGUI::International::get(9,$namespace),WebGUI::Form::file("attachment"));
$output .= tableFormRow(WebGUI::International::get(10,$namespace),WebGUI::Form::checkbox("convertCarriageReturns",1).' <span style="font-size: 8pt;">'.WebGUI::International::get(11,$namespace).'</span>');
$output .= tableFormRow(WebGUI::International::get(18,$namespace),
WebGUI::Form::checkbox("allowDiscussion",1));
$output .= tableFormRow(WebGUI::International::get(19,$namespace),
WebGUI::Form::groupList("groupToPost",2));
$output .= tableFormRow(WebGUI::International::get(20,$namespace),
WebGUI::Form::groupList("groupToModerate",4));
$output .= tableFormRow(WebGUI::International::get(21,$namespace),
WebGUI::Form::text("editTimeout",20,3,1));
$output .= formSave();
$output .= '</table></form>';
return $output;
@ -115,7 +151,12 @@ sub www_addSave {
quote($session{form}{linkURL}).", ".
quote($attachment->getFilename).
", '$session{form}{convertCarriageReturns}', ".
quote($session{form}{alignImage}).")");
quote($session{form}{alignImage}).", ".
"'$session{form}{allowDiscussion}', ".
"'$session{form}{groupToPost}', ".
"'$session{form}{groupToModerate}', ".
"'$session{form}{editTimeout}' ".
")");
return "";
} else {
return WebGUI::Privilege::insufficient();
@ -152,6 +193,36 @@ sub www_deleteImage {
}
}
#-------------------------------------------------------------------
sub www_deleteMessage {
my (%board, %message);
tie %board, 'Tie::CPHash';
tie %message, 'Tie::CPHash';
%board = getProperties($namespace,$session{form}{wid});
%message = WebGUI::Discussion::getMessage($session{form}{mid});
if ((time()-$message{dateOfPost}) < 3600*$board{editTimeout} && $message{userId} eq $session{user}{userId} ||
WebGUI::Privilege::isInGroup($board{groupToModerate})) {
return WebGUI::Discussion::deleteMessage();
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_deleteMessageConfirm {
my (%board,%message);
tie %board, 'Tie::CPHash';
tie %message, 'Tie::CPHash';
%board = getProperties($namespace,$session{form}{wid});
%message = WebGUI::Discussion::getMessage($session{form}{mid});
if ((time()-$message{dateOfPost}) < 3600*$board{editTimeout} && $message{userId} eq $session{user}{userId} ||
WebGUI::Privilege::isInGroup($board{groupToModerate})) {
return WebGUI::Discussion::deleteMessageConfirm();
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_edit {
my ($output, %data, %hash, @array);
@ -211,6 +282,14 @@ sub www_edit {
$output .= tableFormRow(WebGUI::International::get(10,$namespace),
WebGUI::Form::checkbox("convertCarriageReturns",1,$data{convertCarriageReturns}).
' <span style="font-size: 8pt;">'.WebGUI::International::get(11,$namespace).'</span>');
$output .= tableFormRow(WebGUI::International::get(18,$namespace),
WebGUI::Form::checkbox("allowDiscussion","1",$data{allowDiscussion}));
$output .= tableFormRow(WebGUI::International::get(19,$namespace),
WebGUI::Form::groupList("groupToPost",$data{groupToPost}));
$output .= tableFormRow(WebGUI::International::get(20,$namespace),
WebGUI::Form::groupList("groupToModerate",$data{groupToModerate}));
$output .= tableFormRow(WebGUI::International::get(22,$namespace),
WebGUI::Form::text("editTimeout",20,2,$data{editTimeout}));
$output .= formSave();
$output .= '</table></form>';
return $output;
@ -240,7 +319,10 @@ sub www_editSave {
"', convertCarriageReturns='$session{form}{convertCarriageReturns}', body=".
quote($session{form}{body}).", linkTitle=".
quote($session{form}{linkTitle}).", linkURL=".
quote($session{form}{linkURL}).$sqlAdd.
quote($session{form}{linkURL}).", allowDiscussion='$session{form}{allowDiscussion}',".
"groupToModerate='$session{form}{groupToModerate}', groupToPost='$session{form}{groupToPost}'".
", editTimeout='$session{form}{editTimeout}'".
$sqlAdd.
" where widgetId=$session{form}{wid}");
return "";
} else {
@ -248,9 +330,129 @@ sub www_editSave {
}
}
#-------------------------------------------------------------------
sub www_editMessage {
my (%board,%message);
tie %board, 'Tie::CPHash';
tie %message, 'Tie::CPHash';
%board = getProperties($namespace,$session{form}{wid});
%message = WebGUI::Discussion::getMessage($session{form}{mid});
if ((time()-$message{dateOfPost}) < 3600*$board{editTimeout} && $message{userId} eq $session{user}{userId} ||
WebGUI::Privilege::isInGroup($board{groupToModerate})) {
return WebGUI::Discussion::editMessage();
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_editMessageSave {
my (%board,%message);
tie %board, 'Tie::CPHash';
tie %message, 'Tie::CPHash';
%board = getProperties($namespace,$session{form}{wid});
%message = WebGUI::Discussion::getMessage($session{form}{mid});
if ((time()-$message{dateOfPost}) < 3600*$board{editTimeout} && $message{userId} eq $session{user}{userId} ||
WebGUI::Privilege::isInGroup($board{groupToModerate})) {
WebGUI::Discussion::editMessageSave();
return www_showMessage();
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_postNewMessage {
my (%board);
tie %board, 'Tie::CPHash';
%board = getProperties($namespace,$session{form}{wid});
if (WebGUI::Privilege::isInGroup($board{groupToPost},$session{user}{userId})) {
return WebGUI::Discussion::postNewMessage();
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_postNewMessageSave {
my (%board);
tie %board, 'Tie::CPHash';
%board = getProperties($namespace,$session{form}{wid});
if (WebGUI::Privilege::isInGroup($board{groupToPost},$session{user}{userId})) {
return WebGUI::Discussion::postNewMessageSave();
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_postReply {
my (%board);
tie %board, 'Tie::CPHash';
%board = getProperties($namespace,$session{form}{wid});
if (WebGUI::Privilege::isInGroup($board{groupToPost},$session{user}{userId})) {
return WebGUI::Discussion::postReply();
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_postReplySave {
my (%board);
tie %board, 'Tie::CPHash';
%board = getProperties($namespace,$session{form}{wid});
if (WebGUI::Privilege::isInGroup($board{groupToPost},$session{user}{userId})) {
WebGUI::Discussion::postReplySave();
return www_showMessage();
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_showMessage {
my (@data, $html, %board, %message, $defaultMid);
tie %message, 'Tie::CPHash';
tie %board, 'Tie::CPHash';
($defaultMid) = WebGUI::SQL->quickArray("select min(messageId) from discussion where widgetId=$session{form}{wid}");
$session{form}{mid} = $defaultMid if ($session{form}{mid} eq "");
%message = WebGUI::Discussion::getMessage($session{form}{mid});
%board = getProperties($namespace,$session{form}{wid});
if ($message{messageId}) {
$html .= '<h1>'.$message{subject}.'</h1>';
$html .= '<table width="100%" cellpadding=3 cellspacing=1 border=0><tr><td class="tableHeader">';
$html .= '<b>'.WebGUI::International::get(22,$namespace).'</b> <a href="'.
WebGUI::URL::page('op=viewProfile&uid='.$message{userId}).'">'.$message{username}.'</a><br>';
$html .= "<b>".WebGUI::International::get(23,$namespace)."</b> ".
epochToHuman($message{dateOfPost},"%w, %c %D, %y at %H:%n%p")."<br>";
$html .= '</td>';
$html .= '<td rowspan=2 valign="top" class="tableMenu" nowrap>';
$html .= '<a href="'.WebGUI::URL::page('func=postReply&mid='.$session{form}{mid}.
'&wid='.$session{form}{wid})
.'">'.WebGUI::International::get(24,$namespace).'</a><br>';
if ((time()-$message{dateOfPost}) < 3600*$board{editTimeout} &&
$message{userId} eq $session{user}{userId} ||
WebGUI::Privilege::isInGroup($board{groupToModerate})) {
$html .= '<a href="'.WebGUI::URL::page('func=editMessage&mid='.$session{form}{mid}.
'&wid='.$session{form}{wid}).'">'.WebGUI::International::get(25,$namespace).'</a><br>';
$html .= '<a href="'.WebGUI::URL::page('func=deleteMessage&mid='.$session{form}{mid}.
'&wid='.$session{form}{wid}).'">'.WebGUI::International::get(26,$namespace).'</a><br>';
}
$html .= '<a href="'.WebGUI::URL::page().'">'.WebGUI::International::get(27,$namespace).'</a><br>';
$html .= '</tr><tr><td class="tableData">';
$html .= $message{message};
$html .= '</td></tr></table>';
$html .= _showReplies();
} else {
$html = WebGUI::International::get(402);
}
return $html;
}
#-------------------------------------------------------------------
sub www_view {
my (%data, @test, $output, $image);
my (%data, @test, $output, $image, $replies);
tie %data, 'Tie::CPHash';
%data = getProperties($namespace,$_[0]);
if ($data{startDate}<time() && $data{endDate}>time()) {
@ -281,9 +483,20 @@ sub www_view {
$output .= attachmentBox($data{attachment},$_[0]);
}
}
if ($data{processMacros} == 1) {
if ($data{processMacros}) {
$output = WebGUI::Macro::process($output);
}
if ($data{allowDiscussion}) {
($replies) = WebGUI::SQL->quickArray("select count(*) from discussion where widgetId=$_[0]");
$output .= '<p><table width="100%" cellspacing="2" cellpadding="1" border="0">';
$output .= '<tr><td align="center" width="50%" class="tableMenu"><a href="'.
WebGUI::URL::page('func=showMessage&wid='.$_[0]).'">'.
WebGUI::International::get(28,$namespace).' ('.$replies.')</a></td>';
$output .= '<td align="center" width="50%" class="tableMenu"><a href="'.
WebGUI::URL::page('func=postNewMessage&wid='.$_[0]).'">'.
WebGUI::International::get(24,$namespace).'</a></td></tr>';
$output .= '</table>';
}
return $output;
}

View file

@ -30,6 +30,7 @@ use WebGUI::Widget;
#-------------------------------------------------------------------
sub _calendarLayout {
my ($thisMonth, $calendar, $message, $start, $end, $sth, %event, $nextDate);
tie %event, 'Tie::CPHash';
$thisMonth = epochToHuman($_[1],"%M %y");
$calendar = new HTML::CalendarMonthSimple('year'=>epochToHuman($_[1],"%y"),'month'=>epochToHuman($_[1],"%M"));
$calendar->width("100%");
@ -391,7 +392,10 @@ sub www_view {
($minDate) = WebGUI::SQL->quickArray("select min(startDate) from EventsCalendar_event where widgetId=$_[0]");
($maxDate) = WebGUI::SQL->quickArray("select max(endDate) from EventsCalendar_event where widgetId=$_[0]");
($junk, $maxDate) = WebGUI::DateTime::monthStartEnd($maxDate);
unless ($minDate && $maxDate) {
$minDate = time();
$maxDate = time()+86400;
}
if ($data{calendarLayout} eq "calendar") {
$nextDate = $minDate;
while ($nextDate <= $maxDate) {

View file

@ -113,10 +113,10 @@ sub www_addSave {
quote($session{form}{DSN}).", ".
quote($session{form}{username}).", ".
quote($session{form}{identifier}).", ".
quote($session{form}{convertCarriageReturns}).", ".
quote($session{form}{paginateAfter}).", ".
quote($session{form}{preprocessMacros}).", ".
quote($session{form}{debugMode}).
"'$session{form}{convertCarriageReturns}', ".
"'$session{form}{paginateAfter}', ".
"'$session{form}{preprocessMacros}', ".
"'$session{form}{debugMode}'".
")");
return "";
} else {
@ -192,13 +192,13 @@ sub www_editSave {
update();
WebGUI::SQL->write("update SQLReport set template=".quote($session{form}{template}).
", dbQuery=".quote($session{form}{dbQuery}).
", convertCarriageReturns=".quote($session{form}{convertCarriageReturns}).
", convertCarriageReturns='$session{form}{convertCarriageReturns}'".
", DSN=".quote($session{form}{DSN}).
", username=".quote($session{form}{username}).
", identifier=".quote($session{form}{identifier}).
", paginateAfter=".quote($session{form}{paginateAfter}).
", preprocessMacros=".quote($session{form}{preprocessMacros}).
", debugMode=".quote($session{form}{debugMode}).
", paginateAfter='$session{form}{paginateAfter}'".
", preprocessMacros='$session{form}{preprocessMacros}'".
", debugMode='$session{form}{debugMode}'".
" where widgetId=$session{form}{wid}");
return "";
} else {
@ -209,7 +209,7 @@ sub www_editSave {
#-------------------------------------------------------------------
sub www_view {
my (@row, $i, $p, $ouch, %data, $output, $sth, $dbh, @result,
@template, $temp, $col);
@template, $temp, $col, $errorMessage);
tie %data, 'Tie::CPHash';
%data = getProperties($namespace,$_[0]);
if (%data) {
@ -230,53 +230,57 @@ sub www_view {
WebGUI::ErrorHandler::warn("SQLReport [$_[0]] The DSN specified is of an improper format.");
}
if (defined $dbh) {
if ($data{dbQuery} =~ /select/i) {
if ($data{dbQuery} =~ /select/i || $data{dbQuery} =~ /show/i || $data{dbQuery} =~ /describe/i) {
$sth = WebGUI::SQL->unconditionalRead($data{dbQuery},$dbh);
} else {
$output .= WebGUI::International::get(10,$namespace).'<p>' if ($data{debugMode});
WebGUI::ErrorHandler::warn("SQLReport [$_[0]] The SQL query is improperly formatted.");
}
unless ($sth->array) {
$output .= WebGUI::International::get(11,$namespace).'<p>' if ($data{debugMode});
WebGUI::ErrorHandler::warn("There was a problem with the query.");
} else {
if ($data{template} ne "") {
@template = split(/\^\-\;/,$data{template});
unless ($sth->errorCode < 1) {
$errorMessage = $sth->errorMessage;
$output .= WebGUI::International::get(11,$namespace).' : '.
$errorMessage.'<p>' if ($data{debugMode});
WebGUI::ErrorHandler::warn("There was a problem with the query: ".
$errorMessage);
} else {
$i = 0;
$template[0] = '<table width="100%"><tr>';
$template[1] = '<tr>';
foreach $col ($sth->getColumnNames) {
$template[0] .= '<td class="tableHeader">'.$col.'</td>';
$template[1] .= '<td class="tableData">^'.$i.';</td>';
if ($data{template} ne "") {
@template = split(/\^\-\;/,$data{template});
} else {
$i = 0;
$template[0] = '<table width="100%"><tr>';
$template[1] = '<tr>';
foreach $col ($sth->getColumnNames) {
$template[0] .= '<td class="tableHeader">'.$col.'</td>';
$template[1] .= '<td class="tableData">^'.$i.';</td>';
$i++;
}
$template[0] .= '</tr>';
$template[1] .= '</tr>';
$template[2] = '</table>';
$i = 0;
}
$output .= $template[0];
while (@result = $sth->array) {
$temp = $template[1];
$temp =~ s/\^(\d*)\;/$result[$1]/g;
if ($data{convertCarriageReturns}) {
$temp =~ s/\n/\<br\>/g;
}
$row[$i] = $temp;
$i++;
}
$template[0] .= '</tr>';
$template[1] .= '</tr>';
$template[2] = '</table>';
$i = 0;
}
$output .= $template[0];
while (@result = $sth->array) {
$temp = $template[1];
$temp =~ s/\^(\d*)\;/$result[$1]/g;
if ($data{convertCarriageReturns}) {
$temp =~ s/\n/\<br\>/g;
if ($sth->rows < 1) {
$output .= $template[2];
$output .= WebGUI::International::get(18,$namespace).'<p>';
} else {
$p = WebGUI::Paginator->new(WebGUI::URL::page(),
\@row,$data{paginateAfter});
$output .= $p->getPage($session{form}{pn});
$output .= $template[2];
$output .= $p->getBar($session{form}{pn});
}
$row[$i] = $temp;
$i++;
$sth->finish;
}
if ($sth->rows < 1) {
$output .= $template[2];
$output .= WebGUI::International::get(18,$namespace).'<p>';
} else {
$p = WebGUI::Paginator->new(WebGUI::URL::page(),\@row,$data{paginateAfter});
$output .= $p->getPage($session{form}{pn});
$output .= $template[2];
$output .= $p->getBar($session{form}{pn});
}
$sth->finish;
}
} else {
$output .= WebGUI::International::get(10,$namespace).'<p>' if ($data{debugMode});
WebGUI::ErrorHandler::warn("SQLReport [$_[0]] The SQL query is improperly formatted.");
}
$dbh->disconnect();
} else {
$output .= WebGUI::International::get(12,$namespace).'<p>' if ($data{debugMode});

View file

@ -31,20 +31,23 @@ sub _traversePageTree {
} else {
$toLevel = 99;
}
for ($i=1;$i<=$_[1]*$_[3];$i++) {
for ($i=1;$i<=($_[1]*$_[3]);$i++) {
$depth .= "&nbsp;";
}
for ($i=1;$i<=$_[5];$i++) {
$lineSpacing .= "<br>";
}
if ($_[1] < $toLevel) {
$sth = WebGUI::SQL->read("select urlizedTitle, title, pageId from page where parentId='$_[0]' order by sequenceNumber");
$sth = WebGUI::SQL->read("select urlizedTitle, title, pageId, synopsis from page where parentId='$_[0]' order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
$output .= $depth.$_[4].' <a href="'.WebGUI::URL::gateway($data[0])
.'">'.$data[1].'</a>';
if ($data[3] ne "" && $_[6]) {
$output .= ' - '.$data[3];
}
$output .= $lineSpacing;
$output .= _traversePageTree($data[2],$_[1]+1,$_[2],$_[3],$_[4],$_[5]);
$output .= _traversePageTree($data[2],($_[1]+1),$_[2],$_[3],$_[4],$_[5],$_[6]);
}
}
$sth->finish;
@ -59,7 +62,7 @@ sub duplicate {
%data = getProperties($namespace,$_[0]);
$pageId = $_[1] || $data{pageId};
$newWidgetId = create($pageId,$namespace,$data{title},$data{displayTitle},$data{description},$data{processMacros},$data{templatePosition});
WebGUI::SQL->write("insert into SiteMap values ($newWidgetId, '$data{startAtThisLevel}', '$data{depth}', '$data{indent}', ".quote($data{bullet}).", '$data{lineSpacing}')");
WebGUI::SQL->write("insert into SiteMap values ($newWidgetId, '$data{startAtThisLevel}', '$data{depth}', '$data{indent}', ".quote($data{bullet}).", '$data{lineSpacing}', '$data{displaySynopsis}')");
}
#-------------------------------------------------------------------
@ -87,13 +90,19 @@ sub www_add {
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle",1,1));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros",1));
%hash = WebGUI::Widget::getPositions();
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("templatePosition",\%hash));
$output .= tableFormRow(WebGUI::International::get(363),
WebGUI::Form::selectList("templatePosition",\%hash));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",'',50,5,1));
$output .= tableFormRow(WebGUI::International::get(3,$namespace),WebGUI::Form::checkbox("startAtThisLevel",1,1));
$output .= tableFormRow(WebGUI::International::get(9,$namespace),
WebGUI::Form::checkbox("displaySynopsis",1,1));
$output .= tableFormRow(WebGUI::International::get(3,$namespace),
WebGUI::Form::checkbox("startAtThisLevel",1,1));
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::text("depth",20,2,0));
$output .= tableFormRow(WebGUI::International::get(6,$namespace),WebGUI::Form::text("indent",20,2,5));
$output .= tableFormRow(WebGUI::International::get(7,$namespace),WebGUI::Form::text("bullet",20,30,'&middot;'));
$output .= tableFormRow(WebGUI::International::get(8,$namespace),WebGUI::Form::text("lineSpacing",20,1,1));
$output .= tableFormRow(WebGUI::International::get(7,$namespace),
WebGUI::Form::text("bullet",20,30,'&middot;'));
$output .= tableFormRow(WebGUI::International::get(8,$namespace),
WebGUI::Form::text("lineSpacing",20,1,1));
$output .= formSave();
$output .= '</table></form>';
return $output;
@ -108,7 +117,7 @@ sub www_addSave {
my ($widgetId, $displayTitle, $image, $attachment);
if (WebGUI::Privilege::canEditPage()) {
$widgetId = create($session{page}{pageId},$session{form}{widget},$session{form}{title},$session{form}{displayTitle},$session{form}{description},$session{form}{processMacros},$session{form}{templatePosition});
WebGUI::SQL->write("insert into SiteMap values ($widgetId, '$session{form}{startAtThisLevel}', '$session{form}{depth}', '$session{form}{indent}', ".quote($session{form}{bullet}).", '$session{form}{lineSpacing}')");
WebGUI::SQL->write("insert into SiteMap values ($widgetId, '$session{form}{startAtThisLevel}', '$session{form}{depth}', '$session{form}{indent}', ".quote($session{form}{bullet}).", '$session{form}{lineSpacing}', '$session{form}{displaySynopsis})");
return "";
} else {
return WebGUI::Privilege::insufficient();
@ -138,18 +147,30 @@ sub www_edit {
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("func","editSave");
$output .= '<table>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,$data{title}));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle",1,$data{displayTitle}));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros",1,$data{processMacros}));
$output .= tableFormRow(WebGUI::International::get(99),
WebGUI::Form::text("title",20,128,$data{title}));
$output .= tableFormRow(WebGUI::International::get(174),
WebGUI::Form::checkbox("displayTitle",1,$data{displayTitle}));
$output .= tableFormRow(WebGUI::International::get(175),
WebGUI::Form::checkbox("processMacros",1,$data{processMacros}));
%hash = WebGUI::Widget::getPositions();
$array[0] = $data{templatePosition};
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("templatePosition",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",$data{description},50,5,1));
$output .= tableFormRow(WebGUI::International::get(3,$namespace),WebGUI::Form::checkbox("startAtThisLevel",1,$data{startAtThisLevel}));
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::text("depth",20,2,$data{depth}));
$output .= tableFormRow(WebGUI::International::get(6,$namespace),WebGUI::Form::text("indent",20,2,$data{indent}));
$output .= tableFormRow(WebGUI::International::get(7,$namespace),WebGUI::Form::text("bullet",20,30,$data{bullet}));
$output .= tableFormRow(WebGUI::International::get(8,$namespace),WebGUI::Form::text("lineSpacing",20,1,$data{lineSpacing}));
$output .= tableFormRow(WebGUI::International::get(363),
WebGUI::Form::selectList("templatePosition",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(85),
WebGUI::Form::textArea("description",$data{description},50,5,1));
$output .= tableFormRow(WebGUI::International::get(9,$namespace),
WebGUI::Form::checkbox("displaySynopsis",1,$data{displaySynopsis}));
$output .= tableFormRow(WebGUI::International::get(3,$namespace),
WebGUI::Form::checkbox("startAtThisLevel",1,$data{startAtThisLevel}));
$output .= tableFormRow(WebGUI::International::get(4,$namespace),
WebGUI::Form::text("depth",20,2,$data{depth}));
$output .= tableFormRow(WebGUI::International::get(6,$namespace),
WebGUI::Form::text("indent",20,2,$data{indent}));
$output .= tableFormRow(WebGUI::International::get(7,$namespace),
WebGUI::Form::text("bullet",20,30,$data{bullet}));
$output .= tableFormRow(WebGUI::International::get(8,$namespace),
WebGUI::Form::text("lineSpacing",20,1,$data{lineSpacing}));
$output .= formSave();
$output .= '</table></form>';
return $output;
@ -184,7 +205,7 @@ sub www_view {
} else {
$parent = 1;
}
$output .= _traversePageTree($parent,0,$data{depth},$data{indent},$data{bullet},$data{lineSpacing});
$output .= _traversePageTree($parent,0,$data{depth},$data{indent},$data{bullet},$data{lineSpacing},$data{displaySynopsis});
if ($data{processMacros}) {
$output = WebGUI::Macro::process($output);
}

View file

@ -150,6 +150,7 @@ sub www_addSubmission {
#-------------------------------------------------------------------
sub www_addSubmissionSave {
my ($title, $submissionId, $image, $attachment, %userSubmission);
tie %userSubmission, 'Tie::CPHash';
%userSubmission = getProperties($namespace,$session{form}{wid});
if (WebGUI::Privilege::isInGroup($userSubmission{groupToContribute},$session{user}{userId})) {
$submissionId = getNextId("submissionId");
@ -181,7 +182,9 @@ sub www_addSubmissionSave {
#-------------------------------------------------------------------
sub www_approveSubmission {
my (%userSubmission, %submission);
my (%submission, %userSubmission);
tie %submission, 'Tie::CPHash';
tie %userSubmission, 'Tie::CPHash';
if (WebGUI::Privilege::isInGroup(4,$session{user}{userId}) || WebGUI::Privilege::isInGroup(3,$session{user}{userId})) {
%submission = WebGUI::SQL->quickHash("select * from UserSubmission_submission where submissionId=$session{form}{sid}");
%userSubmission = getProperties($namespace,$session{form}{wid});;
@ -262,6 +265,8 @@ sub www_deleteSubmissionConfirm {
#-------------------------------------------------------------------
sub www_denySubmission {
my (%submission, %userSubmission);
tie %submission, 'Tie::CPHash';
tie %userSubmission, 'Tie::CPHash';
if (WebGUI::Privilege::isInGroup(4,$session{user}{userId}) || WebGUI::Privilege::isInGroup(3,$session{user}{userId})) {
%submission = WebGUI::SQL->quickHash("select * from UserSubmission_submission where submissionId=$session{form}{sid}");
%userSubmission = getProperties($namespace,$session{form}{wid});
@ -471,7 +476,7 @@ sub www_viewSubmission {
$output .= '</td</tr><tr><td class="tableData">';
#---content
if ($submission{image} ne "") {
$file = WebGUI::Attachment->new($submission{filename},$session{form}{wid},$session{form}{sid});
$file = WebGUI::Attachment->new($submission{image},$session{form}{wid},$session{form}{sid});
$output .= '<img src="'.$file->getURL.'" hspace=3 align="right">';
}
if ($submission{convertCarriageReturns}) {

View file

@ -314,11 +314,21 @@ g_state.RestoreSelection()
setFocus()
return true
}
function _initEditor() {
g_state = new _CState()
window.onresize = _setSize
var sz = ""
sz += ""+ "<STYLE>"+ ".DataBound{border:1 solid #999999;margin:1;font-family:Courier;background:#F1F1F1}\n"+ ".textMode {border-top: 1px black solid;font: 10pt courier}\n.NOBORDER TD {border:1px gray solid}"+ "BODY {border: 1px white solid;border-top: none;}"+ "</STYLE>"+ "<BODY ONCONTEXTMENU=\"return false\">"+ "<DIV>"+window.opener.formObj.value+"</DIV>"+ "</BODY>"
sz += ""+ "<STYLE>"+ ".DataBound{border:1 solid #999999;margin:1;font-family:Courier;background:#F1F1F1}\n"+ ".textMode {border-top: 1px black solid;font: 10pt courier}\n.NOBORDER TD {border:1px gray solid}"+ "BODY {border: 1px white solid;border-top: none;}"+ "</STYLE>"+ "<BODY ONCONTEXTMENU=\"return false\">";
var txt = window.opener.formObj.value;
if(txt.match(/^\s*<div/i) == null){
sz +="<DIV>"+txt+"</DIV>";
}else{
sz += txt;
}
sz += "</BODY>"
_CPopup_Init()
idEditbox.document.designMode = "on"
idEditbox.document.open("text/html","replace")
@ -330,6 +340,13 @@ idEditbox.document.onmousedown = _Editor_ClickHandler
idEditbox.document.ondblclick = _Editor_DblClickHandler
setTimeout("_pageReady()",0)
}
function _Editor_MoveSelection(bDir) {
var tr = idEditbox.document.body.createTextRange()
tr.collapse(bDir)