Removed all references to the old Widget system.

This commit is contained in:
JT Smith 2002-05-26 03:56:40 +00:00
parent e27419d23b
commit c78a57d1a5
4 changed files with 9 additions and 116 deletions

View file

@ -104,6 +104,8 @@ delete from widget where namespace='EventsCalendar';
alter table EventsCalendar change widgetId wobjectId int not null;
alter table EventsCalendar_event change widgetId wobjectId int not null;
update incrementer set incrementerId='wobjectId' where incrementerId='widgetId';
INSERT INTO international VALUES (21,'EventsCalendar','English','Proceed to add event?');
INSERT INTO international VALUES (20,'EventsCalendar','English','Add an event.');
INSERT INTO international VALUES (38,'UserSubmission','English','(Select \"No\" if you\'re writing an HTML/Rich Edit submission.)');

View file

@ -277,7 +277,7 @@ sub purge {
sub set {
my ($key, $sql, @update, $i);
if ($_[0]->{_property}{wobjectId} eq "new") {
$_[0]->{_property}{wobjectId} = getNextId("widgetId");
$_[0]->{_property}{wobjectId} = getNextId("wobjectId");
$_[0]->{_property}{pageId} = ${$_[1]}{pageId} || $session{page}{pageId};
$_[0]->{_property}{sequenceNumber} = _getNextSequenceNumber($_[0]->{_property}{pageId});
$_[0]->{_property}{addedBy} = $session{user}{userId};

View file

@ -60,80 +60,6 @@ sub set {
$_[0]->SUPER::set($_[1],[qw(template dbQuery DSN username identifier convertCarriageReturns paginateAfter preprocessMacros debugMode)]);
}
#-------------------------------------------------------------------
sub www_add {
my ($output, %hash);
tie %hash, 'Tie::IxHash';
if (WebGUI::Privilege::canEditPage()) {
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(2,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("widget",$namespace);
$output .= WebGUI::Form::hidden("func","addSave");
$output .= '<table>';
$output .= tableFormRow(WebGUI::International::get(99),
WebGUI::Form::text("title",20,128,widgetName()));
$output .= tableFormRow(WebGUI::International::get(174),
WebGUI::Form::checkbox("displayTitle",1,1));
$output .= tableFormRow(WebGUI::International::get(175),
WebGUI::Form::checkbox("processMacros",1,1));
%hash = WebGUI::Widget::getPositions();
$output .= tableFormRow(WebGUI::International::get(363),
WebGUI::Form::selectList("templatePosition",\%hash));
$output .= tableFormRow(WebGUI::International::get(85),
WebGUI::Form::textArea("description",'','','',1));
$output .= tableFormRow(WebGUI::International::get(15,$namespace),
WebGUI::Form::checkbox("preprocessMacros",1));
$output .= tableFormRow(WebGUI::International::get(16,$namespace),
WebGUI::Form::checkbox("debugMode",1));
$output .= tableFormRow(WebGUI::International::get(4,$namespace),
WebGUI::Form::textArea("dbQuery",''));
$output .= tableFormRow(WebGUI::International::get(3,$namespace),
WebGUI::Form::textArea("template",'','','',1));
$output .= tableFormRow(WebGUI::International::get(5,$namespace),
WebGUI::Form::text("DSN",20,255,$session{config}{dsn}));
$output .= tableFormRow(WebGUI::International::get(6,$namespace),
WebGUI::Form::text("username",20,255,$session{config}{dbuser}));
$output .= tableFormRow(WebGUI::International::get(7,$namespace),
WebGUI::Form::password("identifier",20,255));
$output .= tableFormRow(WebGUI::International::get(14,$namespace),
WebGUI::Form::text("paginateAfter",20,30,50));
$output .= tableFormRow(WebGUI::International::get(13,$namespace),
WebGUI::Form::checkbox("convertCarriageReturns",1));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
return WebGUI::Privilege::insufficient();
}
return $output;
}
#-------------------------------------------------------------------
sub www_addSave {
my ($widgetId);
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 SQLReport values($widgetId, ".
quote($session{form}{template}).", ".
quote($session{form}{dbQuery}).", ".
quote($session{form}{DSN}).", ".
quote($session{form}{username}).", ".
quote($session{form}{identifier}).", ".
"'$session{form}{convertCarriageReturns}', ".
"'$session{form}{paginateAfter}', ".
"'$session{form}{preprocessMacros}', ".
"'$session{form}{debugMode}'".
")");
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_copy {
if (WebGUI::Privilege::canEditPage()) {
@ -172,7 +98,7 @@ sub www_edit {
#-------------------------------------------------------------------
sub www_editSave {
my ($widgetId, $displayTitle, $image, $attachment);
my ($wobjectId, $displayTitle, $image, $attachment);
if (WebGUI::Privilege::canEditPage()) {
$_[0]->SUPER::www_editSave();
$_[0]->set({
@ -195,7 +121,11 @@ sub www_editSave {
#-------------------------------------------------------------------
sub www_view {
my ($dsn, $query, @row, $i, $rownum, $p, $ouch, $output, $sth, $dbh, @result, @template, $temp, $col, $errorMessage, $url);
$query = WebGUI::Macro::process($_[0]->get("dbQuery")) if ($_[0]->get("preprocessMacros"));
if ($_[0]->get("preprocessMacros")) {
$query = WebGUI::Macro::process($_[0]->get("dbQuery"));
} else {
$query = $_[0]->get("dbQuery");
}
$dsn = $_[0]->get("DSN");
$output = $_[0]->displayTitle;
$output .= $_[0]->description;

View file

@ -52,45 +52,6 @@ sub set {
$_[0]->SUPER::set($_[1], [qw(rssUrl content lastFetched)]);
}
#-------------------------------------------------------------------
sub www_add {
my ($output, %hash);
tie %hash, 'Tie::IxHash';
if (WebGUI::Privilege::canEditPage()) {
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(3,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("widget",$namespace);
$output .= WebGUI::Form::hidden("func","addSave");
$output .= '<table>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,'Syndicated Content'));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle",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(85),WebGUI::Form::textArea("description",'','','',1));
$output .= tableFormRow(WebGUI::International::get(1,$namespace),WebGUI::Form::text("rssUrl",20,2048));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
return WebGUI::Privilege::insufficient();
}
return $output;
}
#-------------------------------------------------------------------
sub www_addSave {
my ($widgetId);
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 SyndicatedContent values ($widgetId, ".quote($session{form}{rssUrl}).", 'Not yet fetched.', '".time()."')");
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_copy {
if (WebGUI::Privilege::canEditPage()) {