all wobject use tab form interface

This commit is contained in:
JT Smith 2003-03-03 05:23:56 +00:00
parent 56d28572e3
commit 965cba6774
17 changed files with 273 additions and 211 deletions

View file

@ -42,8 +42,7 @@ sub duplicate {
linkTitle=>$_[0]->get("linkTitle"), linkTitle=>$_[0]->get("linkTitle"),
linkURL=>$_[0]->get("linkURL"), linkURL=>$_[0]->get("linkURL"),
attachment=>$_[0]->get("attachment"), attachment=>$_[0]->get("attachment"),
convertCarriageReturns=>$_[0]->get("convertCarriageReturns"), convertCarriageReturns=>$_[0]->get("convertCarriageReturns")
allowDiscussion=>$_[0]->get("allowDiscussion")
}); });
} }
@ -58,7 +57,7 @@ sub new {
my $property = shift; my $property = shift;
my $self = WebGUI::Wobject->new( my $self = WebGUI::Wobject->new(
$property, $property,
[qw(image templateId linkTitle linkURL attachment convertCarriageReturns allowDiscussion)], [qw(image templateId linkTitle linkURL attachment convertCarriageReturns)],
1 1
); );
bless $self, $class; bless $self, $class;
@ -67,7 +66,7 @@ sub new {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_edit { sub www_edit {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage()); return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
my ($output, $editTimeout, $groupToModerate, $f, $template); my ($output, $editTimeout, $groupToModerate, $template);
if ($_[0]->get("wobjectId") eq "new") { if ($_[0]->get("wobjectId") eq "new") {
$editTimeout = 1; $editTimeout = 1;
} else { } else {
@ -77,55 +76,52 @@ sub www_edit {
$groupToModerate = $_[0]->get("groupToModerate") || 4; $groupToModerate = $_[0]->get("groupToModerate") || 4;
$output = helpIcon(1,$_[0]->get("namespace")); $output = helpIcon(1,$_[0]->get("namespace"));
$output .= '<h1>'.WebGUI::International::get(12,$_[0]->get("namespace")).'</h1>'; $output .= '<h1>'.WebGUI::International::get(12,$_[0]->get("namespace")).'</h1>';
$f = WebGUI::HTMLForm->new; my $properties = WebGUI::HTMLForm->new;
$f->template( my $layout = WebGUI::HTMLForm->new;
$layout->template(
-name=>"templateId", -name=>"templateId",
-value=>$template, -value=>$template,
-namespace=>$_[0]->get("namespace"), -namespace=>$_[0]->get("namespace"),
-label=>WebGUI::International::get(356), -label=>WebGUI::International::get(356),
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId") -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
); );
$f->raw( $properties->raw(
-value=>$_[0]->fileProperty("image",6), -value=>$_[0]->fileProperty("image",6),
-uiLevel=>3 -uiLevel=>3
); );
$f->raw( $properties->raw(
-value=>$_[0]->fileProperty("attachment",9), -value=>$_[0]->fileProperty("attachment",9),
-uiLevel=>1 -uiLevel=>1
); );
$f->text( $properties->text(
-name=>"linkTitle", -name=>"linkTitle",
-label=>WebGUI::International::get(7,$_[0]->get("namespace")), -label=>WebGUI::International::get(7,$_[0]->get("namespace")),
-value=>$_[0]->get("linkTitle"), -value=>$_[0]->get("linkTitle"),
-uiLevel=>3 -uiLevel=>3
); );
$f->url( $properties->url(
-name=>"linkURL", -name=>"linkURL",
-label=>WebGUI::International::get(8,$_[0]->get("namespace")), -label=>WebGUI::International::get(8,$_[0]->get("namespace")),
-value=>$_[0]->get("linkURL"), -value=>$_[0]->get("linkURL"),
-uiLevel=>3 -uiLevel=>3
); );
$f->yesNo( $layout->yesNo(
-name=>"convertCarriageReturns", -name=>"convertCarriageReturns",
-label=>WebGUI::International::get(10,$_[0]->get("namespace")), -label=>WebGUI::International::get(10,$_[0]->get("namespace")),
-value=>$_[0]->get("convertCarriageReturns"), -value=>$_[0]->get("convertCarriageReturns"),
-subtext=>' &nbsp; <span style="font-size: 8pt;">'.WebGUI::International::get(11,$_[0]->get("namespace")).'</span>', -subtext=>' &nbsp; <span style="font-size: 8pt;">'.WebGUI::International::get(11,$_[0]->get("namespace")).'</span>',
-uiLevel=>5 -uiLevel=>5
); );
$f->yesNo( $output .= $_[0]->SUPER::www_edit(
-name=>"allowDiscussion", -properties=>$properties->printRowsOnly,
-label=>WebGUI::International::get(18,$_[0]->get("namespace")), -layout=>$layout->printRowsOnly
-value=>$_[0]->get("allowDiscussion"),
-uiLevel=>5
); );
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly);
return $output; return $output;
} }
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_editSave { sub www_editSave {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage()); return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
# return WebGUI::International::get(815).$_[0]->www_edit if ($session{cgi}->cgi_error eq "413 POST too large");
my ($image, $attachment, %property); my ($image, $attachment, %property);
$_[0]->SUPER::www_editSave() if ($_[0]->get("wobjectId") eq "new"); $_[0]->SUPER::www_editSave() if ($_[0]->get("wobjectId") eq "new");
$image = WebGUI::Attachment->new("",$_[0]->get("wobjectId")); $image = WebGUI::Attachment->new("",$_[0]->get("wobjectId"));
@ -138,7 +134,6 @@ sub www_editSave {
$property{linkTitle} = $session{form}{linkTitle}; $property{linkTitle} = $session{form}{linkTitle};
$property{templateId} = $session{form}{templateId}; $property{templateId} = $session{form}{templateId};
$property{linkURL} = $session{form}{linkURL}; $property{linkURL} = $session{form}{linkURL};
$property{allowDiscussion} = $session{form}{allowDiscussion};
$_[0]->SUPER::www_editSave(\%property); $_[0]->SUPER::www_editSave(\%property);
return ""; return "";
} }

View file

@ -215,7 +215,7 @@ sub www_deleteEventConfirm {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_edit { sub www_edit {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage()); return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
my ($output, $startMonth, $endMonth, $afterEdit, $defaultMonth, $f, $paginateAfter); my ($output, $startMonth, $endMonth, $afterEdit, $defaultMonth, $paginateAfter);
$paginateAfter = $_[0]->get("paginateAfter") || 50; $paginateAfter = $_[0]->get("paginateAfter") || 50;
$startMonth = $_[0]->get("startMonth") || "current"; $startMonth = $_[0]->get("startMonth") || "current";
$endMonth = $_[0]->get("endMonth") || "after12"; $endMonth = $_[0]->get("endMonth") || "after12";
@ -223,22 +223,23 @@ sub www_edit {
$afterEdit = 'func=edit&wid='.$_[0]->get("wobjectId") if ($_[0]->get("wobjectId") ne "new"); $afterEdit = 'func=edit&wid='.$_[0]->get("wobjectId") if ($_[0]->get("wobjectId") ne "new");
$output = helpIcon(1,$_[0]->get("namespace")); $output = helpIcon(1,$_[0]->get("namespace"));
$output .= '<h1>'.WebGUI::International::get(12,$_[0]->get("namespace")).'</h1>'; $output .= '<h1>'.WebGUI::International::get(12,$_[0]->get("namespace")).'</h1>';
$f = WebGUI::HTMLForm->new; my $layout = WebGUI::HTMLForm->new;
$f->template( my $properties = WebGUI::HTMLForm->new;
$layout->template(
-name=>"templateId", -name=>"templateId",
-value=>$_[0]->get("templateId"), -value=>$_[0]->get("templateId"),
-namespace=>$_[0]->get("namespace"), -namespace=>$_[0]->get("namespace"),
-label=>WebGUI::International::get(79,$_[0]->get("namespace")), -label=>WebGUI::International::get(79,$_[0]->get("namespace")),
-afterEdit=>$afterEdit -afterEdit=>$afterEdit
); );
$f->template( $layout->template(
-name=>"eventTemplateId", -name=>"eventTemplateId",
-value=>$_[0]->get("eventTemplateId"), -value=>$_[0]->get("eventTemplateId"),
-namespace=>$_[0]->get("namespace")."/Event", -namespace=>$_[0]->get("namespace")."/Event",
-label=>WebGUI::International::get(80,$_[0]->get("namespace")), -label=>WebGUI::International::get(80,$_[0]->get("namespace")),
-afterEdit=>$afterEdit -afterEdit=>$afterEdit
); );
$f->select( $properties->select(
-name=>"startMonth", -name=>"startMonth",
-options=>{ -options=>{
"current"=>WebGUI::International::get(82,$_[0]->get("namespace")), "current"=>WebGUI::International::get(82,$_[0]->get("namespace")),
@ -247,7 +248,7 @@ sub www_edit {
-label=>WebGUI::International::get(81,$_[0]->get("namespace")), -label=>WebGUI::International::get(81,$_[0]->get("namespace")),
-value=>[$startMonth] -value=>[$startMonth]
); );
$f->select( $properties->select(
-name=>"endMonth", -name=>"endMonth",
-options=>{ -options=>{
"last"=>WebGUI::International::get(85,$_[0]->get("namespace")), "last"=>WebGUI::International::get(85,$_[0]->get("namespace")),
@ -260,7 +261,7 @@ sub www_edit {
-label=>WebGUI::International::get(84,$_[0]->get("namespace")), -label=>WebGUI::International::get(84,$_[0]->get("namespace")),
-value=>[$endMonth] -value=>[$endMonth]
); );
$f->select( $properties->select(
-name=>"defaultMonth", -name=>"defaultMonth",
-options=>{ -options=>{
"current"=>WebGUI::International::get(82,$_[0]->get("namespace")), "current"=>WebGUI::International::get(82,$_[0]->get("namespace")),
@ -270,9 +271,9 @@ sub www_edit {
-label=>WebGUI::International::get(90,$_[0]->get("namespace")), -label=>WebGUI::International::get(90,$_[0]->get("namespace")),
-value=>[$defaultMonth] -value=>[$defaultMonth]
); );
$f->integer("paginateAfter",WebGUI::International::get(19,$_[0]->get("namespace")),$paginateAfter); $layout->integer("paginateAfter",WebGUI::International::get(19,$_[0]->get("namespace")),$paginateAfter);
if ($_[0]->get("wobjectId") eq "new") { if ($_[0]->get("wobjectId") eq "new") {
$f->whatNext( $properties->whatNext(
-options=>{ -options=>{
addEvent=>WebGUI::International::get(91,$_[0]->get("namespace")), addEvent=>WebGUI::International::get(91,$_[0]->get("namespace")),
backToPage=>WebGUI::International::get(745) backToPage=>WebGUI::International::get(745)
@ -280,7 +281,10 @@ sub www_edit {
-value=>"backToPage" -value=>"backToPage"
); );
} }
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly); $output .= $_[0]->SUPER::www_edit(
-properties=>$properties->printRowsOnly,
-layout=>$layout->printRowsOnly
);
return $output; return $output;
} }

View file

@ -12,14 +12,15 @@ package WebGUI::Wobject::ExtraColumn;
use strict; use strict;
use Tie::CPHash; use Tie::CPHash;
use Tie::IxHash;
use WebGUI::DateTime; use WebGUI::DateTime;
use WebGUI::HTMLForm;
use WebGUI::Icon; use WebGUI::Icon;
use WebGUI::International; use WebGUI::International;
use WebGUI::Privilege; use WebGUI::Privilege;
use WebGUI::Session; use WebGUI::Session;
use WebGUI::SQL; use WebGUI::SQL;
use WebGUI::Page; use WebGUI::Page;
use WebGUI::TabForm;
use WebGUI::Template; use WebGUI::Template;
use WebGUI::Wobject; use WebGUI::Wobject;
@ -71,14 +72,29 @@ sub www_edit {
$class = $_[0]->get("class") || "content"; $class = $_[0]->get("class") || "content";
$startDate = $_[0]->get("startDate") || $session{page}{startDate}; $startDate = $_[0]->get("startDate") || $session{page}{startDate};
$endDate = $_[0]->get("endDate") || $session{page}{endDate}; $endDate = $_[0]->get("endDate") || $session{page}{endDate};
$f = WebGUI::HTMLForm->new; my %tabs;
$f->hidden("wid",$_[0]->get("wobjectId")); tie %tabs, 'Tie::IxHash';
$f->hidden("namespace",$_[0]->get("namespace")) if ($_[0]->get("wobjectId") eq "new"); %tabs = (
$f->hidden("func","editSave"); properties=>{
$f->readOnly($_[0]->get("wobjectId"),WebGUI::International::get(499)); label=>WebGUI::International::get(893)
$f->hidden("title",$_[0]->get("namespace")); },
$f->hidden("displayTitle",0); layout=>{
$f->select( 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($_[0]->get("wobjectId"),WebGUI::International::get(499));
$f->hidden({name=>"title",value=>$_[0]->name});
$f->hidden({name=>"displayTitle",value=>0});
$f->getTab("layout")->select(
-name=>"templatePosition", -name=>"templatePosition",
-label=>WebGUI::International::get(363), -label=>WebGUI::International::get(363),
-value=>[$templatePosition], -value=>[$templatePosition],
@ -86,12 +102,11 @@ sub www_edit {
-options=>WebGUI::Page::getTemplatePositions($session{page}{templateId}), -options=>WebGUI::Page::getTemplatePositions($session{page}{templateId}),
-subtext=>WebGUI::Page::drawTemplate($session{page}{templateId}) -subtext=>WebGUI::Page::drawTemplate($session{page}{templateId})
); );
$f->date("startDate",WebGUI::International::get(497),$startDate); $f->getTab("privileges")->date("startDate",WebGUI::International::get(497),$startDate);
$f->date("endDate",WebGUI::International::get(498),$endDate); $f->getTab("privileges")->date("endDate",WebGUI::International::get(498),$endDate);
$f->integer("spacer",WebGUI::International::get(3,$_[0]->get("namespace")),$spacer); $f->getTab("properties")->integer("spacer",WebGUI::International::get(3,$_[0]->get("namespace")),$spacer);
$f->integer("width",WebGUI::International::get(4,$_[0]->get("namespace")),$width); $f->getTab("properties")->integer("width",WebGUI::International::get(4,$_[0]->get("namespace")),$width);
$f->text("class",WebGUI::International::get(5,$_[0]->get("namespace")),$class); $f->getTab("properties")->text("class",WebGUI::International::get(5,$_[0]->get("namespace")),$class);
$f->submit;
$output .= $f->print; $output .= $f->print;
return $output; return $output;
} }

View file

@ -81,12 +81,12 @@ sub www_deleteQuestionConfirm {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_edit { sub www_edit {
my ($f, $output);
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage()); return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
$output = helpIcon(1,$_[0]->get("namespace")); my $output = helpIcon(1,$_[0]->get("namespace"));
$output .= '<h1>'.WebGUI::International::get(8,$_[0]->get("namespace")).'</h1>'; $output .= '<h1>'.WebGUI::International::get(8,$_[0]->get("namespace")).'</h1>';
$f = WebGUI::HTMLForm->new; my $properties = WebGUI::HTMLForm->new;
$f->template( my $layout = WebGUI::HTMLForm->new;
$layout->template(
-name=>"templateId", -name=>"templateId",
-value=>$_[0]->get("templateId"), -value=>$_[0]->get("templateId"),
-namespace=>$_[0]->get("namespace"), -namespace=>$_[0]->get("namespace"),
@ -94,7 +94,7 @@ sub www_edit {
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId") -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
); );
if ($_[0]->get("wobjectId") eq "new") { if ($_[0]->get("wobjectId") eq "new") {
$f->whatNext( $properties->whatNext(
-options=>{ -options=>{
addQuestion=>WebGUI::International::get(75,$_[0]->get("namespace")), addQuestion=>WebGUI::International::get(75,$_[0]->get("namespace")),
backToPage=>WebGUI::International::get(745) backToPage=>WebGUI::International::get(745)
@ -102,7 +102,10 @@ sub www_edit {
-value=>"addQuestion" -value=>"addQuestion"
); );
} }
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly); $output .= $_[0]->SUPER::www_edit(
-properties=>$properties->printRowsOnly,
-layout=>$layout->printRowsOnly
);
return $output; return $output;
} }

View file

@ -145,23 +145,24 @@ sub www_download {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_edit { sub www_edit {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage()); return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
my ($output, $f, $paginateAfter, $proceed); my ($output, $paginateAfter, $proceed);
if ($_[0]->get("wobjectId") eq "new") { if ($_[0]->get("wobjectId") eq "new") {
$proceed = 1; $proceed = 1;
} }
$output .= helpIcon(1,$_[0]->get("namespace")); $output .= helpIcon(1,$_[0]->get("namespace"));
$output .= '<h1>'.WebGUI::International::get(9,$_[0]->get("namespace")).'</h1>'; $output .= '<h1>'.WebGUI::International::get(9,$_[0]->get("namespace")).'</h1>';
$paginateAfter = $_[0]->get("paginateAfter") || 50; $paginateAfter = $_[0]->get("paginateAfter") || 50;
$f = WebGUI::HTMLForm->new; my $properties = WebGUI::HTMLForm->new;
$f->template( my $layout = WebGUI::HTMLForm->new;
$layout->template(
-name=>"templateId", -name=>"templateId",
-value=>$_[0]->get("templateId"), -value=>$_[0]->get("templateId"),
-namespace=>$_[0]->get("namespace"), -namespace=>$_[0]->get("namespace"),
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId") -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
); );
$f->integer("paginateAfter",WebGUI::International::get(20,$_[0]->get("namespace")),$paginateAfter); $layout->integer("paginateAfter",WebGUI::International::get(20,$_[0]->get("namespace")),$paginateAfter);
if ($_[0]->get("wobjectId") eq "new") { if ($_[0]->get("wobjectId") eq "new") {
$f->whatNext( $properties->whatNext(
-options=>{ -options=>{
addFile=>WebGUI::International::get(74,$_[0]->get("namespace")), addFile=>WebGUI::International::get(74,$_[0]->get("namespace")),
backToPage=>WebGUI::International::get(745) backToPage=>WebGUI::International::get(745)
@ -169,7 +170,10 @@ sub www_edit {
-value=>"addFile" -value=>"addFile"
); );
} }
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly); $output .= $_[0]->SUPER::www_edit(
-properties=>$properties->printRowsOnly,
-layout=>$layout->printRowsOnly
);
return $output; return $output;
} }

View file

@ -60,56 +60,50 @@ sub new {
} }
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_copy { sub uiLevel {
if (WebGUI::Privilege::canEditPage()) { return 5;
$_[0]->duplicate;
return "";
} else {
return WebGUI::Privilege::insufficient();
}
} }
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_edit { sub www_edit {
my (%htmlFilter, $output, $f, $startDate, $endDate, $templatePosition, $proxiedUrl, %hash); return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
if (WebGUI::Privilege::canEditPage()) { my %hash;
%hash=(5=>5,10=>10,20=>20,30=>30,60=>60); tie %hash, 'Tie::IxHash';
%htmlFilter = ('none'=>WebGUI::International::get(420), 'most'=>WebGUI::International::get(421), %hash=(5=>5,10=>10,20=>20,30=>30,60=>60);
'javascript'=>WebGUI::International::get(526), 'all'=>WebGUI::International::get(419)); my $output = helpIcon(1,$_[0]->get("namespace"));
$output = helpIcon(1,$_[0]->get("namespace")); $output .= '<h1>'.WebGUI::International::get(2,$_[0]->get("namespace")).'</h1>';
$output .= '<h1>'.WebGUI::International::get(2,$_[0]->get("namespace")).'</h1>'; my $privileges = WebGUI::HTMLForm->new;
$templatePosition = $_[0]->get("templatePosition") || '0'; my $properties = WebGUI::HTMLForm->new;
$startDate = $_[0]->get("startDate") || $session{page}{startDate}; my $layout = WebGUI::HTMLForm->new;
$endDate = $_[0]->get("endDate") || $session{page}{endDate}; $properties->url(
$f = WebGUI::HTMLForm->new; -name=>"proxiedUrl", WebGUI::International::get(1,$_[0]->get("namespace")),$_[0]->get("proxiedUrl")||'http://');
$f->url("proxiedUrl", WebGUI::International::get(1,$_[0]->get("namespace")),$_[0]->get("proxiedUrl")||'http://'); $privileges->yesNo(
$f->yesNo( -name=>"followExternal",
-name=>"followExternal", -label=>WebGUI::International::get(5,$_[0]->get("namespace")),
-label=>WebGUI::International::get(5,$_[0]->get("namespace")), -value=>($_[0]->get("wobjectId") eq "new") ? 1 : $_[0]->get("followExternal")
-value=>($_[0]->get("wobjectId") eq "new") ? 1 : $_[0]->get("followExternal"), );
-uiLevel=>5 $properties->yesNo(
); -name=>"followRedirect",
$f->yesNo( -label=>WebGUI::International::get(8,$_[0]->get("namespace")),
-name=>"followRedirect", -value=>$_[0]->get("followRedirect")
-label=>WebGUI::International::get(8,$_[0]->get("namespace")), );
-value=>$_[0]->get("followRedirect"), $layout->yesNo(
-uiLevel=>5 -name=>"removeStyle",
); -label=>WebGUI::International::get(6,$_[0]->get("namespace")),
$f->yesNo( -value=>($_[0]->get("wobjectId") eq "new") ? 1 : $_[0]->get("removeStyle")
-name=>"removeStyle", );
-label=>WebGUI::International::get(6,$_[0]->get("namespace")), $layout->filterContent(
-value=>($_[0]->get("wobjectId") eq "new") ? 1 : $_[0]->get("removeStyle"), -name=>"filterHtml",
-uiLevel=>5 -value=>$_[0]->get("filterHtml")||"javascript"
); );
$properties->select("timeout", \%hash, WebGUI::International::get(4,$_[0]->get("namespace")),[$_[0]->get("timeout")||30]);
$f->select("filterHtml",\%htmlFilter,WebGUI::International::get(7,$_[0]->get("namespace")),[$_[0]->get("filterHtml")||"javascript"]); $properties->text("cookiebox", WebGUI::International::get(9,$_[0]->get("namespace")),$_[0]->get("cookiebox")||'/tmp');
$f->select("timeout", \%hash, WebGUI::International::get(4,$_[0]->get("namespace")),[$_[0]->get("timeout")||30]); $output .= $_[0]->SUPER::www_edit(
$f->text("cookiebox", WebGUI::International::get(9,$_[0]->get("namespace")),$_[0]->get("cookiebox")||'/tmp'); -properties=>$properties->printRowsOnly,
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly); -layout=>$layout->printRowsOnly,
return $output; -privileges=>$privileges->printRowsOnly
} else { );
return WebGUI::Privilege::insufficient(); return $output;
}
} }
#------------------------------------------------------------------- #-------------------------------------------------------------------

View file

@ -58,21 +58,24 @@ sub new {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_edit { sub www_edit {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage()); return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
my ($output, $f, $template); my $template = $_[0]->get("templateId") || 1;
$template = $_[0]->get("templateId") || 1; my $output = helpIcon(1,$_[0]->get("namespace"));
$output = helpIcon(1,$_[0]->get("namespace"));
$output .= '<h1>'.WebGUI::International::get(6,$_[0]->get("namespace")).'</h1>'; $output .= '<h1>'.WebGUI::International::get(6,$_[0]->get("namespace")).'</h1>';
$f = WebGUI::HTMLForm->new; my $properties = WebGUI::HTMLForm->new;
$f->url("linkURL",WebGUI::International::get(1,$_[0]->get("namespace")),$_[0]->get("linkURL")); my $layout = WebGUI::HTMLForm->new;
$f->raw($_[0]->fileProperty("attachment",2)); $properties->url("linkURL",WebGUI::International::get(1,$_[0]->get("namespace")),$_[0]->get("linkURL"));
$f->template( $properties->raw($_[0]->fileProperty("attachment",2));
$layout->template(
-name=>"templateId", -name=>"templateId",
-value=>$template, -value=>$template,
-namespace=>$_[0]->get("namespace"), -namespace=>$_[0]->get("namespace"),
-label=>WebGUI::International::get(72,$_[0]->get("namespace")), -label=>WebGUI::International::get(72,$_[0]->get("namespace")),
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId") -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
); );
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly); $output .= $_[0]->SUPER::www_edit(
-properties=>$properties->printRowsOnly,
-layout=>$layout->printRowsOnly
);
return $output; return $output;
} }

View file

@ -82,24 +82,21 @@ sub www_deleteLinkConfirm {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_edit { sub www_edit {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage()); return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
my ($proceed, $f, $output, $indent, $lineSpacing, $bullet); my $bullet = $_[0]->get("bullet") || '&middot;';
if ($_[0]->get("wobjectId") eq "new") { my $lineSpacing = $_[0]->get("lineSpacing") || 1;
$proceed = 1; my $indent = $_[0]->get("indent") || 5;
} my $output = helpIcon(1,$_[0]->get("namespace"));
$bullet = $_[0]->get("bullet") || '&middot;';
$lineSpacing = $_[0]->get("lineSpacing") || 1;
$indent = $_[0]->get("indent") || 5;
$output = helpIcon(1,$_[0]->get("namespace"));
$output .= '<h1>'.WebGUI::International::get(10,$_[0]->get("namespace")).'</h1>'; $output .= '<h1>'.WebGUI::International::get(10,$_[0]->get("namespace")).'</h1>';
$f = WebGUI::HTMLForm->new; my $layout = WebGUI::HTMLForm->new;
$f->template( my $properties = WebGUI::HTMLForm->new;
$layout->template(
-name=>"templateId", -name=>"templateId",
-value=>$_[0]->get("templateId"), -value=>$_[0]->get("templateId"),
-namespace=>$_[0]->get("namespace"), -namespace=>$_[0]->get("namespace"),
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId") -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
); );
if ($_[0]->get("wobjectId") eq "new") { if ($_[0]->get("wobjectId") eq "new") {
$f->whatNext( $properties->whatNext(
-options=>{ -options=>{
addLink=>WebGUI::International::get(13,$_[0]->get("namespace")), addLink=>WebGUI::International::get(13,$_[0]->get("namespace")),
backToPage=>WebGUI::International::get(745) backToPage=>WebGUI::International::get(745)
@ -107,7 +104,10 @@ sub www_edit {
-value=>"addLink" -value=>"addLink"
); );
} }
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly); $output .= $_[0]->SUPER::www_edit(
-properties=>$properties->printRowsOnly,
-layout=>$layout->printRowsOnly
);
return $output; return $output;
} }

View file

@ -129,7 +129,6 @@ sub www_edit {
foreach my $field (@fields) { foreach my $field (@fields) {
$data{$field} = $_[0]->get($field) if ($_[0]->get($field)); $data{$field} = $_[0]->get($field) if ($_[0]->get($field));
} }
if ($_[0]->get("wobjectId") eq "new") { if ($_[0]->get("wobjectId") eq "new") {
$proceed = 1; $proceed = 1;
} }

View file

@ -73,21 +73,24 @@ sub status {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_edit { sub www_edit {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage()); return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
my ($output, $f, $messagesPerPage); my $messagesPerPage = $_[0]->get("messagesPerPage") || 50;
$messagesPerPage = $_[0]->get("messagesPerPage") || 50; my $output = helpIcon(1,$_[0]->get("namespace"));
$output = helpIcon(1,$_[0]->get("namespace"));
$output .= '<h1>'.WebGUI::International::get(6,$_[0]->get("namespace")).'</h1>'; $output .= '<h1>'.WebGUI::International::get(6,$_[0]->get("namespace")).'</h1>';
$f = WebGUI::HTMLForm->new; my $properties = WebGUI::HTMLForm->new;
$f->integer("messagesPerPage",WebGUI::International::get(4,$_[0]->get("namespace")),$messagesPerPage); my $layout = WebGUI::HTMLForm->new;
$f->template( $layout->integer("messagesPerPage",WebGUI::International::get(4,$_[0]->get("namespace")),$messagesPerPage);
$layout->template(
-name=>"templateId", -name=>"templateId",
-value=>$_[0]->get("templateId"), -value=>$_[0]->get("templateId"),
-namespace=>$_[0]->get("namespace"), -namespace=>$_[0]->get("namespace"),
-label=>WebGUI::International::get(72,$_[0]->get("namespace")), -label=>WebGUI::International::get(72,$_[0]->get("namespace")),
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId") -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
); );
$f->raw($_[0]->SUPER::discussionProperties); $properties->raw($_[0]->SUPER::discussionProperties);
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly); $output .= $_[0]->SUPER::www_edit(
-layout=>$layout->printRowsOnly,
-properties=>$properties->printRowsOnly
);
return $output; return $output;
} }

View file

@ -92,7 +92,7 @@ sub purge {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_edit { sub www_edit {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage()); return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
my ($f, $i, $output, $active, $voteGroup, $graphWidth, $answers, $randomizeAnswers); my ($i, $output, $active, $voteGroup, $graphWidth, $answers, $randomizeAnswers);
if ($_[0]->get("wobjectId") eq "new") { if ($_[0]->get("wobjectId") eq "new") {
$active = 1; $active = 1;
$randomizeAnswers = 1; $randomizeAnswers = 1;
@ -109,19 +109,25 @@ sub www_edit {
} }
$output = helpIcon(1,$_[0]->get("namespace")); $output = helpIcon(1,$_[0]->get("namespace"));
$output .= '<h1>'.WebGUI::International::get(9,$_[0]->get("namespace")).'</h1>'; $output .= '<h1>'.WebGUI::International::get(9,$_[0]->get("namespace")).'</h1>';
$f = WebGUI::HTMLForm->new; my $privileges = WebGUI::HTMLForm->new;
$f->yesNo("active",WebGUI::International::get(3,$_[0]->get("namespace")),$active); my $layout = WebGUI::HTMLForm->new;
$f->group("voteGroup",WebGUI::International::get(4,$_[0]->get("namespace")),[$voteGroup]); my $properties = WebGUI::HTMLForm->new;
$privileges->yesNo("active",WebGUI::International::get(3,$_[0]->get("namespace")),$active);
$privileges->group("voteGroup",WebGUI::International::get(4,$_[0]->get("namespace")),[$voteGroup]);
if ($session{setting}{useKarma}) { if ($session{setting}{useKarma}) {
$f->integer("karmaPerVote",WebGUI::International::get(20,$_[0]->get("namespace")),$_[0]->get("karmaPerVote")); $properties->integer("karmaPerVote",WebGUI::International::get(20,$_[0]->get("namespace")),$_[0]->get("karmaPerVote"));
} else { } else {
$f->hidden("karmaPerVote",$_[0]->get("karmaPerVote")); $properties->hidden("karmaPerVote",$_[0]->get("karmaPerVote"));
} }
$f->integer("graphWidth",WebGUI::International::get(5,$_[0]->get("namespace")),$graphWidth); $layout->integer("graphWidth",WebGUI::International::get(5,$_[0]->get("namespace")),$graphWidth);
$f->text("question",WebGUI::International::get(6,$_[0]->get("namespace")),$_[0]->get("question")); $properties->text("question",WebGUI::International::get(6,$_[0]->get("namespace")),$_[0]->get("question"));
$f->textarea("answers",WebGUI::International::get(7,$_[0]->get("namespace")).'<span class="formSubtext"><br>'.WebGUI::International::get(8,$_[0]->get("namespace")).'</span>',$answers); $properties->textarea("answers",WebGUI::International::get(7,$_[0]->get("namespace")).'<span class="formSubtext"><br>'.WebGUI::International::get(8,$_[0]->get("namespace")).'</span>',$answers);
$f->yesNo("randomizeAnswers",WebGUI::International::get(72,$_[0]->get("namespace")),$randomizeAnswers); $layout->yesNo("randomizeAnswers",WebGUI::International::get(72,$_[0]->get("namespace")),$randomizeAnswers);
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly); $output .= $_[0]->SUPER::www_edit(
-layout=>$layout->printRowsOnly,
-properties=>$properties->printRowsOnly,
-privileges=>$privileges->printRowsOnly
);
if ($_[0]->get("wobjectId") ne "new") { if ($_[0]->get("wobjectId") ne "new") {
$output .= '<p>'; $output .= '<p>';
$output .= '<a href="'.WebGUI::URL::page('func=resetVotes&wid='.$_[0]->get("wobjectId")).'">' $output .= '<a href="'.WebGUI::URL::page('func=resetVotes&wid='.$_[0]->get("wobjectId")).'">'

View file

@ -272,31 +272,35 @@ sub www_deleteSpecificationConfirm {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_edit { sub www_edit {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage()); return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
my ($f, $output, $template); my $output = helpIcon(1,$_[0]->get("namespace"));
$output = helpIcon(1,$_[0]->get("namespace")); my $template;
$output .= '<h1>'.WebGUI::International::get(6,$_[0]->get("namespace")).'</h1>'; $output .= '<h1>'.WebGUI::International::get(6,$_[0]->get("namespace")).'</h1>';
if ($_[0]->get("wobjectId") eq "new") { if ($_[0]->get("wobjectId") eq "new") {
$template = 1; $template = 1;
} else { } else {
$template = $_[0]->get("templateId"); $template = $_[0]->get("templateId");
} }
$f = WebGUI::HTMLForm->new; my $layout = WebGUI::HTMLForm->new;
$f->template( my $properties = WebGUI::HTMLForm->new;
$layout->template(
-name=>"templateId", -name=>"templateId",
-value=>$template, -value=>$template,
-namespace=>$_[0]->get("namespace"), -namespace=>$_[0]->get("namespace"),
-label=>WebGUI::International::get(61,$_[0]->get("namespace")), -label=>WebGUI::International::get(61,$_[0]->get("namespace")),
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId") -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
); );
$f->text("price",WebGUI::International::get(10,$_[0]->get("namespace")),$_[0]->get("price")); $properties->text("price",WebGUI::International::get(10,$_[0]->get("namespace")),$_[0]->get("price"));
$f->text("productNumber",WebGUI::International::get(11,$_[0]->get("namespace")),$_[0]->get("productNumber")); $properties->text("productNumber",WebGUI::International::get(11,$_[0]->get("namespace")),$_[0]->get("productNumber"));
$f->raw($_[0]->fileProperty("image1",7)); $properties->raw($_[0]->fileProperty("image1",7));
$f->raw($_[0]->fileProperty("image2",8)); $properties->raw($_[0]->fileProperty("image2",8));
$f->raw($_[0]->fileProperty("image3",9)); $properties->raw($_[0]->fileProperty("image3",9));
$f->raw($_[0]->fileProperty("brochure",13)); $properties->raw($_[0]->fileProperty("brochure",13));
$f->raw($_[0]->fileProperty("manual",14)); $properties->raw($_[0]->fileProperty("manual",14));
$f->raw($_[0]->fileProperty("warranty",15)); $properties->raw($_[0]->fileProperty("warranty",15));
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly); $output .= $_[0]->SUPER::www_edit(
-properties=>$properties->printRowsOnly,
-layout=>$layout->printRowsOnly
);
return $output; return $output;
} }

View file

@ -69,23 +69,29 @@ sub uiLevel {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_edit { sub www_edit {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage()); return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
my ($output, $f, $dsn, $username, $paginateAfter); my ($output, $dsn, $username, $paginateAfter);
$dsn = $_[0]->get("DSN") || $session{config}{dsn}; $dsn = $_[0]->get("DSN") || $session{config}{dsn};
$username = $_[0]->get("username") || $session{config}{dbuser}; $username = $_[0]->get("username") || $session{config}{dbuser};
$paginateAfter = $_[0]->get("paginateAfter") || 50; $paginateAfter = $_[0]->get("paginateAfter") || 50;
$f = WebGUI::HTMLForm->new; my $privileges = WebGUI::HTMLForm->new;
my $layout = WebGUI::HTMLForm->new;
my $properties = WebGUI::HTMLForm->new;
$output = helpIcon(1,$_[0]->get("namespace")); $output = helpIcon(1,$_[0]->get("namespace"));
$output .= '<h1>'.WebGUI::International::get(8,$_[0]->get("namespace")).'</h1>'; $output .= '<h1>'.WebGUI::International::get(8,$_[0]->get("namespace")).'</h1>';
$f->yesNo("preprocessMacros",WebGUI::International::get(15,$_[0]->get("namespace")),$_[0]->get("preprocessMacros")); $properties->yesNo("preprocessMacros",WebGUI::International::get(15,$_[0]->get("namespace")),$_[0]->get("preprocessMacros"));
$f->yesNo("debugMode",WebGUI::International::get(16,$_[0]->get("namespace")),$_[0]->get("debugMode")); $properties->yesNo("debugMode",WebGUI::International::get(16,$_[0]->get("namespace")),$_[0]->get("debugMode"));
$f->textarea("dbQuery",WebGUI::International::get(4,$_[0]->get("namespace")),$_[0]->get("dbQuery")); $properties->textarea("dbQuery",WebGUI::International::get(4,$_[0]->get("namespace")),$_[0]->get("dbQuery"));
$f->textarea("template",WebGUI::International::get(3,$_[0]->get("namespace")),$_[0]->get("template")); $layout->textarea("template",WebGUI::International::get(3,$_[0]->get("namespace")),$_[0]->get("template"));
$f->text("DSN",WebGUI::International::get(5,$_[0]->get("namespace")),$dsn); $privileges->text("DSN",WebGUI::International::get(5,$_[0]->get("namespace")),$dsn);
$f->text("username",WebGUI::International::get(6,$_[0]->get("namespace")),$username); $privileges->text("username",WebGUI::International::get(6,$_[0]->get("namespace")),$username);
$f->password("identifier",WebGUI::International::get(7,$_[0]->get("namespace")),$_[0]->get("identifier")); $privileges->password("identifier",WebGUI::International::get(7,$_[0]->get("namespace")),$_[0]->get("identifier"));
$f->integer("paginateAfter",WebGUI::International::get(14,$_[0]->get("namespace")),$paginateAfter); $layout->integer("paginateAfter",WebGUI::International::get(14,$_[0]->get("namespace")),$paginateAfter);
$f->yesNo("convertCarriageReturns",WebGUI::International::get(13,$_[0]->get("namespace")),$_[0]->get("convertCarriageReturns")); $layout->yesNo("convertCarriageReturns",WebGUI::International::get(13,$_[0]->get("namespace")),$_[0]->get("convertCarriageReturns"));
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly); $output .= $_[0]->SUPER::www_edit(
-layout=>$layout->printRowsOnly,
-properties=>$properties->printRowsOnly,
-privileges=>$privileges->printRowsOnly
);
return $output; return $output;
} }

View file

@ -88,7 +88,7 @@ sub new {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_edit { sub www_edit {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage()); return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
my ($output, $f, $indent, $startLevel); my ($output, $indent, $startLevel);
if ($_[0]->get("wobjectId") eq "new") { if ($_[0]->get("wobjectId") eq "new") {
$startLevel = 1; $startLevel = 1;
} else { } else {
@ -99,7 +99,7 @@ sub www_edit {
$indent = $_[0]->get("indent") || 5; $indent = $_[0]->get("indent") || 5;
$output = helpIcon(1,$_[0]->get("namespace")); $output = helpIcon(1,$_[0]->get("namespace"));
$output .= '<h1>'.WebGUI::International::get(5,$_[0]->get("namespace")).'</h1>'; $output .= '<h1>'.WebGUI::International::get(5,$_[0]->get("namespace")).'</h1>';
$f = WebGUI::HTMLForm->new; my $f = WebGUI::HTMLForm->new;
$f->template( $f->template(
-name=>"templateId", -name=>"templateId",
-value=>$_[0]->get("templateId"), -value=>$_[0]->get("templateId"),
@ -118,7 +118,7 @@ sub www_edit {
); );
$f->integer("depth",WebGUI::International::get(4,$_[0]->get("namespace")),$_[0]->get("depth")); $f->integer("depth",WebGUI::International::get(4,$_[0]->get("namespace")),$_[0]->get("depth"));
$f->integer("indent",WebGUI::International::get(6,$_[0]->get("namespace")),$indent); $f->integer("indent",WebGUI::International::get(6,$_[0]->get("namespace")),$indent);
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly); $output .= $_[0]->SUPER::www_edit(-layout=>$f->printRowsOnly);
return $output; return $output;
} }

View file

@ -206,7 +206,7 @@ sub www_deleteAllResponsesConfirm {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_edit { sub www_edit {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage()); return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
my ($f, $output, $surveyId, $questionOrder, $mode, $groupToViewReports, $sth, %data, $groupToTakeSurvey); my ($output, $surveyId, $questionOrder, $mode, $groupToViewReports, $sth, %data, $groupToTakeSurvey);
tie %data, 'Tie::CPHash'; tie %data, 'Tie::CPHash';
$mode = $_[0]->get("mode") || "survey"; $mode = $_[0]->get("mode") || "survey";
$questionOrder = $_[0]->get("questionOrder") || "sequential"; $questionOrder = $_[0]->get("questionOrder") || "sequential";
@ -215,9 +215,11 @@ sub www_edit {
$surveyId = $_[0]->get("Survey_id") || getNextId("Survey_id"); $surveyId = $_[0]->get("Survey_id") || getNextId("Survey_id");
$output = helpIcon(1,$_[0]->get("namespace")); $output = helpIcon(1,$_[0]->get("namespace"));
$output .= '<h1>'.WebGUI::International::get(2,$_[0]->get("namespace")).'</h1>'; $output .= '<h1>'.WebGUI::International::get(2,$_[0]->get("namespace")).'</h1>';
$f = WebGUI::HTMLForm->new; my $properties = WebGUI::HTMLForm->new;
$f->hidden("Survey_id",$surveyId); my $layout = WebGUI::HTMLForm->new;
$f->select( my $privileges = WebGUI::HTMLForm->new;
$properties->hidden("Survey_id",$surveyId);
$layout->select(
-name=>"questionOrder", -name=>"questionOrder",
-options=>{ -options=>{
sequential => WebGUI::International::get(5,$_[0]->get("namespace")), sequential => WebGUI::International::get(5,$_[0]->get("namespace")),
@ -227,7 +229,7 @@ sub www_edit {
-label=>WebGUI::International::get(8,$_[0]->get("namespace")), -label=>WebGUI::International::get(8,$_[0]->get("namespace")),
-value=>[$questionOrder] -value=>[$questionOrder]
); );
$f->select( $properties->select(
-name=>"mode", -name=>"mode",
-options=>{ -options=>{
survey => WebGUI::International::get(9,$_[0]->get("namespace")), survey => WebGUI::International::get(9,$_[0]->get("namespace")),
@ -236,18 +238,18 @@ sub www_edit {
-label=>WebGUI::International::get(11,$_[0]->get("namespace")), -label=>WebGUI::International::get(11,$_[0]->get("namespace")),
-value=>[$mode] -value=>[$mode]
); );
$f->group( $privileges->group(
-name=>"groupToTakeSurvey", -name=>"groupToTakeSurvey",
-value=>[$groupToTakeSurvey], -value=>[$groupToTakeSurvey],
-label=>WebGUI::International::get(12,$_[0]->get("namespace")) -label=>WebGUI::International::get(12,$_[0]->get("namespace"))
); );
$f->group( $privileges->group(
-name=>"groupToViewReports", -name=>"groupToViewReports",
-label=>WebGUI::International::get(13,$_[0]->get("namespace")), -label=>WebGUI::International::get(13,$_[0]->get("namespace")),
-value=>[$groupToViewReports] -value=>[$groupToViewReports]
); );
if ($_[0]->get("wobjectId") eq "new") { if ($_[0]->get("wobjectId") eq "new") {
$f->whatNext( $properties->whatNext(
-options=>{ -options=>{
addQuestion=>WebGUI::International::get(28,$_[0]->get("namespace")), addQuestion=>WebGUI::International::get(28,$_[0]->get("namespace")),
backToPage=>WebGUI::International::get(745) backToPage=>WebGUI::International::get(745)
@ -255,7 +257,11 @@ sub www_edit {
-value=>"addQuestion" -value=>"addQuestion"
); );
} }
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly); $output .= $_[0]->SUPER::www_edit(
-properties=>$properties->printRowsOnly,
-layout=>$layout->printRowsOnly,
-privileges=>$privileges->printRowsOnly
);
if ($_[0]->get("wobjectId") ne "new") { if ($_[0]->get("wobjectId") ne "new") {
$output .= '<a href="'.WebGUI::URL::page('wid='.$_[0]->get("wobjectId").'&func=editQuestion&qid=new') $output .= '<a href="'.WebGUI::URL::page('wid='.$_[0]->get("wobjectId").'&func=editQuestion&qid=new')
.'">'.WebGUI::International::get(30,$_[0]->get("namespace")).'</a><p>'; .'">'.WebGUI::International::get(30,$_[0]->get("namespace")).'</a><p>';

View file

@ -43,7 +43,6 @@ sub duplicate {
submissionsPerPage=>$_[0]->get("submissionsPerPage"), submissionsPerPage=>$_[0]->get("submissionsPerPage"),
defaultStatus=>$_[0]->get("defaultStatus"), defaultStatus=>$_[0]->get("defaultStatus"),
groupToApprove=>$_[0]->get("groupToApprove"), groupToApprove=>$_[0]->get("groupToApprove"),
allowDiscussion=>$_[0]->get("allowDiscussion"),
karmaPerSubmission=>$_[0]->get("karmaPerSubmission"), karmaPerSubmission=>$_[0]->get("karmaPerSubmission"),
templateId=>$_[0]->get("templateId"), templateId=>$_[0]->get("templateId"),
submissionTemplateId=>$_[0]->get("submissionTemplateId") submissionTemplateId=>$_[0]->get("submissionTemplateId")
@ -174,40 +173,47 @@ sub www_denySubmission {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_edit { sub www_edit {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage()); return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
my ($output, $f, $defaultStatus, $submissionsPerPage, $groupToApprove); my ($output, $defaultStatus, $submissionsPerPage, $groupToApprove);
$groupToApprove = $_[0]->get("groupToApprove") || 4; $groupToApprove = $_[0]->get("groupToApprove") || 4;
$submissionsPerPage = $_[0]->get("submissionsPerPage") || 50; $submissionsPerPage = $_[0]->get("submissionsPerPage") || 50;
$defaultStatus = $_[0]->get("defaultStatus") || "Approved"; $defaultStatus = $_[0]->get("defaultStatus") || "Approved";
$output = helpIcon(1,$_[0]->get("namespace")); $output = helpIcon(1,$_[0]->get("namespace"));
$output .= '<h1>'.WebGUI::International::get(18,$_[0]->get("namespace")).'</h1>'; $output .= '<h1>'.WebGUI::International::get(18,$_[0]->get("namespace")).'</h1>';
$f = WebGUI::HTMLForm->new; my $layout = WebGUI::HTMLForm->new;
$f->template( my $privileges = WebGUI::HTMLForm->new;
my $properties = WebGUI::HTMLForm->new;
$layout->template(
-name=>"templateId", -name=>"templateId",
-value=>$_[0]->get("templateId"), -value=>$_[0]->get("templateId"),
-namespace=>$_[0]->get("namespace"), -namespace=>$_[0]->get("namespace"),
-label=>WebGUI::International::get(72,$_[0]->get("namespace")), -label=>WebGUI::International::get(72,$_[0]->get("namespace")),
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId") -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
); );
$f->template( $layout->template(
-name=>"submissionTemplateId", -name=>"submissionTemplateId",
-value=>$_[0]->get("submissionTemplateId"), -value=>$_[0]->get("submissionTemplateId"),
-namespace=>$_[0]->get("namespace")."/Submission", -namespace=>$_[0]->get("namespace")."/Submission",
-label=>WebGUI::International::get(73,$_[0]->get("namespace")), -label=>WebGUI::International::get(73,$_[0]->get("namespace")),
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId") -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
); );
$f->group("groupToApprove",WebGUI::International::get(1,$_[0]->get("namespace")),[$groupToApprove]); $privileges->group("groupToApprove",WebGUI::International::get(1,$_[0]->get("namespace")),[$groupToApprove]);
$f->group("groupToContribute",WebGUI::International::get(2,$_[0]->get("namespace")),[$_[0]->get("groupToContribute")]); $privileges->group("groupToContribute",WebGUI::International::get(2,$_[0]->get("namespace")),[$_[0]->get("groupToContribute")]);
$f->integer("submissionsPerPage",WebGUI::International::get(6,$_[0]->get("namespace")),$submissionsPerPage); $layout->integer("submissionsPerPage",WebGUI::International::get(6,$_[0]->get("namespace")),$submissionsPerPage);
$f->select("defaultStatus",{Approved=>status('Approved'),Denied=>status('Denied'),Pending=>status('Pending')} $privileges->select("defaultStatus",{Approved=>status('Approved'),Denied=>status('Denied'),Pending=>status('Pending')}
,WebGUI::International::get(563),[$defaultStatus]); ,WebGUI::International::get(563),[$defaultStatus]);
if ($session{setting}{useKarma}) { if ($session{setting}{useKarma}) {
$f->integer("karmaPerSubmission",WebGUI::International::get(30,$_[0]->get("namespace")),$_[0]->get("karmaPerSubmission")); $properties->integer("karmaPerSubmission",WebGUI::International::get(30,$_[0]->get("namespace")),$_[0]->get("karmaPerSubmission"));
} else { } else {
$f->hidden("karmaPerSubmission",$_[0]->get("karmaPerSubmission")); $properties->hidden("karmaPerSubmission",$_[0]->get("karmaPerSubmission"));
} }
$f->yesNo("allowDiscussion",WebGUI::International::get(48,$_[0]->get("namespace")),$_[0]->get("allowDiscussion")); $layout->filterContent(
$f->raw($_[0]->SUPER::discussionProperties); -value=>$_[0]->get("filterContent")
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly); );
$output .= $_[0]->SUPER::www_edit(
-layout=>$layout->printRowsOnly,
-privileges=>$privileges->printRowsOnly,
-properties=>$properties->printRowsOnly
);
return $output; return $output;
} }
@ -220,9 +226,9 @@ sub www_editSave {
groupToApprove=>$session{form}{groupToApprove}, groupToApprove=>$session{form}{groupToApprove},
defaultStatus=>$session{form}{defaultStatus}, defaultStatus=>$session{form}{defaultStatus},
karmaPerSubmission=>$session{form}{karmaPerSubmission}, karmaPerSubmission=>$session{form}{karmaPerSubmission},
allowDiscussion=>$session{form}{allowDiscussion},
templateId=>$session{form}{templateId}, templateId=>$session{form}{templateId},
submissionTemplateId=>$session{form}{submissionTemplateId} submissionTemplateId=>$session{form}{submissionTemplateId},
filterContent=>$session{form}{filterContent}
}); });
return ""; return "";
} }
@ -357,7 +363,7 @@ sub www_view {
$page = $p->getPageData; $page = $p->getPageData;
$i = 0; $i = 0;
foreach $row (@$page) { foreach $row (@$page) {
$page->[$i]->{content} = WebGUI::HTML::filter($page->[$i]->{content},$session{setting}{filterContributedHTML}); $page->[$i]->{content} = WebGUI::HTML::filter($page->[$i]->{content},$_[0]->get("filterContent"));
$page->[$i]->{content} =~ s/\n/\^\-\;/ unless ($page->[$i]->{content} =~ m/\^\-\;/); $page->[$i]->{content} =~ s/\n/\^\-\;/ unless ($page->[$i]->{content} =~ m/\^\-\;/);
@content = split(/\^\-\;/,$page->[$i]->{content}); @content = split(/\^\-\;/,$page->[$i]->{content});
if ($page->[$i]->{image} ne "") { if ($page->[$i]->{image} ne "") {
@ -406,7 +412,7 @@ sub www_viewSubmission {
return $_[0]->www_view unless ($submission->{USS_submissionId}); return $_[0]->www_view unless ($submission->{USS_submissionId});
WebGUI::SQL->write("update USS_submission set views=views+1 where USS_submissionId=$session{form}{sid}"); WebGUI::SQL->write("update USS_submission set views=views+1 where USS_submissionId=$session{form}{sid}");
$var{title} = $submission->{title}; $var{title} = $submission->{title};
$var{content} = WebGUI::HTML::filter($submission->{content},$session{setting}{filterContributedHTML}); $var{content} = WebGUI::HTML::filter($submission->{content},$_[0]->get("filterContent"));
$var{content} =~ s/\^\-\;//g; $var{content} =~ s/\^\-\;//g;
$var{content} =~ s/\n/\<br\>/g if ($submission->{convertCarriageReturns}); $var{content} =~ s/\n/\<br\>/g if ($submission->{convertCarriageReturns});
$var{"user.label"} = WebGUI::International::get(21,$_[0]->get("namespace")); $var{"user.label"} = WebGUI::International::get(21,$_[0]->get("namespace"));

View file

@ -13,13 +13,13 @@ package WebGUI::Wobject::WobjectProxy;
use strict; use strict;
use Tie::CPHash; use Tie::CPHash;
use WebGUI::DateTime; use WebGUI::DateTime;
use WebGUI::HTMLForm;
use WebGUI::Icon; use WebGUI::Icon;
use WebGUI::International; use WebGUI::International;
use WebGUI::Privilege; use WebGUI::Privilege;
use WebGUI::Session; use WebGUI::Session;
use WebGUI::SQL; use WebGUI::SQL;
use WebGUI::Page; use WebGUI::Page;
use WebGUI::TabForm;
use WebGUI::Template; use WebGUI::Template;
use WebGUI::Wobject; use WebGUI::Wobject;
@ -70,14 +70,29 @@ sub www_edit {
$templatePosition = $_[0]->get("templatePosition") || 1; $templatePosition = $_[0]->get("templatePosition") || 1;
$startDate = $_[0]->get("startDate") || $session{page}{startDate}; $startDate = $_[0]->get("startDate") || $session{page}{startDate};
$endDate = $_[0]->get("endDate") || $session{page}{endDate}; $endDate = $_[0]->get("endDate") || $session{page}{endDate};
$f = WebGUI::HTMLForm->new; my %tabs;
$f->hidden("wid",$_[0]->get("wobjectId")); tie %tabs, 'Tie::IxHash';
$f->hidden("namespace",$_[0]->get("namespace")) if ($_[0]->get("wobjectId") eq "new"); %tabs = (
$f->hidden("func","editSave"); properties=>{
$f->readOnly($_[0]->get("wobjectId"),WebGUI::International::get(499)); label=>WebGUI::International::get(893)
$f->hidden("title",$_[0]->get("namespace")); },
$f->hidden("displayTitle",0); layout=>{
$f->select( 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($_[0]->get("wobjectId"),WebGUI::International::get(499));
$f->hidden({name=>"title",value=>$_[0]->name});
$f->hidden({name=>"displayTitle",value=>0});
$f->getTab("layout")->select(
-name=>"templatePosition", -name=>"templatePosition",
-label=>WebGUI::International::get(363), -label=>WebGUI::International::get(363),
-value=>[$templatePosition], -value=>[$templatePosition],
@ -85,9 +100,9 @@ sub www_edit {
-options=>WebGUI::Page::getTemplatePositions($session{page}{templateId}), -options=>WebGUI::Page::getTemplatePositions($session{page}{templateId}),
-subtext=>WebGUI::Page::drawTemplate($session{page}{templateId}) -subtext=>WebGUI::Page::drawTemplate($session{page}{templateId})
); );
$f->date("startDate",WebGUI::International::get(497),$startDate); $f->getTab("privileges")->date("startDate",WebGUI::International::get(497),$startDate);
$f->date("endDate",WebGUI::International::get(498),$endDate); $f->getTab("privileges")->date("endDate",WebGUI::International::get(498),$endDate);
$a = WebGUI::SQL->read("select pageId,menuTitle from page where pageId<2 or pageId>25 order by title"); $a = WebGUI::SQL->read("select pageId,menuTitle from page where pageId<2 or pageId>25 order by menuTitle");
while (%page = $a->hash) { while (%page = $a->hash) {
$b = WebGUI::SQL->read("select wobjectId,title from wobject $b = WebGUI::SQL->read("select wobjectId,title from wobject
where pageId=".$page{pageId}." and namespace<>'WobjectProxy' and where pageId=".$page{pageId}." and namespace<>'WobjectProxy' and
@ -98,8 +113,7 @@ sub www_edit {
$b->finish; $b->finish;
} }
$a->finish; $a->finish;
$f->select("proxiedWobjectId",\%wobjects,WebGUI::International::get(1,$_[0]->get("namespace")),[$_[0]->get("proxiedWobjectId")]); $f->getTab("properties")->select("proxiedWobjectId",\%wobjects,WebGUI::International::get(1,$_[0]->get("namespace")),[$_[0]->get("proxiedWobjectId")]);
$f->submit;
$output .= $f->print; $output .= $f->print;
return $output; return $output;
} }