Converting wobjects to use new global template mechanism.
This commit is contained in:
parent
50f9aa9171
commit
5ec7c67b66
20 changed files with 253 additions and 250 deletions
|
|
@ -1243,7 +1243,7 @@ Returns a select list of templates.
|
|||
|
||||
=item name
|
||||
|
||||
The name field for this form element.
|
||||
The name field for this form element. Defaults to "templateId".
|
||||
|
||||
=item value
|
||||
|
||||
|
|
@ -1258,10 +1258,10 @@ The namespace for the list of templates to return. If this is omitted, all templ
|
|||
=cut
|
||||
|
||||
sub template {
|
||||
my ($templateId, $where);
|
||||
$templateId = $_[0]->{value} || 1;
|
||||
my $templateId = $_[0]->{value} || 1;
|
||||
my $name = $_[0]->{name} || "templateId";
|
||||
return selectList({
|
||||
name=>$_[0]->{name},
|
||||
name=>$name,
|
||||
options=>WebGUI::Template::getList($_[0]->{namespace}),
|
||||
value=>[$templateId]
|
||||
});
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ use WebGUI::URL;
|
|||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(&helpIcon &becomeIcon &cutIcon ©Icon &deleteIcon &editIcon
|
||||
&moveBottomIcon &moveDownIcon &moveLeftIcon &moveRightIcon &moveTopIcon &moveUpIcon
|
||||
&pageIcon &pasteIcon &wobjectIcon &viewIcon);
|
||||
&pageIcon &shortcutIcon &pasteIcon &wobjectIcon &viewIcon);
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -48,6 +48,7 @@ A package for generating user interface buttons. The subroutines found herein do
|
|||
$html = moveUpIcon('op=something');
|
||||
$html = pageIcon();
|
||||
$html = pasteIcon('op=something');
|
||||
$html = shortcutIcon('op=something');
|
||||
$html = viewIcon('op=something');
|
||||
$html = wobjectIcon();
|
||||
|
||||
|
|
@ -405,6 +406,39 @@ sub pasteIcon {
|
|||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 shortcutIcon ( urlParameters [, pageURL ] )
|
||||
|
||||
Generates a button with a shortcut symbol printed on it, similar to the shortcut icon in Microsoft Windows or the link Icon in Gnome.
|
||||
|
||||
=over
|
||||
|
||||
=item urlParameters
|
||||
|
||||
Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
|
||||
|
||||
=item pageURL
|
||||
|
||||
The URL to any page. Defaults to the current page.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
sub shortcutIcon {
|
||||
my ($output, $pageURL);
|
||||
$pageURL = $_[1] || $session{page}{urlizedTitle};
|
||||
$output = '<a href="'.WebGUI::URL::gateway($pageURL,$_[0]).'">';
|
||||
$output .= '<img src="'.$session{config}{extrasURL}.'/toolbar/'.$session{language}{toolbar}.'/shortcut.gif" align="middle" border="0" alt="Shortcut" title="Shortcut" /></a>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 pasteIcon ( urlParameters [, pageURL ] )
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 viewIcon ( urlParameters [, pageURL ] )
|
||||
|
|
|
|||
|
|
@ -622,7 +622,13 @@ NOTE: This is used to define the wobject and should only be passed in by a wobje
|
|||
|
||||
=item -useDiscussion
|
||||
|
||||
Defaults to "0". If set to "1" this will add a discussion properties tab to this wobject to enable content managers to set the properties of a discussion attached to this wobject.
|
||||
Defaults to "0". If set to "1" this will add a discussion properties tab to this wobject to enable content managers to set the properties of a discussion attached to this wobject.
|
||||
|
||||
NOTE: This is used to define the wobject and should only be passed in by a wobject subclass.
|
||||
|
||||
=item -useTemplate
|
||||
|
||||
Defaults to "0". If set to "1" this will add a template field to the wobject to enable content managers to select a template to layout this wobject.
|
||||
|
||||
NOTE: This is used to define the wobject and should only be passed in by a wobject subclass.
|
||||
|
||||
|
|
@ -632,14 +638,15 @@ NOTE: This is used to define the wobject and should only be passed in by a wobje
|
|||
|
||||
sub new {
|
||||
my ($self, @p) = @_;
|
||||
my ($properties, $extendedProperties, $useDiscussion);
|
||||
my ($properties, $extendedProperties, $useTemplate, $useDiscussion);
|
||||
if (ref $_[1] eq "HASH") {
|
||||
$properties = $_[1]; # reverse compatibility prior to 5.2
|
||||
} else {
|
||||
($properties, $extendedProperties, $useDiscussion) =
|
||||
rearrange([qw(properties extendedProperties useDiscussion)], @p);
|
||||
($properties, $extendedProperties, $useDiscussion, $useTemplate) =
|
||||
rearrange([qw(properties extendedProperties useDiscussion useTemplate)], @p);
|
||||
}
|
||||
$useDiscussion = 0 unless ($useDiscussion);
|
||||
$useTemplate = 0 unless ($useDiscussion);
|
||||
my $wobjectProperties = {
|
||||
userDefined1=>{
|
||||
fieldType=>"text"
|
||||
|
|
@ -657,13 +664,13 @@ sub new {
|
|||
fieldType=>"text"
|
||||
},
|
||||
bufferUserId=>{
|
||||
fieldType=>"integer"
|
||||
fieldType=>"hidden"
|
||||
},
|
||||
bufferDate=>{
|
||||
fieldType=>"integer"
|
||||
fieldType=>"hidden"
|
||||
},
|
||||
bufferPrevId=>{
|
||||
fieldType=>"integer"
|
||||
fieldType=>"hidden"
|
||||
},
|
||||
allowDiscussion=>{
|
||||
fieldType=>"yesNo",
|
||||
|
|
@ -698,8 +705,13 @@ sub new {
|
|||
defaultValue=>1,
|
||||
},
|
||||
title=>{
|
||||
fieldType=>"text"
|
||||
fieldType=>"text",
|
||||
defaultValue=>$_[0]->get("namespace")
|
||||
},
|
||||
templateId=>{
|
||||
fieldType=>"template",
|
||||
defaultValue=>1
|
||||
},
|
||||
displayTitle=>{
|
||||
fieldType=>"yesNo",
|
||||
defaultValue=>1
|
||||
|
|
@ -709,7 +721,7 @@ sub new {
|
|||
fieldType=>"HTMLArea"
|
||||
},
|
||||
pageId=>{
|
||||
fieldType=>"integer",
|
||||
fieldType=>"hidden",
|
||||
defaultValue=>$session{page}{pageId}
|
||||
},
|
||||
templatePosition=>{
|
||||
|
|
@ -725,7 +737,7 @@ sub new {
|
|||
fieldType=>"date"
|
||||
},
|
||||
sequenceNumber=>{
|
||||
fieldType=>"integer"
|
||||
fieldType=>"hidden"
|
||||
}
|
||||
};
|
||||
bless({
|
||||
|
|
@ -1065,12 +1077,35 @@ NOTE: Should never need to be overridden or extended.
|
|||
=cut
|
||||
|
||||
sub www_copy {
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$_[0]->duplicate;
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||
$_[0]->duplicate;
|
||||
return "";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_createShortcut ( )
|
||||
|
||||
Creates a shortcut (using the wobject proxy) of this wobject on the clipboard.
|
||||
|
||||
NOTE: Should never need to be overridden or extended.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_createShortcut {
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||
my $w = WebGUI::Wobject::WobjectProxy->new({wobjectId=>"new",namespace=>"WobjectProxy"});
|
||||
$w->set({
|
||||
pageId=>2,
|
||||
templatePosition=>1,
|
||||
title=>$_[0]->getValue("title"),
|
||||
proxiedNamespace=>$_[0]->get("namespace"),
|
||||
proxiedWobjectId=>$_[0]->get("wobjectId"),
|
||||
bufferUserId=>$session{user}{userId},
|
||||
bufferDate=>time(),
|
||||
bufferPrevId=>$session{page}{pageId}
|
||||
});
|
||||
return "";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -1082,16 +1117,16 @@ Moves this instance to the clipboard.
|
|||
=cut
|
||||
|
||||
sub www_cut {
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$_[0]->set({pageId=>2, templatePosition=>1,
|
||||
bufferUserId=>$session{user}{userId},
|
||||
bufferDate=>time(),
|
||||
bufferPrevId=>$session{page}{pageId}});
|
||||
_reorderWobjects($session{page}{pageId});
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||
$_[0]->set({
|
||||
pageId=>2,
|
||||
templatePosition=>1,
|
||||
bufferUserId=>$session{user}{userId},
|
||||
bufferDate=>time(),
|
||||
bufferPrevId=>$session{page}{pageId}
|
||||
});
|
||||
_reorderWobjects($session{page}{pageId});
|
||||
return "";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -1302,6 +1337,13 @@ sub www_edit {
|
|||
-value=>$displayTitle,
|
||||
-uiLevel=>5
|
||||
);
|
||||
if ($_[0]->{_useTemplate}) {
|
||||
$f->getTab("layout")->template(
|
||||
-value=>$_[0]->getValue("templateId"),
|
||||
-namespace=>$_[0]->get("namespace"),
|
||||
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
|
||||
);
|
||||
}
|
||||
$f->getTab("layout")->select(
|
||||
-name=>"templatePosition",
|
||||
-label=>WebGUI::International::get(363),
|
||||
|
|
|
|||
|
|
@ -51,9 +51,6 @@ sub new {
|
|||
-properties=>$property,
|
||||
-extendedProperties=>{
|
||||
image=>{ },
|
||||
templateId=>{
|
||||
defaultValue=>1
|
||||
},
|
||||
linkTitle=>{ },
|
||||
linkURL=>{ },
|
||||
attachment=>{ },
|
||||
|
|
@ -61,7 +58,8 @@ sub new {
|
|||
defaultValue=>0
|
||||
}
|
||||
},
|
||||
-useDiscussion=>1
|
||||
-useDiscussion=>1,
|
||||
-useTemplate=>1
|
||||
);
|
||||
bless $self, $class;
|
||||
}
|
||||
|
|
@ -70,13 +68,6 @@ sub new {
|
|||
sub www_edit {
|
||||
my $properties = WebGUI::HTMLForm->new;
|
||||
my $layout = WebGUI::HTMLForm->new;
|
||||
$layout->template(
|
||||
-name=>"templateId",
|
||||
-value=>$_[0]->getValue("templateId"),
|
||||
-namespace=>$_[0]->get("namespace"),
|
||||
-label=>WebGUI::International::get(356),
|
||||
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
|
||||
);
|
||||
$properties->raw(
|
||||
-value=>$_[0]->fileProperty("image",6),
|
||||
-uiLevel=>3
|
||||
|
|
|
|||
|
|
@ -179,9 +179,6 @@ sub new {
|
|||
-properties=>$property,
|
||||
-extendedProperties=>{
|
||||
acknowledgement=>{},
|
||||
templateId=>{
|
||||
defaultValue=>1
|
||||
},
|
||||
emailTemplateId=>{
|
||||
defaultValue=>2
|
||||
},
|
||||
|
|
@ -190,8 +187,9 @@ sub new {
|
|||
},
|
||||
mailData=>{
|
||||
defaultValue=>0
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
-useTemplate=>1
|
||||
);
|
||||
bless $self, $class;
|
||||
}
|
||||
|
|
@ -269,13 +267,6 @@ sub www_deleteFieldConfirm {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
my $layout = WebGUI::HTMLForm->new;
|
||||
$layout->template(
|
||||
-name=>"templateId",
|
||||
-value=>$_[0]->getValue("templateId"),
|
||||
-namespace=>$_[0]->get("namespace"),
|
||||
-label=>WebGUI::International::get(78,$_[0]->get("namespace")),
|
||||
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
|
||||
);
|
||||
$layout->template(
|
||||
-name=>"emailTemplateId",
|
||||
-value=>$_[0]->getValue("emailTemplateId"),
|
||||
|
|
|
|||
|
|
@ -165,9 +165,6 @@ sub new {
|
|||
my $self = WebGUI::Wobject->new(
|
||||
-properties=>$property,
|
||||
-extendedProperties=>{
|
||||
templateId=>{
|
||||
defaultValue=>1
|
||||
},
|
||||
eventTemplateId=>{
|
||||
defaultValue=>1
|
||||
},
|
||||
|
|
@ -183,7 +180,8 @@ sub new {
|
|||
paginateAfter=>{
|
||||
defaultValue=>50
|
||||
}
|
||||
}
|
||||
},
|
||||
-useTemplate=>1
|
||||
);
|
||||
bless $self, $class;
|
||||
}
|
||||
|
|
@ -227,13 +225,6 @@ sub www_edit {
|
|||
my $afterEdit = 'func=edit&wid='.$_[0]->get("wobjectId") if ($_[0]->get("wobjectId") ne "new");
|
||||
my $layout = WebGUI::HTMLForm->new;
|
||||
my $properties = WebGUI::HTMLForm->new;
|
||||
$layout->template(
|
||||
-name=>"templateId",
|
||||
-value=>$_[0]->getValue("templateId"),
|
||||
-namespace=>$_[0]->get("namespace"),
|
||||
-label=>WebGUI::International::get(79,$_[0]->get("namespace")),
|
||||
-afterEdit=>$afterEdit
|
||||
);
|
||||
$layout->template(
|
||||
-name=>"eventTemplateId",
|
||||
-value=>$_[0]->getValue("eventTemplateId"),
|
||||
|
|
|
|||
|
|
@ -49,11 +49,8 @@ sub new {
|
|||
my $property = shift;
|
||||
my $self = WebGUI::Wobject->new(
|
||||
-properties=>$property,
|
||||
-extendedProperties=>{
|
||||
templateId=>{
|
||||
defaultValue=>1
|
||||
}
|
||||
}
|
||||
-extendedProperties=>{},
|
||||
-useTemplate=>1
|
||||
);
|
||||
bless $self, $class;
|
||||
}
|
||||
|
|
@ -82,14 +79,6 @@ sub www_deleteQuestionConfirm {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
my $properties = WebGUI::HTMLForm->new;
|
||||
my $layout = WebGUI::HTMLForm->new;
|
||||
$layout->template(
|
||||
-name=>"templateId",
|
||||
-value=>$_[0]->getValue("templateId"),
|
||||
-namespace=>$_[0]->get("namespace"),
|
||||
-label=>WebGUI::International::get(74,$_[0]->get("namespace")),
|
||||
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
|
||||
);
|
||||
if ($_[0]->get("wobjectId") eq "new") {
|
||||
$properties->whatNext(
|
||||
-options=>{
|
||||
|
|
@ -101,7 +90,6 @@ sub www_edit {
|
|||
}
|
||||
return $_[0]->SUPER::www_edit(
|
||||
-properties=>$properties->printRowsOnly,
|
||||
-layout=>$layout->printRowsOnly,
|
||||
-headingId=>8,
|
||||
-helpId=>1
|
||||
);
|
||||
|
|
|
|||
|
|
@ -73,11 +73,9 @@ sub new {
|
|||
-extendedProperties=>{
|
||||
paginateAfter=>{
|
||||
defaultValue=>50,
|
||||
},
|
||||
templateId=>{
|
||||
defaultValue=>1
|
||||
}
|
||||
}
|
||||
},
|
||||
-useTemplate=>1
|
||||
);
|
||||
bless $self, $class;
|
||||
}
|
||||
|
|
@ -149,12 +147,6 @@ sub www_download {
|
|||
sub www_edit {
|
||||
my $properties = WebGUI::HTMLForm->new;
|
||||
my $layout = WebGUI::HTMLForm->new;
|
||||
$layout->template(
|
||||
-name=>"templateId",
|
||||
-value=>$_[0]->getValue("templateId"),
|
||||
-namespace=>$_[0]->get("namespace"),
|
||||
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
|
||||
);
|
||||
$layout->integer(
|
||||
-name=>"paginateAfter",
|
||||
-label=>WebGUI::International::get(20,$_[0]->get("namespace")),
|
||||
|
|
|
|||
|
|
@ -46,11 +46,9 @@ sub new {
|
|||
-properties=>$property,
|
||||
-extendedProperties=>{
|
||||
linkURL=>{},
|
||||
attachment=>{},
|
||||
templateId=>{
|
||||
defaultValue=>1
|
||||
}
|
||||
}
|
||||
attachment=>{}
|
||||
},
|
||||
-useTemplate=>1
|
||||
);
|
||||
bless $self, $class;
|
||||
}
|
||||
|
|
@ -58,22 +56,13 @@ sub new {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
my $properties = WebGUI::HTMLForm->new;
|
||||
my $layout = WebGUI::HTMLForm->new;
|
||||
$properties->url(
|
||||
-name=>"linkURL",
|
||||
-label=>WebGUI::International::get(1,$_[0]->get("namespace")),
|
||||
-value=>$_[0]->getValue("linkURL"));
|
||||
$properties->raw($_[0]->fileProperty("attachment",2));
|
||||
$layout->template(
|
||||
-name=>"templateId",
|
||||
-value=>$_[0]->getValue("templateId"),
|
||||
-namespace=>$_[0]->get("namespace"),
|
||||
-label=>WebGUI::International::get(72,$_[0]->get("namespace")),
|
||||
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
|
||||
);
|
||||
return $_[0]->SUPER::www_edit(
|
||||
-properties=>$properties->printRowsOnly,
|
||||
-layout=>$layout->printRowsOnly,
|
||||
-headingId=>6,
|
||||
-helpId=>1
|
||||
);
|
||||
|
|
|
|||
|
|
@ -49,11 +49,8 @@ sub new {
|
|||
my $property = shift;
|
||||
my $self = WebGUI::Wobject->new(
|
||||
-properties=>$property,
|
||||
-extendedProperties=>{
|
||||
templateId=>{
|
||||
defaultValue=>1
|
||||
}
|
||||
}
|
||||
-extendedProperties=>{},
|
||||
-useTemplate=>1,
|
||||
);
|
||||
bless $self, $class;
|
||||
}
|
||||
|
|
@ -82,14 +79,7 @@ sub www_deleteLinkConfirm {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
my $layout = WebGUI::HTMLForm->new;
|
||||
my $properties = WebGUI::HTMLForm->new;
|
||||
$layout->template(
|
||||
-name=>"templateId",
|
||||
-value=>$_[0]->getValue("templateId"),
|
||||
-namespace=>$_[0]->get("namespace"),
|
||||
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
|
||||
);
|
||||
if ($_[0]->get("wobjectId") eq "new") {
|
||||
$properties->whatNext(
|
||||
-options=>{
|
||||
|
|
@ -101,7 +91,6 @@ sub www_edit {
|
|||
}
|
||||
return $_[0]->SUPER::www_edit(
|
||||
-properties=>$properties->printRowsOnly,
|
||||
-layout=>$layout->printRowsOnly,
|
||||
-headingId=>10,
|
||||
-helpId=>1
|
||||
);
|
||||
|
|
|
|||
|
|
@ -40,13 +40,11 @@ sub new {
|
|||
my $self = WebGUI::Wobject->new(
|
||||
-properties=>$property,
|
||||
-extendedProperties=>{
|
||||
templateId=>{
|
||||
defaultValue=>1
|
||||
},
|
||||
messagesPerPage=>{
|
||||
defaultValue=>50
|
||||
}
|
||||
}
|
||||
},
|
||||
-useTemplate=>1
|
||||
);
|
||||
bless $self, $class;
|
||||
}
|
||||
|
|
@ -71,13 +69,6 @@ sub www_edit {
|
|||
-label=>WebGUI::International::get(4,$_[0]->get("namespace")),
|
||||
-value=>$_[0]->getValue("messagesPerPage")
|
||||
);
|
||||
$layout->template(
|
||||
-name=>"templateId",
|
||||
-value=>$_[0]->getValue("templateId"),
|
||||
-namespace=>$_[0]->get("namespace"),
|
||||
-label=>WebGUI::International::get(72,$_[0]->get("namespace")),
|
||||
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
|
||||
);
|
||||
$properties->raw($_[0]->SUPER::discussionProperties);
|
||||
return $_[0]->SUPER::www_edit(
|
||||
-layout=>$layout->printRowsOnly,
|
||||
|
|
|
|||
|
|
@ -95,7 +95,8 @@ sub new {
|
|||
a18=>{},
|
||||
a19=>{},
|
||||
a20=>{}
|
||||
}
|
||||
},
|
||||
-useTemplate=>1
|
||||
);
|
||||
bless $self, $class;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,9 +87,6 @@ sub new {
|
|||
-properties=>$property,
|
||||
-extendedProperties=>{
|
||||
price=>{},
|
||||
templateId=>{
|
||||
defaultValue=>1
|
||||
},
|
||||
productNumber=>{},
|
||||
image1=>{},
|
||||
image2=>{},
|
||||
|
|
@ -97,7 +94,8 @@ sub new {
|
|||
manual=>{},
|
||||
brochure=>{},
|
||||
warranty=>{}
|
||||
}
|
||||
},
|
||||
-useTemplate=>1
|
||||
);
|
||||
bless $self, $class;
|
||||
}
|
||||
|
|
@ -274,15 +272,7 @@ sub www_deleteSpecificationConfirm {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
my $layout = WebGUI::HTMLForm->new;
|
||||
my $properties = WebGUI::HTMLForm->new;
|
||||
$layout->template(
|
||||
-name=>"templateId",
|
||||
-value=>$_[0]->getValue("template"),
|
||||
-namespace=>$_[0]->get("namespace"),
|
||||
-label=>WebGUI::International::get(61,$_[0]->get("namespace")),
|
||||
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
|
||||
);
|
||||
$properties->text(
|
||||
-name=>"price",
|
||||
-label=>WebGUI::International::get(10,$_[0]->get("namespace")),
|
||||
|
|
@ -301,7 +291,6 @@ sub www_edit {
|
|||
$properties->raw($_[0]->fileProperty("warranty",15));
|
||||
return $_[0]->SUPER::www_edit(
|
||||
-properties=>$properties->printRowsOnly,
|
||||
-layout=>$layout->printRowsOnly,
|
||||
-helpId=>1,
|
||||
-headingId=>6
|
||||
);
|
||||
|
|
|
|||
|
|
@ -75,13 +75,11 @@ sub new {
|
|||
indent=>{
|
||||
defaultValue=>5
|
||||
},
|
||||
templateId=>{
|
||||
defaultValue=>1
|
||||
},
|
||||
depth=>{
|
||||
defaultValue=>0
|
||||
}
|
||||
}
|
||||
},
|
||||
-useTemplate=>1
|
||||
);
|
||||
bless $self, $class;
|
||||
}
|
||||
|
|
@ -93,12 +91,6 @@ sub www_edit {
|
|||
and (pageId=1 or pageId>999) order by title");
|
||||
my $layout = WebGUI::HTMLForm->new;
|
||||
my $properties = WebGUI::HTMLForm->new;
|
||||
$layout->template(
|
||||
-name=>"templateId",
|
||||
-value=>$_[0]->getValue("templateId"),
|
||||
-namespace=>$_[0]->get("namespace"),
|
||||
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
|
||||
);
|
||||
$properties->select(
|
||||
-name=>"startAtThisLevel",
|
||||
-label=>WebGUI::International::get(3,$_[0]->get("namespace")),
|
||||
|
|
|
|||
|
|
@ -39,11 +39,9 @@ sub new {
|
|||
my $self = WebGUI::Wobject->new(
|
||||
-properties=>$property,
|
||||
-extendedProperties=>{
|
||||
rssUrl=>{},
|
||||
templateId=>{
|
||||
defaultValue=>1
|
||||
}
|
||||
}
|
||||
rssUrl=>{}
|
||||
},
|
||||
-useTemplate=>1
|
||||
);
|
||||
bless $self, $class;
|
||||
}
|
||||
|
|
@ -57,21 +55,13 @@ sub uiLevel {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
my $properties = WebGUI::HTMLForm->new;
|
||||
my $layout = WebGUI::HTMLForm->new;
|
||||
$properties->url(
|
||||
-name=>"rssUrl",
|
||||
-label=>WebGUI::International::get(1,$_[0]->get("namespace")),
|
||||
-value=>$_[0]->getValue("rssUrl")
|
||||
);
|
||||
$layout->template(
|
||||
-name=>"templateId",
|
||||
-value=>$_[0]->getValue("templateId"),
|
||||
-namespace=>$_[0]->get("namespace"),
|
||||
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
|
||||
);
|
||||
return $_[0]->SUPER::www_edit(
|
||||
-properties=>$properties->printRowsOnly,
|
||||
-layout=>$layout->printRowsOnly,
|
||||
-headingId=>4,
|
||||
-helpId=>1
|
||||
);
|
||||
|
|
|
|||
|
|
@ -81,16 +81,14 @@ sub new {
|
|||
submissionTemplateId=>{
|
||||
defaultValue=>1
|
||||
},
|
||||
templateId=>{
|
||||
defaultValue=>1
|
||||
},
|
||||
karmaPerSubmission=>{
|
||||
defaultValue=>0
|
||||
},
|
||||
filterContent=>{
|
||||
defaultValue=>"javascript"
|
||||
}
|
||||
}
|
||||
},
|
||||
-useTemplate=>1
|
||||
);
|
||||
bless $self, $class;
|
||||
}
|
||||
|
|
@ -187,13 +185,6 @@ sub www_edit {
|
|||
my $layout = WebGUI::HTMLForm->new;
|
||||
my $privileges = WebGUI::HTMLForm->new;
|
||||
my $properties = WebGUI::HTMLForm->new;
|
||||
$layout->template(
|
||||
-name=>"templateId",
|
||||
-value=>$_[0]->getValue("templateId"),
|
||||
-namespace=>$_[0]->get("namespace"),
|
||||
-label=>WebGUI::International::get(72,$_[0]->get("namespace")),
|
||||
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
|
||||
);
|
||||
$layout->template(
|
||||
-name=>"submissionTemplateId",
|
||||
-value=>$_[0]->getValue("submissionTemplateId"),
|
||||
|
|
|
|||
|
|
@ -38,7 +38,32 @@ sub new {
|
|||
my $self = WebGUI::Wobject->new(
|
||||
-properties=>$property,
|
||||
-extendedProperties=>{
|
||||
proxiedWobjectId=>{ }
|
||||
proxiedWobjectId=>{
|
||||
fieldType=>"hidden"
|
||||
},
|
||||
proxiedNamespace=>{
|
||||
fieldType=>"hidden"
|
||||
},
|
||||
overrideTitle=>{
|
||||
fieldType=>"yesNo",
|
||||
defaultValue=>0
|
||||
},
|
||||
overrideTemplate=>{
|
||||
fieldType=>"yesNo",
|
||||
defaultValue=>0
|
||||
},
|
||||
overrideDisplayTitle=>{
|
||||
fieldType=>"yesNo",
|
||||
defaultValue=>0
|
||||
},
|
||||
overrideDescription=>{
|
||||
fieldType=>"yesNo",
|
||||
defaultValue=>0
|
||||
},
|
||||
proxiedTemplateId=>{
|
||||
fieldType=>"template",
|
||||
defaultValue=>1
|
||||
}
|
||||
}
|
||||
);
|
||||
bless $self, $class;
|
||||
|
|
@ -47,80 +72,51 @@ sub new {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub uiLevel {
|
||||
return 8;
|
||||
return 999;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||
my ($output, $f, %wobjects, %page, %wobject, $a, $b);
|
||||
tie %wobject, 'Tie::CPHash';
|
||||
tie %page, 'Tie::CPHash';
|
||||
tie %wobjects, 'Tie::IxHash';
|
||||
$output = helpIcon(1,$_[0]->get("namespace"));
|
||||
$output .= '<h1>'.WebGUI::International::get(2,$_[0]->get("namespace")).'</h1>';
|
||||
my %tabs;
|
||||
tie %tabs, 'Tie::IxHash';
|
||||
%tabs = (
|
||||
properties=>{
|
||||
label=>WebGUI::International::get(893)
|
||||
},
|
||||
layout=>{
|
||||
label=>WebGUI::International::get(105),
|
||||
uiLevel=>5
|
||||
},
|
||||
privileges=>{
|
||||
label=>WebGUI::International::get(107),
|
||||
uiLevel=>9
|
||||
}
|
||||
);
|
||||
$f = WebGUI::TabForm->new(\%tabs);
|
||||
$f->hidden({name=>"wid",value=>$_[0]->get("wobjectId")});
|
||||
$f->hidden({name=>"namespace",value=>$_[0]->get("namespace")}) if ($_[0]->get("wobjectId") eq "new");
|
||||
$f->hidden({name=>"func",value=>"editSave"});
|
||||
$f->getTab("properties")->readOnly(
|
||||
-value=>$_[0]->get("wobjectId"),
|
||||
-label=>WebGUI::International::get(499)
|
||||
my $properties = WebGUI::HTMLForm->new;
|
||||
my $layout = WebGUI::HTMLForm->new;
|
||||
$layout->template(
|
||||
-name=>"proxiedTemplateId",
|
||||
-value=>[$_[0]->getValue("proxiedTemplateId")],
|
||||
-namespace=>$_[0]->get("proxiedNamespace")
|
||||
);
|
||||
$f->hidden({name=>"title",value=>$_[0]->name});
|
||||
$f->hidden({name=>"displayTitle",value=>$_[0]->getValue("displayTitle")});
|
||||
$f->getTab("layout")->select(
|
||||
-name=>"templatePosition",
|
||||
-label=>WebGUI::International::get(363),
|
||||
-value=>[$_[0]->getValue("templatePosition")],
|
||||
-uiLevel=>5,
|
||||
-options=>WebGUI::Page::getTemplatePositions($session{page}{templateId}),
|
||||
-subtext=>WebGUI::Page::drawTemplate($session{page}{templateId})
|
||||
);
|
||||
$f->getTab("privileges")->date(
|
||||
-name=>"startDate",
|
||||
-label=>WebGUI::International::get(497),
|
||||
-value=>$_[0]->getValue("startDate")
|
||||
$properties->yesNo(
|
||||
-name=>"overrideTitle",
|
||||
-value=>$_[0]->getValue("overrideTitle"),
|
||||
-label=>WebGUI::International::get(7,$_[0]->get("namespace"))
|
||||
);
|
||||
$f->getTab("privileges")->date(
|
||||
-name=>"endDate",
|
||||
-label=>WebGUI::International::get(498),
|
||||
-value=>$_[0]->getValue("endDate")
|
||||
$layout->yesNo(
|
||||
-name=>"overrideDisplayTitle",
|
||||
-value=>$_[0]->getValue("overrideDisplayTitle"),
|
||||
-label=>WebGUI::International::get(8,$_[0]->get("namespace"))
|
||||
);
|
||||
$a = WebGUI::SQL->read("select pageId,menuTitle from page where pageId<2 or pageId>25 order by menuTitle");
|
||||
while (%page = $a->hash) {
|
||||
$b = WebGUI::SQL->read("select wobjectId,title from wobject
|
||||
where pageId=".$page{pageId}." and namespace<>'WobjectProxy' and
|
||||
namespace<>'ExtraColumn' and endDate>=".time()." and pageId<>3 order by sequenceNumber");
|
||||
while (%wobject = $b->hash) {
|
||||
$wobjects{$wobject{wobjectId}} = $page{menuTitle}." / ".$wobject{title}." (".$wobject{wobjectId}.")";
|
||||
}
|
||||
$b->finish;
|
||||
}
|
||||
$a->finish;
|
||||
$f->getTab("properties")->select(
|
||||
-name=>"proxiedWobjectId",
|
||||
-options=>\%wobjects,
|
||||
$properties->yesNo(
|
||||
-name=>"overrideDescription",
|
||||
-value=>$_[0]->getValue("overrideTitle"),
|
||||
-label=>WebGUI::International::get(9,$_[0]->get("namespace"))
|
||||
);
|
||||
$layout->yesNo(
|
||||
-name=>"overrideTemplate",
|
||||
-value=>$_[0]->getValue("overrideTitle"),
|
||||
-label=>WebGUI::International::get(10,$_[0]->get("namespace"))
|
||||
);
|
||||
my @data = WebGUI::SQL->read("select page.urlizedTitle,wobject.title from wobject left join page on wobject.pageId=page.pageId
|
||||
where wobject.wobjectId=".$_[0]->get("proxiedWobjectId"));
|
||||
$properties->readonly(
|
||||
-label=>WebGUI::International::get(1,$_[0]->get("namespace")),
|
||||
-value=>[$_[0]->getValue("proxiedWobjectId")]
|
||||
-value=>'<a href="'.WebGUI::URL::gateway($data[0]).'">'.$data[1].'</a>'
|
||||
);
|
||||
$output .= $f->print;
|
||||
return $output;
|
||||
return $_[0]->SUPER::www_edit(
|
||||
-properties=>$properties->printRowsOnly,
|
||||
-layout=>$layout->printRowsOnly,
|
||||
-headingId=>2,
|
||||
-helpId=>1
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue