Form inheritance work for lists, removal of $session{os}{slash}

This commit is contained in:
Colin Kuskie 2005-12-01 20:46:55 +00:00
parent abe85d439e
commit 99df1f414e
90 changed files with 1364 additions and 1168 deletions

View file

@ -115,7 +115,7 @@ sub getEditForm {
name=>"interval",
defaultValue=>1
})
.WebGUI::Form::selectList({
.WebGUI::Form::selectBox({
name=>"recursEvery",
options=>\%recursEvery
})

View file

@ -65,7 +65,7 @@ sub unzip {
}
$zip->extractTree();
} elsif($filename =~ m/\.tar/i){
Archive::Tar->extract_archive($filepath.$session{os}{slash}.$filename,1);
Archive::Tar->extract_archive($filepath.'/'.$filename,1);
if (Archive::Tar->error){
WebGUI::ErrorHandler::warn(Archive::Tar->error);
return 0;

View file

@ -115,7 +115,7 @@ sub edit {
$clause = "userId=".quote($self->get("ownerUserId"));
}
my $users = WebGUI::SQL->buildHashRef("select userId,username from users where $clause order by username");
$tabform->getTab("security")->selectList(
$tabform->getTab("security")->selectBox(
-name=>"ownerUserId",
-options=>$users,
-label=>WebGUI::International::get(108,"Asset_FilePile"),

View file

@ -108,11 +108,11 @@ sub definition {
defaultValue=>0
},
directionality=>{
fieldType=>'selectList',
fieldType=>'selectBox',
defaultValue=>'ltr'
},
toolbarLocation=>{
fieldType=>'selectList',
fieldType=>'selectBox',
defaultValue=>'bottom'
},
cssFile=>{
@ -120,15 +120,15 @@ sub definition {
defaultValue=>undef
},
toolbarRow1=>{
fieldType=>'checkList',
fieldType=>'checkBox',
defaultValue=>undef
},
toolbarRow2=>{
fieldType=>'checkList',
fieldType=>'checkBox',
defaultValue=>undef
},
toolbarRow3=>{
fieldType=>'checkList',
fieldType=>'checkBox',
defaultValue=>undef
},
enableContextMenu => {
@ -332,7 +332,7 @@ sub getEditForm {
-name=>"nowrap",
-uiLevel=>9
);
$tabform->getTab("properties")->selectList(
$tabform->getTab("properties")->selectBox(
-value=>[$self->getValue("directionality")],
-label=>WebGUI::International::get('directionality', 'Asset_RichEdit'),
-hoverHelp=>WebGUI::International::get('directionality description', 'Asset_RichEdit'),
@ -342,7 +342,7 @@ sub getEditForm {
rtl=>WebGUI::International::get('right to left', 'Asset_RichEdit'),
}
);
$tabform->getTab("display")->selectList(
$tabform->getTab("display")->selectBox(
-value=>[$self->getValue("toolbarLocation")],
-label=>WebGUI::International::get('toolbar location', 'Asset_RichEdit'),
-hoverHelp=>WebGUI::International::get('toolbar location description', 'Asset_RichEdit'),

View file

@ -56,7 +56,7 @@ sub _drawQueryBuilder {
value=>$self->getValue("shortcutCriteria"),
extras=>'style="width: 100%" '.$self->{_disabled}
});
my $conjunctionField = WebGUI::Form::selectList({
my $conjunctionField = WebGUI::Form::selectBox({
name=>"conjunction",
options=>{
"AND" => WebGUI::International::get("AND","Asset_Shortcut"),
@ -208,7 +208,7 @@ sub definition {
defaultValue=>0
},
resolveMultiples=>{
fieldType=>"selectList",
fieldType=>"selectBox",
defaultValue=>"mostRecent",
},
shortcutCriteria=>{
@ -313,7 +313,7 @@ sub getEditForm {
if ($self->getValue("shortcutByCriteria") == 0) {
$self->{_disabled} = 'disabled=true';
}
$tabform->getTab("properties")->selectList(
$tabform->getTab("properties")->selectBox(
-name=>"resolveMultiples",
-value=>[ $self->getValue("resolveMultiples") ],
-label=>WebGUI::International::get("Resolve Multiples","Asset_Shortcut"),

View file

@ -229,7 +229,7 @@ sub process {
return $self->processRaw($self->get("template"),$vars);
# skip all the junk below here for now until we have time to bring it inline with the new system
my $file = _getTemplateFile($self->get("templateId"));
my $fileCacheDir = $session{config}{uploadsPath}.$session{os}{slash}."temp".$session{os}{slash}."templatecache";
my $fileCacheDir = $session{config}{uploadsPath}.'/temp/templatecache';
my %params = (
filename=>$file->getPath,
global_vars=>1,

View file

@ -352,7 +352,7 @@ sub definition {
defaultValue=>'javascript'
},
richEditor =>{
fieldType=>"selectList",
fieldType=>"selectBox",
defaultValue=>"PBrichedit000000000002"
},
attachmentsPerPost =>{
@ -372,11 +372,11 @@ sub definition {
defaultValue=>1
},
sortOrder =>{
fieldType=>"selectList",
fieldType=>"selectBox",
defaultValue=>'desc'
},
sortBy =>{
fieldType=>"selectList",
fieldType=>"selectBox",
defaultValue=>'dateUpdated'
},
rssTemplateId =>{
@ -574,14 +574,14 @@ sub getEditForm {
userDefined4=>WebGUI::International::get('user defined 4', 'Asset_Collaboration'),
userDefined5=>WebGUI::International::get('user defined 5', 'Asset_Collaboration'),
);
$tabform->getTab("display")->selectList(
$tabform->getTab("display")->selectBox(
-name=>"sortBy",
-value=>[$self->getValue("sortBy")],
-options=>\%options,
-label=>WebGUI::International::get('sort by', 'Asset_Collaboration'),
-hoverHelp=>WebGUI::International::get('sort by description', 'Asset_Collaboration'),
);
$tabform->getTab("display")->selectList(
$tabform->getTab("display")->selectBox(
-name=>"sortOrder",
-value=>[$self->getValue("sortOrder")],
-options=>{
@ -621,7 +621,7 @@ sub getEditForm {
-hoverHelp=>WebGUI::International::get('edit stamp description', 'Asset_Collaboration'),
-value=>$self->getValue("addEditStampToPosts")
);
$tabform->getTab("display")->selectList(
$tabform->getTab("display")->selectBox(
-name=>"richEditor",
-label=>WebGUI::International::get('rich editor', 'Asset_Collaboration'),
-hoverHelp=>WebGUI::International::get('rich editor description', 'Asset_Collaboration'),
@ -1015,7 +1015,7 @@ sub www_search {
tie %results, 'Tie::IxHash';
%results = (10=>'10', 25=>'25', 50=>'50', 100=>'100');
my $numResults = $session{scratch}{$self->getId."_numResults"} || $self->get("threadsPerPage");
$var{'results.form'} = WebGUI::Form::selectList({
$var{'results.form'} = WebGUI::Form::selectBox({
name=>"numResults",
options=>\%results,
value=>[$numResults]

View file

@ -799,7 +799,7 @@ sub www_editField {
-value=>$field{sequenceNumber}
);
}
$f->selectList(
$f->selectBox(
-name=>"tid",
-options=>$tab,
-label=>WebGUI::International::get(104,"Asset_DataForm"),
@ -812,7 +812,7 @@ sub www_editField {
-label=>WebGUI::International::get(79,"Asset_DataForm"),
-hoverHelp=>WebGUI::International::get('79 description',"Asset_DataForm"),
);
$f->selectList(
$f->selectBox(
-name=>"status",
-options=>\%fieldStatus,
-label=>WebGUI::International::get(22,"Asset_DataForm"),

View file

@ -58,19 +58,19 @@ sub definition {
defaultValue=>'PBtmpl0000000000000023'
},
scope =>{
fieldType=>"selectList",
fieldType=>"selectBox",
defaultValue=>'0'
},
startMonth=>{
fieldType=>"selectList",
fieldType=>"selectBox",
defaultValue=>"current"
},
endMonth=>{
fieldType=>"selectList",
fieldType=>"selectBox",
defaultValue=>"after12"
},
defaultMonth=>{
fieldType=>"selectList",
fieldType=>"selectBox",
defaultValue=>"current"
},
paginateAfter=>{
@ -89,7 +89,7 @@ sub definition {
sub getEditForm {
my $self = shift;
my $tabform = $self->SUPER::getEditForm();
$tabform->getTab("properties")->selectList(
$tabform->getTab("properties")->selectBox(
-name=>"scope",
-label=>WebGUI::International::get(507,"Asset_EventsCalendar"),
-hoverHelp=>WebGUI::International::get('507 description',"Asset_EventsCalendar"),
@ -114,7 +114,7 @@ sub getEditForm {
-value=>$self->getValue('eventTemplateId'),
-namespace=>"EventsCalendar/Event",
);
$tabform->getTab("display")->selectList(
$tabform->getTab("display")->selectBox(
-name=>"startMonth",
-options=>{
"january"=>WebGUI::International::get('january','Asset_EventsCalendar'),
@ -136,14 +136,14 @@ sub getEditForm {
"after3"=>WebGUI::International::get(89,"Asset_EventsCalendar"),
"current"=>WebGUI::International::get(82,"Asset_EventsCalendar")
);
$tabform->getTab("display")->selectList(
$tabform->getTab("display")->selectBox(
-name=>"endMonth",
-options=>\%options,
-label=>WebGUI::International::get(84,"Asset_EventsCalendar"),
-hoverHelp=>WebGUI::International::get('84 description',"Asset_EventsCalendar"),
-value=>[$self->getValue("endMonth")]
);
$tabform->getTab("display")->selectList(
$tabform->getTab("display")->selectBox(
-name=>"defaultMonth",
-options=>{
"current"=>WebGUI::International::get(82,"Asset_EventsCalendar"),

View file

@ -48,7 +48,7 @@ sub definition {
defaultValue=>'http://'
},
timeout=>{
fieldType=>"selectList",
fieldType=>"selectBox",
defaultValue=>30
},
removeStyle=>{
@ -149,7 +149,7 @@ sub getEditForm {
-name=>"filterHtml",
-value=>$self->getValue("filterHtml")
);
$tabform->getTab("properties")->selectList(
$tabform->getTab("properties")->selectBox(
-name=>"timeout",
-options=>\%hash,
-label=>WebGUI::International::get(4,"Asset_HttpProxy"),

View file

@ -184,7 +184,7 @@ sub view {
$nameHash{""} = WebGUI::International::get('myself',"Asset_InOutBoard");
%nameHash = WebGUI::Utility::sortHash(%nameHash);
$f->selectList(
$f->selectBox(
-name=>"delegate",
-options=>\%nameHash,
-value=>[ $session{scratch}{userId} ],
@ -412,7 +412,7 @@ sub www_viewReport {
my $departmentSQLclause = ($defaultDepartment eq WebGUI::International::get('all departments', 'Asset_InOutBoard'))
? ''
: 'and c.fieldData='.quote($defaultDepartment);
$f->selectList(
$f->selectBox(
-name=>"selectDepartment",
-options=>\%depHash,
-value=>[ $defaultDepartment ],
@ -422,7 +422,7 @@ sub www_viewReport {
tie %paginHash, "Tie::IxHash"; ##Because default sort order is alpha
%paginHash = (50 => 50, 100 => 100, 300 => 300, 500 => 500, 1000 => 1000, 10_000 => 10_000,);
my $pageReportAfter = $session{form}{reportPagination} || 50;
$f->selectList(
$f->selectBox(
-name=>"reportPagination",
-options=>\%paginHash,
-value=>[ $pageReportAfter ],

View file

@ -477,7 +477,7 @@ sub www_editListing {
-label=>"Description"
);
if ($self->canEdit) {
$f->selectList(
$f->selectBox(
-name=>"maintainerId",
-value=>[$listing->{maintainerId}],
-label=>"Listing Maintainer",
@ -507,7 +507,7 @@ sub www_editListing {
);
} elsif ($field->{fieldType} eq "goodBad") {
my $value = ($field->{value} || $field->{defaultValue} || "No");
$f->selectList(
$f->selectBox(
-name=>$field->{name},
-value=>[$value],
-label=>$field->{label},
@ -617,7 +617,7 @@ sub www_editListingSave {
while (my ($id, $name, $type) = $a->array) {
my $value;
if ($type eq "goodBad") {
$value = WebGUI::FormProcessor::selectList($name);
$value = WebGUI::FormProcessor::selectBox($name);
} else {
$value = WebGUI::FormProcessor::process($name,$type);
}
@ -652,7 +652,7 @@ sub www_editField {
-value=>$field->{label},
-label=>"Label"
);
$f->selectList(
$f->selectBox(
-name=>"fieldType",
-value=>[$field->{fieldType}],
-label=>"Type",
@ -678,7 +678,7 @@ sub www_editField {
foreach my $category ($self->getCategories) {
$cats{$category} = $category;
}
$f->selectList(
$f->selectBox(
-name=>"category",
-value=>[$field->{category}],
-label=>"Category",
@ -982,7 +982,7 @@ sub www_viewDetail {
-value=>$session{user}{email},
-label=>"Your Email Address"
);
$f->selectList(
$f->selectBox(
-name=>"subject",
-extras=>'class="content"',
-options=>{
@ -1051,7 +1051,7 @@ sub www_viewDetail {
my ($mean,$median,$count) = WebGUI::SQL->quickArray("select meanValue, medianValue, countValue from Matrix_ratingSummary
where listingId=".quote($listingId)." and category=".quote($category));
$ratingsTable .= '<tr><th>'.$category.'</th><td>'.$mean.'</td><td>'.$median.'</td><td>'.$count.'</td></tr>';
$f->selectList(
$f->selectBox(
-name=>$category,
-label=>$category,
-value=>[5],

View file

@ -46,7 +46,7 @@ sub definition {
defaultValue=>"descendants"
},
startType=>{
fieldType=>'selectList',
fieldType=>'selectBox',
defaultValue=>"relativeToCurrentUrl"
},
startPoint=>{
@ -54,11 +54,11 @@ sub definition {
defaultValue=>0
},
ancestorEndPoint=>{
fieldType=>'selectList',
fieldType=>'selectBox',
defaultValue=>55
},
descendantEndPoint=>{
fieldType=>'selectList',
fieldType=>'selectBox',
defaultValue=>55
},
showSystemPages=>{
@ -110,7 +110,7 @@ sub getEditForm {
$pedigreeChecked = 1;
}
}
$tabform->getTab("properties")->selectList(
$tabform->getTab("properties")->selectBox(
-name=>"startType",
-options=>{
specificUrl=>$i18n->get('Specific URL'),
@ -140,7 +140,7 @@ sub getEditForm {
);
$tabform->getTab("properties")->raw(
'</tbody><tbody id="navAncestorEnd"><tr><td class="formDescription">'.$i18n->get("Ancestor End Point").'</td><td>'
.WebGUI::Form::selectList({
.WebGUI::Form::selectBox({
name=>"ancestorEndPoint",
value=>[$self->getValue("ancestorEndPoint")],
options=>\%options
@ -190,7 +190,7 @@ sub getEditForm {
);
$tabform->getTab("properties")->raw(
'</tbody><tbody id="navDescendantEnd"><tr><td class="formDescription">'.$i18n->get('Descendant End Point').'</td><td>'
.WebGUI::Form::selectList({
.WebGUI::Form::selectBox({
name=>"descendantEndPoint",
value=>[$self->getValue("descendantEndPoint")],
options=>\%options

View file

@ -365,7 +365,7 @@ sub www_addAccessory {
@usedAccessories = WebGUI::SQL->buildArray("select accessoryAssetId from Product_accessory where assetId=".quote($self->getId));
push(@usedAccessories,$self->getId);
$accessory = WebGUI::SQL->buildHashRef("select asset.assetId, assetData.title from asset left join assetData on assetData.assetId=asset.assetId where asset.className='WebGUI::Asset::Wobject::Product' and asset.assetId not in (".quoteAndJoin(\@usedAccessories).") and (assetData.status='approved' or assetData.tagId=".quote($session{scratch}{versionTag}).") group by assetData.assetId");
$f->selectList(
$f->selectBox(
-name => "accessoryAccessId",
-options => $accessory,
-label => WebGUI::International::get(17,'Asset_Product'),
@ -404,7 +404,7 @@ sub www_addRelated {
@usedRelated = WebGUI::SQL->buildArray("select relatedAssetId from Product_related where assetId=".quote($self->getId));
push(@usedRelated,$self->getId);
$related = WebGUI::SQL->buildHashRef("select assetId,title from asset where className='WebGUI::Asset::Wobject::Product' and assetId not in (".quoteAndJoin(\@usedRelated).")");
$f->selectList(
$f->selectBox(
-name => "relatedAssetId",
-options => $related,
-label => WebGUI::International::get(20,'Asset_Product'),

View file

@ -246,7 +246,7 @@ sub getEditForm {
-afterEdit => 'func=edit'
);
$tabform->getTab('display')->selectList(
$tabform->getTab('display')->selectBox(
-name => "questionOrder",
-options => {
sequential => WebGUI::International::get(5,'Asset_Survey'),
@ -264,7 +264,7 @@ sub getEditForm {
-label => WebGUI::International::get(83,'Asset_Survey'),
-hoverHelp => WebGUI::International::get('83 description','Asset_Survey')
);
$tabform->getTab('properties')->selectList(
$tabform->getTab('properties')->selectBox(
-name => "mode",
-options => {
survey => WebGUI::International::get(9,'Asset_Survey'),
@ -854,7 +854,7 @@ sub www_editAnswer {
$question = WebGUI::SQL->buildHashRef("select Survey_questionId,question
from Survey_question where Survey_id=".quote($self->get("Survey_id"))." order by sequenceNumber");
$question = { ('-1' => WebGUI::International::get(82,'Asset_Survey'),%$question) };
$f->selectList(
$f->selectBox(
-name=>"gotoQuestion",
-options=>$question,
-value=>[$answer->{gotoQuestion}],
@ -956,7 +956,7 @@ sub www_editQuestion {
my $sectionList = WebGUI::SQL->buildHashRef("select Survey_sectionId,sectionName
from Survey_section where Survey_id=".quote($self->get("Survey_id"))." order by sequenceNumber");
$f->selectList(
$f->selectBox(
-name => "section",
-options=> $sectionList,
-value => [$question->{Survey_sectionId}],
@ -967,7 +967,7 @@ sub www_editQuestion {
my $ql = WebGUI::SQL->buildHashRef("select Survey_questionId,question
from Survey_question where Survey_id=".quote($self->get("Survey_id"))." order by sequenceNumber");
$ql = { ('-1' => WebGUI::International::get(82,'Asset_Survey'),%$ql) };
$f->selectList(
$f->selectBox(
-name => "gotoQuestion",
-options=> $ql,
-value => [$question->{gotoQuestion}],

View file

@ -98,7 +98,7 @@ sub definition {
},
displayMode=>{
tab=>"display",
fieldType=>'selectList',
fieldType=>'selectBox',
defaultValue=>'interleaved',
options=>{
'interleaved'=>WebGUI::International::get('interleaved','Asset_SyndicatedContent'),