Switching wobjects over to new API.
This commit is contained in:
parent
d1066988b1
commit
6c4771d0ca
20 changed files with 708 additions and 511 deletions
|
|
@ -22,14 +22,12 @@ use WebGUI::SQL;
|
|||
use WebGUI::Wobject;
|
||||
|
||||
our @ISA = qw(WebGUI::Wobject);
|
||||
our $namespace = "SyndicatedContent";
|
||||
our $name = WebGUI::International::get(2,$namespace);
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub duplicate {
|
||||
my ($w);
|
||||
$w = $_[0]->SUPER::duplicate($_[1]);
|
||||
$w = WebGUI::Wobject::SyndicatedContent->new({wobjectId=>$w,namespace=>$namespace});
|
||||
$w = WebGUI::Wobject::SyndicatedContent->new({wobjectId=>$w,namespace=>$_[0]->get("namespace")});
|
||||
$w->set({
|
||||
rssUrl=>$_[0]->get("rssUrl"),
|
||||
content=>$_[0]->get("content"),
|
||||
|
|
@ -38,10 +36,22 @@ sub duplicate {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub set {
|
||||
$_[0]->SUPER::set($_[1], [qw(rssUrl content lastFetched)]);
|
||||
sub name {
|
||||
return WebGUI::International::get(2,$_[0]->get("namespace"));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $property = shift;
|
||||
my $self = WebGUI::Wobject->new(
|
||||
$property,
|
||||
[qw(rssUrl content lastFetched)]
|
||||
);
|
||||
bless $self, $class;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub uiLevel {
|
||||
return 6;
|
||||
|
|
@ -51,13 +61,13 @@ sub uiLevel {
|
|||
sub www_edit {
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||
my ($output, $f);
|
||||
$output = helpIcon(1,$namespace);
|
||||
$output .= '<h1>'.WebGUI::International::get(4,$namespace).'</h1>';
|
||||
$output = helpIcon(1,$_[0]->get("namespace"));
|
||||
$output .= '<h1>'.WebGUI::International::get(4,$_[0]->get("namespace")).'</h1>';
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->url("rssUrl",WebGUI::International::get(1,$namespace),$_[0]->get("rssUrl"));
|
||||
$f->url("rssUrl",WebGUI::International::get(1,$_[0]->get("namespace")),$_[0]->get("rssUrl"));
|
||||
if ($_[0]->get("wobjectId") ne "new") {
|
||||
$f->readOnly(WebGUI::DateTime::epochToHuman($_[0]->get("lastFetched"),"%z %Z"),WebGUI::International::get(5,$namespace));
|
||||
$f->readOnly($_[0]->get("content"),WebGUI::International::get(6,$namespace));
|
||||
$f->readOnly(WebGUI::DateTime::epochToHuman($_[0]->get("lastFetched"),"%z %Z"),WebGUI::International::get(5,$_[0]->get("namespace")));
|
||||
$f->readOnly($_[0]->get("content"),WebGUI::International::get(6,$_[0]->get("namespace")));
|
||||
} else {
|
||||
$f->hidden("content","Not yet fetched!");
|
||||
$f->hidden("lastFetched",time());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue