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

@ -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();