- All assets now have an autoGenerateForms property just like wobjects per the

rough edges discussions in Community IRC.
 - fix: not set UTF-8 in setup page
This commit is contained in:
JT Smith 2006-05-31 23:01:53 +00:00
parent 2f3ae0faef
commit 33272fd76c
6 changed files with 51 additions and 140 deletions

View file

@ -26,6 +26,7 @@
- fix: DataForm corrupts text area fields
- All assets now have an autoGenerateForms property just like wobjects per the
rough edges discussions in Community IRC.
- fix: not set UTF-8 in setup page
6.99.2
- fix - demo.plainblack.com getting started

View file

@ -263,6 +263,7 @@ sub setup {
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WebGUI Initial Configuration</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
a { color: black; }
a:visited { color: black;}

View file

@ -110,16 +110,23 @@ sub definition {
push(@{$definition}, {
assetName=>$i18n->get('assetName'),
tableName=>'ZipArchiveAsset',
autoGenerateForms=>1,
icon=>'ziparchive.gif',
className=>'WebGUI::Asset::File::ZipArchive',
properties=>{
showPage=>{
fieldType=>'text',
defaultValue=>'index.html'
},
templateId=>{
fieldType=>'template',
defaultValue=>''
tab=>"properties",
label=>$i18n->get('show page'),
hoverHelp=>$i18n->get('show page description'),
fieldType=>'text',
defaultValue=>'index.html'
},
templateId=>{
tab=>"display",
label=>$i18n->get('template label'),
namespace=>"ZipArchiveAsset",
fieldType=>'template',
defaultValue=>''
},
}
});
@ -143,33 +150,6 @@ sub duplicate {
return $newAsset;
}
#-------------------------------------------------------------------
=head2 getEditForm ( )
Returns the TabForm object that will be used in generating the edit page for this asset.
=cut
sub getEditForm {
my $self = shift;
my $tabform = $self->SUPER::getEditForm();
my $i18n = WebGUI::International->new($self->session,"Asset_ZipArchive");
$tabform->getTab("display")->template(
-value=>$self->getValue("templateId"),
-label=>$i18n->get('template label'),
-namespace=>"ZipArchiveAsset"
);
$tabform->getTab("properties")->text (
-name=>"showPage",
-label=>$i18n->get('show page'),
-value=>$self->getValue("showPage"),
-hoverHelp=>$i18n->get('show page description'),
);
return $tabform;
}
#-------------------------------------------------------------------
=head2 prepareView ( )

View file

@ -62,11 +62,15 @@ sub definition {
push(@{$definition}, {
assetName=>$i18n->get('assetName'),
uiLevel => 9,
autoGenerateForms=>1,
icon=>'redirect.gif',
tableName=>'redirect',
className=>'WebGUI::Asset::Redirect',
properties=>{
redirectUrl=>{
tab=>"properties",
label=>$i18n->get('redirect url'),
hoverHelp=>$i18n->get('redirect url description'),
fieldType=>'url',
defaultValue=>undef
}
@ -76,29 +80,6 @@ sub definition {
}
#-------------------------------------------------------------------
=head2 getEditForm ()
Returns the TabForm object that will be used in generating the edit page for this asset.
=cut
sub getEditForm {
my $self = shift;
my $tabform = $self->SUPER::getEditForm();
my $i18n = WebGUI::International->new($self->session, 'Asset_Redirect');
$tabform->getTab("properties")->url(
-name=>"redirectUrl",
-label=>$i18n->get('redirect url'),
-hoverHelp=>$i18n->get('redirect url description'),
-value=>$self->getValue("redirectUrl")
);
return $tabform;
}
#-------------------------------------------------------------------
sub www_edit {
my $self = shift;

View file

@ -60,15 +60,14 @@ sub definition {
my $session = shift;
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_Snippet");
push(@{$definition}, {
assetName=>$i18n->get('assetName'),
uiLevel => 5,
icon=>'snippet.gif',
tableName=>'snippet',
className=>'WebGUI::Asset::Snippet',
properties=>{
my %properties;
tie %properties, 'Tie::IxHash';
%properties = (
snippet=>{
fieldType=>'codearea',
tab=>"properties",
label=>$i18n->get('assetName'),
hoverHelp=>$i18n->get('snippet description'),
defaultValue=>undef
},
cacheTimeout => {
@ -81,64 +80,33 @@ sub definition {
},
processAsTemplate=>{
fieldType=>'yesNo',
label=>$i18n->get('process as template'),
hoverHelp=>$i18n->get('mimeType description'),
tab=>"properties",
defaultValue=>0
},
mimeType=>{
tab=>"properties",
hoverHelp=>$i18n->get('mimeType description'),
label=>$i18n->get('mimeType'),
fieldType=>'mimeType',
defaultValue=>'text/html'
}
}
);
push(@{$definition}, {
assetName=>$i18n->get('assetName'),
uiLevel => 5,
icon=>'snippet.gif',
autoGenerateForms=>1,
tableName=>'snippet',
className=>'WebGUI::Asset::Snippet',
properties=>\%properties
});
return $class->SUPER::definition($session,$definition);
}
#-------------------------------------------------------------------
=head2 getEditForm ()
Returns the TabForm object that will be used in generating the edit page for this asset.
=cut
sub getEditForm {
my $self = shift;
my $tabform = $self->SUPER::getEditForm();
my $i18n = WebGUI::International->new($self->session,"Asset_Snippet");
$tabform->getTab("display")->interval(
name => "cacheTimeout",
defaultValue => 3600,
uiLevel => 8,
label => $i18n->get("cache timeout"),
hoverHelp => $i18n->get("cache timeout help"),
value=> $self->getValue("cacheTimeout")
);
$tabform->getTab("properties")->codearea(
-name=>"snippet",
-label=>$i18n->get('assetName'),
-hoverHelp=>$i18n->get('snippet description'),
-value=>$self->getValue("snippet")
);
$tabform->getTab("properties")->yesNo(
-name=>"processAsTemplate",
-label=>$i18n->get('process as template'),
-hoverHelp=>$i18n->get('process as template description'),
-value=>$self->getValue("processAsTemplate")
);
$tabform->getTab("properties")->mimeType(
-name=>"mimeType",
-label=>$i18n->get('mimeType'),
-hoverHelp=>$i18n->get('mimeType description'),
-value=>[$self->getValue('mimeType')],
);
return $tabform;
}
#-------------------------------------------------------------------
=head2 getToolbar ( )

View file

@ -80,11 +80,12 @@ sub definition {
tie %properties, 'Tie::IxHash';
my $i18n = WebGUI::International->new($session, "Asset_NewAsset");
%properties = (
templateId =>{
templateId => {
# Determines which tab this property appears in
tab=>"display",
#See the list of field/control types in /lib/WebGUI/Form/
fieldType=>"template",
defaultValue=>'NewAssetTmpl0000000001',
tab=>"display",
#www_editSave will ignore anyone's attempts to update this field if this is set to 1
noFormPost=>0,
#This is an option specific to the template fieldType.
@ -94,11 +95,19 @@ sub definition {
hoverHelp=>$i18n->get('templateId label description'),
# This is the text that will appear to the left of your form field.
label=>$i18n->get('templateId label')
},
foo => {
tab=>"properties",
fieldType=>"text",
defaultValue=>undef,
label=>$i18n->get("foo label"),
hoverHelp=>$i18n->get("foo label help")
}
);
push(@{$definition}, {
assetName=>$i18n->get('assetName'),
icon=>'NewAsset.gif',
autoGenerateForms=>1,
tableName=>'NewAsset',
className=>'WebGUI::Asset::NewAsset',
properties=>\%properties
@ -124,35 +133,6 @@ sub duplicate {
}
#-------------------------------------------------------------------
=head2 getEditForm ()
Returns the TabForm object that will be used in generating the edit page for this asset.
=cut
sub getEditForm {
my $self = shift;
my $tabform = $self->SUPER::getEditForm();
my $i18n = WebGUI::International->new($self->session, "Asset_NewAsset");
$tabform->getTab("display")->template(
value=>$self->getValue("templateId"),
label=>$i18n->get('template label'),,
namespace=>"NewAssetAsset"
);
$tabform->getTab("properties")->text (
name=>"showPage",
label=>$i18n->get('show page'),
value=>$self->getValue("showPage"),
hoverHelp=>$i18n->get('show page description'),
);
return $tabform;
}
#-------------------------------------------------------------------
=head2 indexContent ( )