- api: You may now use a displayOnly attribute in your asset properties list

that will display a field, but is not settable via the update() method.
 - api: You may now use a customDrawMethod attribute in your asset properties
   list that will enable you to add custom display options for that fields when
   the edit form is automatically generated.
 - Added file attachments to the Wiki.
 - Added a new attachments form control.
 - Added a form control skeleton.
This commit is contained in:
JT Smith 2007-07-25 22:22:49 +00:00
parent 591fd954e3
commit 350d7f6e01
14 changed files with 599 additions and 85 deletions

View file

@ -334,7 +334,7 @@ sub definition {
hoverHelp=>$i18n->get('104 description'),
uiLevel=>3,
fieldType=>'text',
defaultValue=>undef,
defaultValue=>'',
filter=>'fixUrl'
},
isHidden=>{
@ -865,7 +865,16 @@ sub getEditForm {
}
my $tab = $fieldHash{tab} || "properties";
$tabform->getTab($tab)->dynamicField(%params);
# use a custom draw method
my $drawMethod = $properties->{$fieldName}{customDrawMethod};
if ($drawMethod) {
$params{value} = $self->$drawMethod(\%params);
$params{fieldType} = "readOnly";
}
#draw the field
$tabform->getTab($tab)->dynamicField(%params);
}
}
@ -1081,6 +1090,25 @@ sub getRoot {
}
#-------------------------------------------------------------------
=head2 getTempspace ( session )
Constructor. Returns the tempspace folder.
=head3 session
A reference to the current session.
=cut
sub getTempspace {
my $class = shift;
my $session = shift;
return WebGUI::Asset->newByDynamicClass($session, "tempspace0000000000000");
}
#-------------------------------------------------------------------
=head2 getTitle ( )
@ -2025,11 +2053,16 @@ sub update {
# deal with all the properties in this part of the definition
foreach my $property (keys %{$definition->{properties}}) {
# skip a property unless it was specified to be set by the properties field or has a default value
next unless (exists $properties->{$property} || exists $definition->{properties}{$property}{defaultValue});
# skip a property if it has the display only flag set
next if ($properties->{property}{displayOnly});
# use the update value
my $value = $properties->{$property};
# use the current value because the update value was undef
unless (defined $value) {
$value = $self->get($property);

View file

@ -14,8 +14,8 @@ use base 'WebGUI::Asset';
use strict;
use Tie::IxHash;
use WebGUI::International;
use WebGUI::Storage::Image;
use WebGUI::Utility;
use WebGUI::VersionTag;
#-------------------------------------------------------------------
@ -41,10 +41,6 @@ Override the default method in order to deal with attachments.
sub addRevision {
my $self = shift;
my $newSelf = $self->SUPER::addRevision(@_);
if ($self->get("storageId")) {
my $newStorage = WebGUI::Storage->get($self->session,$self->get("storageId"))->copy;
$newSelf->update({storageId=>$newStorage->getId});
}
my $now = time();
$newSelf->update({
isHidden => 1,
@ -80,8 +76,6 @@ sub definition {
tie %properties, 'Tie::IxHash';
%properties =
(
storageId => { fieldType => 'image',
defaultValue => undef },
content => { fieldType => "HTMLArea",
defaultValue => undef },
views => {
@ -150,16 +144,16 @@ sub getEditForm {
formHeader => WebGUI::Form::formHeader($session, { action => $url})
.WebGUI::Form::hidden($session, { name => 'func', value => 'editSave' })
.WebGUI::Form::hidden($session, { name=>"proceed", value=>"showConfirmation" }),
formTitle => WebGUI::Form::text($session, { name => 'title', maxlength => 255, size => 40, value => $self->get('title') }),
formContent => WebGUI::Form::HTMLArea($session, { name => 'content', richEditId => $wiki->get('richEditor'), value => $self->get('content') }),
formTitle => WebGUI::Form::text($session, { name => 'title', maxlength => 255, size => 40,
value => $self->get('title'), defaultValue=>$form->get("title","text") }),
formContent => WebGUI::Form::HTMLArea($session, { name => 'content', richEditId => $wiki->get('richEditor'), value => $self->get('content') }) ,
formSubmit => WebGUI::Form::submit($session, { value => 'Save' }),
formProtect => WebGUI::Form::yesNo($session, { name => "isProtected", value=>$self->getValue("isProtected")}),
formAttachment => '',
formKeywords => WebGUI::Form::text($session, {
name => "keywords",
value => WebGUI::Keyword->new($session)->getKeywordsForAsset({asset=>$self}),
}),
allowsAttachments => $wiki->get("maxAttachments"),
allowsAttachments => $wiki->get("allowAttachments"),
formFooter => WebGUI::Form::formFooter($session),
isNew => ($self->getId eq "new"),
canAdminister => $wiki->canAdminister,
@ -172,27 +166,20 @@ sub getEditForm {
protectQuestionLabel => $i18n->get("protectQuestionLabel"),
isProtected => $self->isProtected
};
my $children = [];
if ($self->getId eq "new") {
$var->{formHeader} .= WebGUI::Form::hidden($session, { name=>"assetId", value=>"new" })
.WebGUI::Form::hidden($session, { name=>"class", value=>$form->process("class","className") });
}
} else {
$children = $self->getLineage(["children"]);
}
$var->{formAttachment} = WebGUI::Form::Attachments($session, {
value => $children,
maxAttachments => $wiki->get("allowAttachments")
});
return $self->processTemplate($var, $wiki->getValue('pageEditTemplateId'));
}
#-------------------------------------------------------------------
sub getStorageLocation {
my $self = shift;
unless (exists $self->{_storageLocation}) {
if ($self->get("storageId") eq "") {
$self->{_storageLocation} = WebGUI::Storage::Image->create($self->session);
$self->update({storageId=>$self->{_storageLocation}->getId});
} else {
$self->{_storageLocation} = WebGUI::Storage::Image->get($self->session,$self->get("storageId"));
}
}
return $self->{_storageLocation};
}
#-------------------------------------------------------------------
sub getWiki {
my $self = shift;
@ -249,29 +236,26 @@ sub processPropertiesFromFormPost {
$self->update({isProtected => $self->session->form("isProtected")});
}
delete $self->{_storageLocation};
my $size = 0;
my $storage = $self->getStorageLocation;
foreach my $file (@{$storage->getFiles}) {
if ($storage->isImage($file)) {
my ($w, $h) = $storage->getSizeInPixels($file);
my $max_size = $self->getWiki->get("maxImageSize")
|| $self->session->setting->get("maxImageSize");
if($w > $max_size || $h > $max_size) {
if($w > $h) {
$storage->resize($file, $max_size);
}
else {
$storage->resize($file, 0, $max_size);
}
}
$storage->generateThumbnail($file, $self->getWiki->get("thumbnailSize"));
}
$size += $storage->getFileSize($file);
my @attachments = $self->session->form->param("attachments");
my @tags = ();
foreach my $assetId (@attachments) {
my $asset = WebGUI::Asset->newByDynamicClass($self->session, $assetId);
if (defined $asset) {
unless ($asset->get("parentId") eq $self->getId) {
$asset->setParent($self);
}
push(@tags, $asset->get("tagId"));
$asset->setVersionTag($self->get("tagId"));
}
$self->setSize($size);
}
foreach my $tag (@tags) {
my $version = WebGUI::VersionTag->new($self->session, $tag);
if (defined $version) {
if ($version->getAssetCount == 0) {
$version->rollback;
}
}
}
$self->requestAutoCommit;
}
@ -332,21 +316,22 @@ sub view {
});
}
my $var = {
keywordsLoop => \@keywordsLoop,
viewLabel => $i18n->get("viewLabel"),
editLabel => $i18n->get("editLabel"),
historyLabel => $i18n->get("historyLabel"),
wikiHomeLabel=>$i18n->get("wikiHomeLabel", "Asset_WikiMaster"),
searchLabel=>$i18n->get("searchLabel", "Asset_WikiMaster"),
searchUrl=>$self->getParent->getUrl("func=search"),
recentChangesUrl=>$self->getParent->getUrl("func=recentChanges"),
recentChangesLabel=>$i18n->get("recentChangesLabel", "Asset_WikiMaster"),
mostPopularUrl=>$self->getParent->getUrl("func=mostPopular"),
mostPopularLabel=>$i18n->get("mostPopularLabel", "Asset_WikiMaster"),
wikiHomeUrl=>$self->getParent->getUrl,
historyUrl=>$self->getUrl("func=getHistory"),
editContent=>$self->getEditForm,
content => $self->getWiki->autolinkHtml($self->scrubContent),
keywordsLoop => \@keywordsLoop,
viewLabel => $i18n->get("viewLabel"),
editLabel => $i18n->get("editLabel"),
historyLabel => $i18n->get("historyLabel"),
wikiHomeLabel => $i18n->get("wikiHomeLabel", "Asset_WikiMaster"),
searchLabel => $i18n->get("searchLabel", "Asset_WikiMaster"),
searchUrl => $self->getParent->getUrl("func=search"),
recentChangesUrl => $self->getParent->getUrl("func=recentChanges"),
recentChangesLabel => $i18n->get("recentChangesLabel", "Asset_WikiMaster"),
mostPopularUrl => $self->getParent->getUrl("func=mostPopular"),
mostPopularLabel => $i18n->get("mostPopularLabel", "Asset_WikiMaster"),
wikiHomeUrl => $self->getParent->getUrl,
historyUrl => $self->getUrl("func=getHistory"),
editContent => $self->getEditForm,
allowsAttachments => $self->getWiki->get("allowAttachments"),
content => $self->getWiki->autolinkHtml($self->scrubContent),
};
return $self->processTemplate($var, $self->getWiki->get("pageTemplateId"));
}

View file

@ -141,6 +141,7 @@ sub definition {
return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
sub duplicate {

View file

@ -40,11 +40,12 @@ sub appendRecentChanges {
my $self = shift;
my $var = shift;
my $limit = shift || $self->get("recentChangesCount") || 50;
my $rs = $self->session->db->read("select asset.assetId, revisionDate from assetData left join asset on assetData.assetId=asset.assetId where
lineage like ? and lineage<>? and status='approved' order by revisionDate desc limit ?",
[$self->get("lineage").'%', $self->get("lineage"), $limit]);
while (my ($id, $version) = $rs->array) {
my $asset = WebGUI::Asset->new($self->session, $id, "WebGUI::Asset::WikiPage", $version);
foreach my $asset (@{$self->getLineage(["children"], {
returnObjects => 1,
limit => $limit,
includeOnlyClasses =>["WebGUI::Asset::WikiPage"],
orderByClause => "assetData.revisionDate desc"
})}) {
my $user = WebGUI::User->new($self->session, $asset->get("actionTakenBy"));
my $specialAction = '';
my $isAvailable = 1;
@ -296,6 +297,13 @@ sub definition {
label => $i18n->get("max image size"),
hoverHelp => $i18n->get("max image size help")
},
allowAttachments => {
fieldType => "integer",
defaultValue => 0,
tab => "security",
label => $i18n->get("allow attachments"),
hoverHelp => $i18n->get("allow attachments help"),
},
useContentFilter =>{
fieldType=>"yesNo",
defaultValue=>1,
@ -390,7 +398,6 @@ sub www_byKeyword {
});
$p->setBaseUrl($self->getUrl("func=byKeyword"));
foreach my $assetData (@{$p->getPageData}) {
$self->session->errorHandler->warn($assetData->{assetId});
my $asset = WebGUI::Asset->newByDynamicClass($self->session, $assetData->{assetId});
next unless defined $asset;
push(@pages, {
@ -447,6 +454,7 @@ sub www_recentChanges {
sub www_search {
my $self = shift;
my $i18n = WebGUI::International->new($self->session, "Asset_WikiMaster");
my $queryString = $self->session->form->process('query', 'text');
my $var = {
resultsLabel=>$i18n->get("resultsLabel"),
notWhatYouWanted=>$i18n->get("notWhatYouWantedLabel"),
@ -459,9 +467,8 @@ sub www_search {
mostPopularUrl=>$self->getUrl("func=mostPopular"),
mostPopularLabel=>$i18n->get("mostPopularLabel"),
wikiHomeUrl=>$self->getUrl,
addPageUrl=>$self->getUrl("func=add;class=WebGUI::Asset::WikiPage"),
addPageUrl=>$self->getUrl("func=add;class=WebGUI::Asset::WikiPage;title=".$queryString),
};
my $queryString = $self->session->form->process('query', 'text');
if (defined $queryString) {
$self->session->scratch->set('wikiSearchQueryString', $queryString);
}

View file

@ -357,11 +357,31 @@ Sets the versioning lock to "on" so that this piece of content may not be edited
sub setVersionLock {
my $self = shift;
$self->session->db->write("update asset set isLockedBy=".$self->session->db->quote($self->session->user->userId)." where assetId=".$self->session->db->quote($self->getId));
$self->session->db->write("update asset set isLockedBy=? where assetId=?", [$self->session->user->userId, $self->getId]);
$self->updateHistory("locked");
$self->purgeCache;
}
#-------------------------------------------------------------------
=head2 setVersionTag ( tagId )
Changes the version tag associated with this revision to something new.
=head3 tagId
A new version tag id.
=cut
sub setVersionTag {
my $self = shift;
my $tagId = shift;
$self->session->db->write("update assetData set tagId=? where assetId=?", [$tagId, $self->getId]);
$self->updateHistory("changed version tag to $tagId");
$self->purgeCache;
}
#-------------------------------------------------------------------

View file

@ -0,0 +1,294 @@
package WebGUI::Form::Attachments;
=head1 LEGAL
-------------------------------------------------------------------
WebGUI is Copyright 2001-2007 Plain Black Corporation.
-------------------------------------------------------------------
Please read the legal notices (docs/legal.txt) and the license
(docs/license.txt) that came with this distribution before using
this software.
-------------------------------------------------------------------
http://www.plainblack.com info@plainblack.com
-------------------------------------------------------------------
=cut
use strict;
use base 'WebGUI::Form::Control';
use WebGUI::Asset;
use WebGUI::International;
use WebGUI::Storage::Image;
use WebGUI::VersionTag;
=head1 NAME
Package WebGUI::Form::File
=head1 DESCRIPTION
Creates a javascript driven file upload control for asset attachments.
B<NOTE:> This is meant to be used in
conjunction with one or more Rich Editors (see WebGUI::Form::HTMLArea) and should be placed above them in the field
list for ease of use.
B<WARNING:> This form control is not capable of handling all aspects of the files uploaded to it. So you as the
developer need to complete the process after the form has been submitted. See the getValueFromPost() method for
details.
=head1 SEE ALSO
This is a subclass of WebGUI::Form::Control.
=head1 METHODS
The following methods are specifically available from this class. Check the superclass for additional methods.
=cut
#-------------------------------------------------------------------
=head2 definition ( [ additionalTerms ] )
See the super class for additional details.
=head3 additionalTerms
The following additional parameters have been added via this sub class.
=head4 name
If no name is specified a default name of "attachments" will be used.
=head4 maxAttachments
How many attachments will be allowed to be uploaded. Defaults to 1.
=head4 value
An array reference of asset objects (not ids, but objects) that should be displayed in the attachments box.
=cut
sub definition {
my $class = shift;
my $session = shift;
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
defaultValue=>$i18n->get("file")
},
name=>{
defaultValue=>"attachments"
},
maxAttachments=>{
defaultValue=>1
},
profileEnabled=>{
defaultValue=>0
},
dbDataType => {
defaultValue => "VARCHAR(22) BINARY",
},
});
return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
=head2 getValueFromPost ( )
Returns an array reference of asset ids that have been uploaded. New assets are uploaded to a temporary location,
and you must move them to the place in the asset tree you want them, or they will be automatically deleted.
=cut
sub getValueFromPost {
my $self = shift;
my @values = $self->session->form->param($self->get("name"));
return \@values;
}
#-------------------------------------------------------------------
=head2 toHtml ( )
Renders an attachments control.
=cut
sub toHtml {
my $self = shift;
my @assetIds = @{$self->get("value")};
my $attachmentsList = "attachments=".join(";attachments=", @assetIds) if (scalar(@assetIds));
return '<iframe src="'
.$self->session->url->page("op=formHelper;class=Attachments;sub=show;name=".$self->get("name")
.";maxAttachments=".$self->get("maxAttachments")).";".$attachmentsList
.'" style="width: 100%; height: 110px;"></iframe><div id="'.$self->get("name").'_formId"></div>';
}
#-------------------------------------------------------------------
=head2 www_delete ()
Deletes an attachment.
=cut
sub www_delete {
my $session = shift;
my $assetId = $session->form->param("assetId");
my @assetIds = $session->form->param("attachments");
if ($assetId ne "") {
my $asset = WebGUI::Asset->newByDynamicClass($session, $assetId);
if (defined $asset) {
if ($asset->canEdit) {
my $version = WebGUI::VersionTag->new($session, $asset->get("tagId"));
$asset->purge;
if ($version->getAssetCount == 0) {
$version->rollback;
}
my @tempAssetIds = ();
foreach my $id (@assetIds) {
push(@tempAssetIds, $id) unless $id eq $assetId;
}
@assetIds = @tempAssetIds;
}
}
}
return www_show($session,\@assetIds);
}
#-------------------------------------------------------------------
=head2 www_show ()
A web accessible method that displays the attachments associated with this attachments control.
=cut
sub www_show {
my $session = shift;
my ($form, $url, $style) = $session->quick(qw(form url style));
my $assetIdRef = shift;
my @assetIds = [];
if (defined $assetIdRef) {
$assetIdRef ||= [];
@assetIds = @{$assetIdRef};
}
else {
@assetIds = $session->form->param("attachments");
}
$session->http->setCacheControl("none");
$style->setScript($url->extras("/AttachmentsControl/AttachmentsControl.js"),
{type=>"text/javascript"});
$style->setLink($url->extras("/AttachmentsControl/AttachmentsControl.css"),
{type=>"text/css", rel=>"stylesheet"});
my $uploadControl = '';
my $i18n = WebGUI::International->new($session, "Control_Attachments");
my $maxFiles = $form->param('maxAttachments') - scalar(@assetIds) ;
my $attachmentForms = '';
foreach my $assetId (@assetIds) {
$attachmentForms .= '<input type="hidden" name="attachments" value="'.$assetId.'" />';
}
if ($maxFiles > 0) {
$uploadControl = '<div id="uploadForm">
<a href="#" onclick="WebguiAttachmentUploadForm.hide();" id="uploadFormCloser">X</a>
<form action="'.$url->page.'" enctype="multipart/form-data" method="post">
<input type="hidden" name="maxAttachments" value="'.$form->param("maxAttachments").'" />
<input type="hidden" name="name" value="'.$form->param("name").'" />
<input type="hidden" name="op" value="formHelper" />
<input type="hidden" name="class" value="Attachments" />
<input type="hidden" name="sub" value="upload" /> '. $attachmentForms
.'<input type="file" name="attachment" />
<input type="submit" value="Upload" /> </form> </div>
<a id="upload" href="#" onclick="WebguiAttachmentUploadForm.show();">Upload an attachment.</a>
';
}
my $attachments = '';
my $attachmentsList = "attachments=".join(";attachments=", @assetIds) if (scalar(@assetIds));
foreach my $assetId (@assetIds) {
my $asset = WebGUI::Asset->newByDynamicClass($session, $assetId);
if (defined $asset) {
$attachments .= '<div class="attachment"><a href="'
.$url->page("op=formHelper;class=Attachments;sub=delete;maxAttachments=".$form->param("maxAttachments").";"
.$attachmentsList.";assetId=".$assetId.";name=".$form->param("name")).'" class="deleteAttachment">X</a>
';
if ($asset->isa("WebGUI::Asset::File::Image")) {
$attachments .= '
<div class="thumbnail"><img src="'.$asset->getThumbnailUrl.'" alt="'.$asset->getTitle.'" /></div>
<a class="imageLink" href="'.$asset->getUrl.'">'.$asset->getTitle.'</a>
<img src="'.$asset->getUrl.'" alt="'.$asset->getTitle.'" />';
}
else {
$attachments .= '
<div class="thumbnail"><img src="'.$asset->getFileIconUrl.'" alt="'.$asset->getTitle.'" /></div>
<a href="'.$asset->getUrl.'">'.$asset->getTitle.'</a>';
}
$attachments .= '</div>';
}
}
my $output = '<html><head> '.$style->generateAdditionalHeadTags.'
<script type="text/javascript">
parent.document.getElementById("'.$form->get("name").'_formId").innerHTML = \''.$attachmentForms.'\';
</script>
</head> <body>
'.$uploadControl.' <div id="instructions">Upload attachments here. Copy and paste attachments into the editor.</div>
<div id="attachments">'.$attachments.' </div> </body> </html> ';
return $output;
}
#-------------------------------------------------------------------
=head2 www_upload
A web accessible method that uploads an attachment to tempsace.
=cut
sub www_upload {
my $session = shift;
my $form = $session->form;
my @assetIds = $form->param("attachments");
my $storage = WebGUI::Storage::Image->createTemp($session);
my $filename = $storage->addFileFromFormPost("attachment");
my $tempspace = WebGUI::Asset->getTempspace($session);
if ($storage->isImage($filename)) {
my $image = $tempspace->addChild({
title => $filename,
url => "attachments/".$filename,
className => "WebGUI::Asset::File::Image",
filename => $filename,
templateId => "PBtmpl0000000000000088",
});
$image->getStorageLocation->addFileFromFilesystem($storage->getPath($filename));
$image->generateThumbnail();
$image->setSize;
push(@assetIds, $image->getId);
}
else {
my $file = $tempspace->addChild({
title => $filename,
url => "attachments/".$filename,
className => "WebGUI::Asset::File",
filename => $filename,
templateId => "PBtmpl0000000000000024",
});
$file->getStorageLocation->addFileFromFilesystem($storage->getPath($filename));
$file->setSize;
push(@assetIds, $file->getId);
}
if ($session->setting->get("autoRequestCommit")) {
WebGUI::VersionTag->getWorking($session)->requestCommit;
}
$storage->delete;
return www_show($session, \@assetIds);
}
1;

View file

@ -0,0 +1,122 @@
package WebGUI::Form::MyControl;
=head1 LEGAL
-------------------------------------------------------------------
WebGUI is Copyright 2001-2007 Plain Black Corporation.
-------------------------------------------------------------------
Please read the legal notices (docs/legal.txt) and the license
(docs/license.txt) that came with this distribution before using
this software.
-------------------------------------------------------------------
http://www.plainblack.com info@plainblack.com
-------------------------------------------------------------------
=cut
use strict;
use base 'WebGUI::Form::Control';
use WebGUI::International;
=head1 NAME
Package WebGUI::Form::MyControl
=head1 DESCRIPTION
Creates a text input box form field.
=head1 SEE ALSO
This is a subclass of WebGUI::Form::Control.
=head1 METHODS
The following methods are specifically available from this class. Check the superclass for additional methods.
=cut
#-------------------------------------------------------------------
=head2 definition ( [ additionalTerms ] )
See the super class for additional details.
=head3 additionalTerms
The following additional parameters have been added via this sub class.
=head4 size
Defaults to the setting textBoxSize or 30 if that's not set. Specifies how big of a text box to display.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
my $class = shift;
my $session = shift;
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
defaultValue=> $i18n->get("475")
},
size=>{
defaultValue=>$session->setting->get("textBoxSize") || 30
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
=head2 getValueFromPost ( [ value ] )
Retrieves a value from a form GET or POST and returns it. If the value comes back as undef, this method will return the defaultValue instead.
=head3 value
An optional value to process, instead of POST input.
=cut
sub getValueFromPost {
my $self = shift;
my $formValue;
if (@_) {
$formValue = shift;
}
elsif ($self->session->request) {
$formValue = $self->session->form->param($self->get("name"));
}
if (defined $formValue) {
return $formValue;
} else {
return $self->{defaultValue};
}
}
#-------------------------------------------------------------------
=head2 toHtml ( )
Renders an input tag of type text.
=cut
sub toHtml {
my $self = shift;
my $value = $self->fixMacros($self->fixQuotes($self->fixSpecialCharacters($self->get("value"))));
return '<input id="'.$self->get('id').'" type="text" name="'.$self->get("name").'" value="'.$value.'" size="'.$self->get("size").'" '.$self->get("extras").' />';
}
1;

View file

@ -210,7 +210,7 @@ sub setup {
my $form = $session->form;
my $snippet = '/* auto generated by WebGUI '.$WebGUI::VERSION.' */
.clearFloat { clear: both; }
body { background-color: '.$form->get("pageBackgroundColor").'; }
body { background-color: '.$form->get("pageBackgroundColor").'; color: '.$form->get("contentTextColor").'}
a { color: '.$form->get("linkColor").';}
a:visited { color: '.$form->get("visitedLinkColor").'; }
#editToggleContainer { padding: 1px; }
@ -367,6 +367,7 @@ a:visited { color: '.$form->get("visitedLinkColor").'; }
addAsset($page, {
title => "Wiki",
isHidden => 1,
allowAttachments => 5,
className => "WebGUI::Asset::Wobject::WikiMaster",
description => "Welcome to our wiki. Here you can help us keep information up to date.",
});

View file

@ -420,7 +420,7 @@ sub requestCommit {
=head2 rollback ( )
A class method. Eliminates all revisions of all assets created under a specific version tag. Also removes the version tag.
Eliminates all revisions of all assets created under a specific version tag. Also removes the version tag.
=cut

View file

@ -1,6 +1,16 @@
package WebGUI::i18n::English::Asset_WikiMaster;
our $I18N = {
'allow attachments' => {
lastUpdated => 0,
message => q|Allowed Attachments|,
context => "field label"
},
'allow attachments help' => {
lastUpdated => 0,
message => q|?|,
context => "The number of attachments that are allowed to be placed on each wiki page."
},
'assetName' => { lastUpdated => 1160157064, message => 'Wiki' },
'asset description' => { lastUpdated => 1160157064, message => q|A wiki is a collaborative content publishing mechanism. Traditionally wiki's use the wiki markup language, but that's generally not much easier to deal with than HTML, so WebGUI's wiki instead just uses a rich editor to help users publish rich great looking content.| },