From f8ca6ec5bd25184e61af8a885ae37afd93e9576a Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sun, 2 Jan 2005 01:32:54 +0000 Subject: [PATCH] finished migrating article, fixed some bugs, and enhanced the file asset api --- etc/WebGUI.conf.original | 5 - lib/WebGUI/Asset.pm | 16 ++- lib/WebGUI/Asset/File.pm | 55 +++++-- lib/WebGUI/Asset/File/Image.pm | 22 +-- lib/WebGUI/Asset/Wobject/Article.pm | 34 ++--- lib/WebGUI/Asset/Wobject/Layout.pm | 8 +- lib/WebGUI/Macro/RandomAssetProxy.pm | 2 +- lib/WebGUI/Wobject/Article.pm | 205 --------------------------- 8 files changed, 82 insertions(+), 265 deletions(-) delete mode 100644 lib/WebGUI/Wobject/Article.pm diff --git a/etc/WebGUI.conf.original b/etc/WebGUI.conf.original index 1cbde74cc..aedb0f862 100644 --- a/etc/WebGUI.conf.original +++ b/etc/WebGUI.conf.original @@ -42,11 +42,6 @@ passwordChangeLoggingEnabled = 1 authMethods = LDAP, WebGUI -wobjects = Article, EventsCalendar, FileManager, HttpProxy, \ - DataForm, MessageBoard, Poll, Product, SiteMap, \ - SQLReport, Survey, SyndicatedContent, USS, WobjectProxy, \ - WSClient, IndexedSearch - macros = a => a_account, \ AdminBar => AdminBar, \ AdminText => AdminText, \ diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index a228a3afe..2c0389f23 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -824,15 +824,15 @@ sub getLastChild { =head2 getLineage ( relatives,rules ) -Returns an array of lineages of relatives based upon rules. +Returns an array reference of lineages of relatives based upon rules. =head3 relatives -Square bracketed, comma separated list, quoted entries; eg ["siblings"] or ["self","ancestors"].Valid parameters are "siblings", "ancestors", "self", "descendants", "pedigree" +An arrary reference of relatives to retrieve. Valid parameters are "siblings", "children", "ancestors", "self", "descendants", "pedigree" =head3 rules -A hash comprising limits to relative listing. Variables to rules include endingLineageLength, assetToPedigree, excludeClasses, returnQuickReadObjects, returnObjects. +A hash reference comprising limits to relative listing. Variables to rules include endingLineageLength, assetToPedigree, excludeClasses, returnQuickReadObjects, returnObjects, invertTree, includeOnlyClasses. =cut @@ -893,7 +893,10 @@ sub getLineage { foreach my $className (@{$rules->{excludeClasses}}) { push(@set,"className <> ".quote($className)); } - $where .= 'and ('.join(" and ",@set).')'; + $where .= ' and ('.join(" and ",@set).')'; + } + if (exists $rules->{includeOnlyClasses}) { + $where .= ' and (className in ('.quoteAndJoin($rules->{includeOnlyClasses}).'))'; } $where .= " and ".join(" or ",@whereModifiers) if (scalar(@whereModifiers)); # based upon all available criteria, let's get some assets @@ -1898,7 +1901,7 @@ sub www_emptyTrash { sub www_manageAssets { my $self = shift; return $self->getAdminConsole->render(WebGUI::Privilege::insufficient()) unless $self->canEdit; - my $children = $self->getLineage(["descendants"],{returnObjects=>1, endingLineageLength=>$self->getLineageLength+1}); + my $children = $self->getLineage(["children"],{returnObjects=>1}); my $output = $self->getAssetManagerControl($children); $output .= '
  @@ -1908,11 +1911,10 @@ sub www_manageAssets { $output .= ''.$link->{label}.'
'; } $output .= '
'; - my $clipboard = WebGUI::Clipboard::getAssetsInClipboard(); my %options; tie %options, 'Tie::IxHash'; my $hasClips = 0; - foreach my $item (@{$clipboard}) { + foreach my $item (@{$self->getAssetsInClipboard(1)}) { $options{$item->{assetId}} = $item->{title}; $hasClips = 1; } diff --git a/lib/WebGUI/Asset/File.pm b/lib/WebGUI/Asset/File.pm index 779490c93..0dfb373fb 100644 --- a/lib/WebGUI/Asset/File.pm +++ b/lib/WebGUI/Asset/File.pm @@ -85,6 +85,16 @@ sub definition { return $class->SUPER::definition($definition); } +sub getBox { + my $self = shift; + my %var; + $var{"attachment.icon"} = $self->getFileIcon; + $var{"attachment.url"} = $self->getFileUrl; + $var{"attachment.name"} = $self->get("filename"); + $var{"attachment.size"} = $self->getStorageLocation->getSize; + $var{"attachment.type"} = $self->getStorageLocation->getFileExtension; + return WebGUI::Template::process(1,"AttachmentBox",\%var); +} #------------------------------------------------------------------- @@ -99,10 +109,9 @@ sub getEditForm { my $self = shift; my $tabform = $self->SUPER::getEditForm(); if ($self->get("filename") ne "") { - my $storage = WebGUI::Storage->get($self->get("storageId")); $tabform->getTab("properties")->readOnly( -label=>"Current File", - -value=>''.$self->get( '.$self->get("filename").'' + -value=>''.$self->get( '.$self->get("filename").'' ); } @@ -114,13 +123,27 @@ sub getEditForm { } +#------------------------------------------------------------------- +sub getFileUrl { + my $self = shift; + return $self->getStorageLocation->getUrl($self->get("filename")); +} + + +#------------------------------------------------------------------- +sub getFileIconUrl { + my $self = shift; + return $self->getStorageLocation->getFileIconUrl($self->get("filename")); +} + + + #------------------------------------------------------------------- sub getIcon { my $self = shift; my $small = shift; if ($small) { - my $storage = WebGUI::Storage->get($self->get("storageId")); - return $storage->getFileIconUrl($self->get("filename")); + return $self->getFileIconUrl; } return $session{config}{extrasURL}.'/assets/file.gif'; } @@ -138,11 +161,19 @@ sub getName { return "File"; } +sub getStorageLocation { + my $self = shift; + unless (exists $self->{_storageLocation}) { + $self->{_storageLocation} = WebGUI::Storage->get($self->get("storageId")); + } + return $self->{_storageLocation}; +} + sub processPropertiesFromFormPost { my $self = shift; $self->SUPER::processPropertiesFromFormPost; - my $storage = WebGUI::Storage->create; + my $storage = $self->{_storageLocation} = WebGUI::Storage->create; my $filename = $storage->addFileFromFormPost("file"); if (defined $filename) { my $oldVersions; @@ -163,8 +194,7 @@ sub processPropertiesFromFormPost { $storage->setPrivileges($self->get("ownerUserId"), $self->get("groupIdView"), $self->get("groupIdEdit")); } else { $storage->delete; - my $storage = WebGUI::Storage->get($self->get("storageId")); - $storage->setPrivileges($self->get("ownerUserId"), $self->get("groupIdView"), $self->get("groupIdEdit")); + $self->getStorageLocation->setPrivileges($self->get("ownerUserId"), $self->get("groupIdView"), $self->get("groupIdEdit")); } } @@ -183,19 +213,17 @@ sub purge { my $storage = WebGUI::Storage->get($storageId); $storage->delete; } - my $storage = WebGUI::Storage->get($self->get("storageId")); - $storage->delete; + $self->getStorageLocation->delete; return $self->SUPER::purge; } sub view { my $self = shift; - my $storage = WebGUI::Storage->get($self->get("storageId")); my %var = %{$self->get}; $var{controls} = $self->getToolbar; - $var{fileUrl} = $storage->getUrl($self->get("filename")); - $var{fileIcon} = $storage->getFileIconUrl($self->get("filename")); + $var{fileUrl} = $self->getFileUrl; + $var{fileIcon} = $self->getFileIconUrl; return WebGUI::Template::process("1","FileAsset",\%var); } @@ -214,8 +242,7 @@ sub www_view { if ($session{var}{adminOn}) { return $self->www_edit; } - my $storage = WebGUI::Storage->get($self->get("storageId")); - WebGUI::HTTP::setRedirect($storage->getUrl($self->get("filename"))); + WebGUI::HTTP::setRedirect($self->getFileUrl); return ""; } diff --git a/lib/WebGUI/Asset/File/Image.pm b/lib/WebGUI/Asset/File/Image.pm index 1bc6eb9d5..669d0a90b 100644 --- a/lib/WebGUI/Asset/File/Image.pm +++ b/lib/WebGUI/Asset/File/Image.pm @@ -18,7 +18,6 @@ use strict; use WebGUI::Asset::File; use WebGUI::HTTP; use WebGUI::Session; -use WebGUI::Storage; use WebGUI::Utility; # do a check to see if they've installed Image::Magick @@ -102,7 +101,7 @@ sub generateThumbnail { $self->update({thumbnailSize=>$thumbnailSize}); } if (defined $self->get("filename") && $hasImageMagick) { - my $storage = WebGUI::Storage->get($self->get("storageId")); + my $storage = $self->getStorageLocation; my $image = Image::Magick->new; my $error = $image->Read($storage->getPath($self->get("filename"))); if ($error) { @@ -153,10 +152,9 @@ sub getEditForm { -value=>$self->getValue("parameters") ); if ($self->get("filename") ne "") { - my $storage = WebGUI::Storage->get($self->get("storageId")); $tabform->getTab("properties")->readOnly( -label=>"Thumbnail", - -value=>'get("filename")).'?noCache='.time().'" alt="thumbnail" />' + -value=>'thumbnail' ); } return $tabform; @@ -184,6 +182,13 @@ sub getName { return "Image"; } + +sub getThumbnailUrl { + my $self = shift; + return $self->getStorageLocation->getUrl("thumb-".$self->get("filename")); +} + + sub processPropertiesFromFormPost { my $self = shift; $self->SUPER::processPropertiesFromFormPost; @@ -196,12 +201,11 @@ sub processPropertiesFromFormPost { sub view { my $self = shift; - my $storage = WebGUI::Storage->get($self->get("storageId")); my %var = %{$self->get}; $var{controls} = $self->getToolbar; - $var{fileUrl} = $storage->getUrl($self->get("filename")); - $var{fileIcon} = $storage->getFileIconUrl($self->get("filename")); - $var{thumbnail} = $storage->getUrl("thumb-".$self->get("filename")); + $var{fileUrl} = $self->getFileUrl; + $var{fileIcon} = $self->getFileIconUrl; + $var{thumbnail} = $self->getThumbnailUrl; return WebGUI::Template::process("1","ImageAsset",\%var); } @@ -227,7 +231,7 @@ sub www_view { if ($session{var}{adminOn}) { return $self->www_edit; } - my $storage = WebGUI::Storage->get($self->get("storageId")); + my $storage = $self->getStorageLocation; WebGUI::HTTP::setRedirect($storage->getUrl($self->get("filename"))); return ""; } diff --git a/lib/WebGUI/Asset/Wobject/Article.pm b/lib/WebGUI/Asset/Wobject/Article.pm index 396715b12..6408b0920 100644 --- a/lib/WebGUI/Asset/Wobject/Article.pm +++ b/lib/WebGUI/Asset/Wobject/Article.pm @@ -96,17 +96,24 @@ sub getName { #------------------------------------------------------------------- sub view { my $self = shift; - my ($file, %var); - if ($self->get("image") ne "") { - $file = WebGUI::Attachment->new($self->get("image"),$self->get("wobjectId")); - $var{"image.url"} = $file->getURL; - $var{"image.thumbnail"} = $file->getThumbnail; + my %var; + my $children = $self->getLineage(["children"],{returnObjects=>1,includeOnlyClasses=>["WebGUI::Asset::File","WebGUI::Asset::File::Image"]}); + foreach my $child (@{$children}) { + if (ref $child eq "WebGUI::Asset::File") { + $var{"attachment.box"} = $child->getBox; + $var{"attachment.icon"} = $child->getFileIcon; + $var{"attachment.url"} = $child->getFileUrl; + $var{"attachment.name"} = $child->get("filename"); + } elsif (ref $child eq "WebGUI::Asset::File::Image") { + $var{"image.url"} = $child->getFileUrl; + $var{"image.thumbnail"} = $child->getThumbnailUrl; + } } $var{description} = $self->get("description"); if ($self->get("convertCarriageReturns")) { $var{description} =~ s/\n/\\n/g; } - $var{"new.template"} = $self->getUrl("wid=".$self->get("wobjectId")."&func=view")."&overrideTemplateId="; + $var{"new.template"} = $self->getUrl."&overrideTemplateId="; $var{"description.full"} = $var{description}; $var{"description.full"} =~ s/\^\-\;//g; $var{"description.first.100words"} = $var{"description.full"}; @@ -131,7 +138,7 @@ sub view { $var{"description.first.2sentences"} =~ s/^((.*?\.){2}).*/$1/s; $var{"description.first.sentence"} = $var{"description.first.2sentences"}; $var{"description.first.sentence"} =~ s/^(.*?\.).*/$1/s; - my $p = WebGUI::Paginator->new($self->getUrl("wid=".$self->get("wobjectId")."&func=view"),1); + my $p = WebGUI::Paginator->new($self->getUrl,1); if ($session{form}{makePrintable} || $var{description} eq "") { $var{description} =~ s/\^\-\;//g; $p->setDataByArrayRef([$var{description}]); @@ -141,21 +148,14 @@ sub view { $var{description} = $p->getPage; } $p->appendTemplateVars(\%var); - if ($self->get("attachment") ne "") { - $file = WebGUI::Attachment->new($self->get("attachment"),$self->get("wobjectId")); - $var{"attachment.box"} = $file->box; - $var{"attachment.icon"} = $file->getIcon; - $var{"attachment.url"} = $file->getURL; - $var{"attachment.name"} = $file->getFilename; - } - my $callback = $self->getUrl("func=view&wid=".$self->get("wobjectId")); + my $callback = $self->getUrl; if ($self->get("allowDiscussion")) { my $forum = WebGUI::Forum->new($self->get("forumId")); $var{"replies.count"} = ($forum->get("replies") + $forum->get("threads")); $var{"replies.URL"} = WebGUI::Forum::UI::formatForumURL($callback,$forum->get("forumId")); - $var{"replies.label"} = WebGUI::International::get(28,$self->get("namespace")); + $var{"replies.label"} = WebGUI::International::get(28,"Article"); $var{"post.URL"} = WebGUI::Forum::UI::formatNewThreadURL($callback,$forum->get("forumId")); - $var{"post.label"} = WebGUI::International::get(24,$self->get("namespace")); + $var{"post.label"} = WebGUI::International::get(24,"Article"); } my $templateId = $self->get("templateId"); if ($session{form}{overrideTemplateId} ne "") { diff --git a/lib/WebGUI/Asset/Wobject/Layout.pm b/lib/WebGUI/Asset/Wobject/Layout.pm index 9394bc50e..6aaaa6ef6 100644 --- a/lib/WebGUI/Asset/Wobject/Layout.pm +++ b/lib/WebGUI/Asset/Wobject/Layout.pm @@ -133,13 +133,7 @@ sub getUiLevel { #------------------------------------------------------------------- sub view { my $self = shift; - my $children = $self->getLineage( - ["descendants"], - { - returnObjects=>1, - endingLineageLength=>$self->getLineageLength+1 - } - ); + my $children = $self->getLineage( ["children"], { returnObjects=>1 }); my %vars; # I'm sure there's a more efficient way to do this. We'll figure it out someday. my @positions = split(/\./,$self->get("contentPositions")); diff --git a/lib/WebGUI/Macro/RandomAssetProxy.pm b/lib/WebGUI/Macro/RandomAssetProxy.pm index f33642217..7c5edbaf0 100644 --- a/lib/WebGUI/Macro/RandomAssetProxy.pm +++ b/lib/WebGUI/Macro/RandomAssetProxy.pm @@ -20,7 +20,7 @@ sub process { my ($url) = WebGUI::Macro::getParams(shift); my $asset = WebGUI::Asset->newByUrl($url); if (defined $asset) { - my $children = $asset->getLineage(["descendants"],{endingLineageLength=>$asset->getLineageLength+1}); + my $children = $asset->getLineage(["children"]); randomize; my $randomAssetId = $children->[rand(scalar(@{$children})]; my $randomAsset = WebGUI::Asset->newByDynamicClass($randomAssetId); diff --git a/lib/WebGUI/Wobject/Article.pm b/lib/WebGUI/Wobject/Article.pm deleted file mode 100644 index 12d1c2350..000000000 --- a/lib/WebGUI/Wobject/Article.pm +++ /dev/null @@ -1,205 +0,0 @@ -package WebGUI::Wobject::Article; - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2004 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 -#------------------------------------------------------------------- - -use strict; -use Tie::CPHash; -use WebGUI::Attachment; -use WebGUI::DateTime; -use WebGUI::Forum; -use WebGUI::Forum::UI; -use WebGUI::HTML; -use WebGUI::HTMLForm; -use WebGUI::Icon; -use WebGUI::International; -use WebGUI::Paginator; -use WebGUI::Privilege; -use WebGUI::Session; -use WebGUI::URL; -use WebGUI::Wobject; - -our @ISA = qw(WebGUI::Wobject); - - - -#------------------------------------------------------------------- -sub duplicate { - my ($file, $w); - $w = $_[0]->SUPER::duplicate($_[1]); - $file = WebGUI::Attachment->new($_[0]->get("image"),$_[0]->get("wobjectId")); - $file->copy($w); - $file = WebGUI::Attachment->new($_[0]->get("attachment"),$_[0]->get("wobjectId")); - $file->copy($w); -} - -#------------------------------------------------------------------- -sub name { - return WebGUI::International::get(1,$_[0]->get("namespace")); -} - -#------------------------------------------------------------------- -sub new { - my $class = shift; - my $property = shift; - my $self = WebGUI::Wobject->new( - -properties=>$property, - -extendedProperties=>{ - image=>{ }, - linkTitle=>{ }, - linkURL=>{ }, - attachment=>{ }, - convertCarriageReturns=>{ - defaultValue=>0 - } - }, - -useDiscussion=>1, - -useMetaData=>1, - -useTemplate=>1 - ); - bless $self, $class; -} - -#------------------------------------------------------------------- -sub www_edit { - my $properties = WebGUI::HTMLForm->new; - my $layout = WebGUI::HTMLForm->new; - $properties->raw( - -value=>$_[0]->fileProperty("image",6), - -uiLevel=>3 - ); - $properties->raw( - -value=>$_[0]->fileProperty("attachment",9), - -uiLevel=>1 - ); - $properties->text( - -name=>"linkTitle", - -label=>WebGUI::International::get(7,$_[0]->get("namespace")), - -value=>$_[0]->getValue("linkTitle"), - -uiLevel=>3 - ); - $properties->url( - -name=>"linkURL", - -label=>WebGUI::International::get(8,$_[0]->get("namespace")), - -value=>$_[0]->getValue("linkURL"), - -uiLevel=>3 - ); - $layout->yesNo( - -name=>"convertCarriageReturns", - -label=>WebGUI::International::get(10,$_[0]->get("namespace")), - -value=>$_[0]->getValue("convertCarriageReturns"), - -subtext=>'   '.WebGUI::International::get(11,$_[0]->get("namespace")).'', - -uiLevel=>5 - ); - return $_[0]->SUPER::www_edit( - -properties=>$properties->printRowsOnly, - -layout=>$layout->printRowsOnly, - -headingId=>12, - -helpId=>"article add/edit" - ); -} - -#------------------------------------------------------------------- -sub www_editSave { - my ($image, $attachment, %property); - $_[0]->SUPER::www_editSave() if ($_[0]->get("wobjectId") eq "new"); - $image = WebGUI::Attachment->new("",$_[0]->get("wobjectId")); - $image->save("image"); - $attachment = WebGUI::Attachment->new("",$_[0]->get("wobjectId")); - $attachment->save("attachment"); - $property{image} = $image->getFilename if ($image->getFilename ne ""); - $property{attachment} = $attachment->getFilename if ($attachment->getFilename ne ""); - return $_[0]->SUPER::www_editSave(\%property); -} - -#------------------------------------------------------------------- -sub www_view { - my $self = shift; - $self->logView() if ($session{setting}{passiveProfilingEnabled}); - my ($file, %var); - if ($self->get("image") ne "") { - $file = WebGUI::Attachment->new($self->get("image"),$self->get("wobjectId")); - $var{"image.url"} = $file->getURL; - $var{"image.thumbnail"} = $file->getThumbnail; - } - $var{description} = $self->get("description"); - if ($self->get("convertCarriageReturns")) { - $var{description} =~ s/\n/\\n/g; - } - $var{"new.template"} = WebGUI::URL::page("wid=".$self->get("wobjectId")."&func=view")."&overrideTemplateId="; - $var{"description.full"} = $var{description}; - $var{"description.full"} =~ s/\^\-\;//g; - $var{"description.first.100words"} = $var{"description.full"}; - $var{"description.first.100words"} =~ s/(((\S+)\s+){100}).*/$1/s; - $var{"description.first.75words"} = $var{"description.first.100words"}; - $var{"description.first.75words"} =~ s/(((\S+)\s+){75}).*/$1/s; - $var{"description.first.50words"} = $var{"description.first.75words"}; - $var{"description.first.50words"} =~ s/(((\S+)\s+){50}).*/$1/s; - $var{"description.first.25words"} = $var{"description.first.50words"}; - $var{"description.first.25words"} =~ s/(((\S+)\s+){25}).*/$1/s; - $var{"description.first.10words"} = $var{"description.first.25words"}; - $var{"description.first.10words"} =~ s/(((\S+)\s+){10}).*/$1/s; - $var{"description.first.2paragraphs"} = $var{"description.full"}; - $var{"description.first.2paragraphs"} =~ s/^((.*?\n){2}).*/$1/s; - $var{"description.first.paragraph"} = $var{"description.first.2paragraphs"}; - $var{"description.first.paragraph"} =~ s/^(.*?\n).*/$1/s; - $var{"description.first.4sentences"} = $var{"description.full"}; - $var{"description.first.4sentences"} =~ s/^((.*?\.){4}).*/$1/s; - $var{"description.first.3sentences"} = $var{"description.first.4sentences"}; - $var{"description.first.3sentences"} =~ s/^((.*?\.){3}).*/$1/s; - $var{"description.first.2sentences"} = $var{"description.first.3sentences"}; - $var{"description.first.2sentences"} =~ s/^((.*?\.){2}).*/$1/s; - $var{"description.first.sentence"} = $var{"description.first.2sentences"}; - $var{"description.first.sentence"} =~ s/^(.*?\.).*/$1/s; - my $p = WebGUI::Paginator->new(WebGUI::URL::page("wid=".$self->get("wobjectId")."&func=view"),1); - if ($session{form}{makePrintable} || $var{description} eq "") { - $var{description} =~ s/\^\-\;//g; - $p->setDataByArrayRef([$var{description}]); - } else { - my @pages = split(/\^\-\;/,$var{description}); - $p->setDataByArrayRef(\@pages); - $var{description} = $p->getPage; - } - $p->appendTemplateVars(\%var); - if ($self->get("attachment") ne "") { - $file = WebGUI::Attachment->new($self->get("attachment"),$self->get("wobjectId")); - $var{"attachment.box"} = $file->box; - $var{"attachment.icon"} = $file->getIcon; - $var{"attachment.url"} = $file->getURL; - $var{"attachment.name"} = $file->getFilename; - } - my $callback = WebGUI::URL::page("func=view&wid=".$self->get("wobjectId")); - if ($self->get("allowDiscussion")) { - my $forum = WebGUI::Forum->new($self->get("forumId")); - $var{"replies.count"} = ($forum->get("replies") + $forum->get("threads")); - $var{"replies.URL"} = WebGUI::Forum::UI::formatForumURL($callback,$forum->get("forumId")); - $var{"replies.label"} = WebGUI::International::get(28,$self->get("namespace")); - $var{"post.URL"} = WebGUI::Forum::UI::formatNewThreadURL($callback,$forum->get("forumId")); - $var{"post.label"} = WebGUI::International::get(24,$self->get("namespace")); - } - my $templateId = $self->get("templateId"); - if ($session{form}{overrideTemplateId} ne "") { - $templateId = $session{form}{overrideTemplateId}; - } - if ($session{form}{forumOp}) { - return WebGUI::Forum::UI::forumOp({ - callback=>$callback, - title=>$self->get("title"), - description=>$self->get("description"), - forumId=>$self->get("forumId") - }); - } else { - return $self->processTemplate($templateId,\%var); - } -} - - -1; -