Adding features to Matrix v2

This commit is contained in:
Yung Han Khoe 2008-11-09 01:14:36 +00:00
parent 22f5565351
commit c9228b4324
5 changed files with 756 additions and 127 deletions

View file

@ -79,19 +79,20 @@ sub definition {
tie %properties, 'Tie::IxHash';
my $i18n = WebGUI::International->new($session, "Asset_MatrixListing");
%properties = (
templateId => {
tab =>"display",
fieldType =>"template",
defaultValue =>'MatrixListingTmpl00001',
noFormPost =>0,
namespace =>"MatrixListing",
hoverHelp =>$i18n->get('template description'),
label =>$i18n->get('template label')
},
# templateId => {
# tab =>"display",
# fieldType =>"template",
# defaultValue =>'MatrixListingTmpl00001',
# noFormPost =>0,
# namespace =>"MatrixListing",
# hoverHelp =>$i18n->get('template description'),
# label =>$i18n->get('template label')
# },
screenshots => {
tab =>"properties",
fieldType =>"image",
defaultValue =>undef,
maxAttachments =>20,
label =>$i18n->get("screenshots label"),
hoverHelp =>$i18n->get("screenshots description")
},
@ -217,6 +218,119 @@ sub getAutoCommitWorkflowId {
#-------------------------------------------------------------------
=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 $session = $self->session;
my $db = $session->db;
my $matrixId = $self->getParent->getId;
my $tabform = $self->SUPER::getEditForm();
my $i18n = WebGUI::International->new($session, 'Asset_MatrixListing');
#$self->session->style->setScript($self->session->url->extras('FileUploadControl.js'), {type =>'text/javascript'});
foreach my $category (keys %{$self->getParent->getCategories}) {
$tabform->getTab('properties')->raw('<tr><td colspan="2"><b>'.$category.'</b></td></tr>');
my $attributes;
if ($session->form->process('func') eq 'add'){
$attributes = $db->read("select * from Matrix_attribute where category = ? and assetId = ?",
[$category,$matrixId]);
}
else{
$attributes = $db->read("select * from Matrix_attribute as a
left join MatrixListing_attribute as l on (a.attributeId = l.attributeId and l.matrixListingId = ?)
where category =? and a.assetId = ?",
[$self->getId,$category,$matrixId]);
}
while (my $attribute = $attributes->hashRef) {
$attribute->{label} = $attribute->{name};
$attribute->{subtext} = $attribute->{description};
$attribute->{name} = 'attribute_'.$attribute->{attributeId};
$tabform->getTab("properties")->dynamicField(%{$attribute});
}
}
return $tabform;
=cut
$tabform->hidden({
name=>"returnUrl",
value=>$self->session->form->get("returnUrl")
});
if ($self->getValue("namespace") eq "") {
my $namespaces = $self->session->dbSlave->buildHashRef("select distinct(namespace) from template order by
namespace");
$tabform->getTab("properties")->combo(
-name=>"namespace",
-options=>$namespaces,
-label=>$i18n->get('namespace'),
-hoverHelp=>$i18n->get('namespace description'),
-value=>[$self->session->form->get("namespace")]
);
}
=cut
}
#-------------------------------------------------------------------
=head2 hasRated ( )
Returns whether the user has already rated this listing or not.
=cut
sub hasRated {
my $self = shift;
my $session = $self->session;
=cut
return 1 unless ($self->session->user->isInGroup($self->get("groupToRate")));
my $ratingTimeout = $self->session->user->isInGroup($self->get("privilegedGroup")) ?
$self->get("ratingTimeoutPrivileged") : $self->get("ratingTimeout");
=cut
my $hasRated = $self->session->db->quickScalar("select count(*) from MatrixListing_rating where
((userId=? and userId<>'1') or (userId='1' and ipAddress=?)) and listingId=?",
[$session->user->userId,$session->env->get("HTTP_X_FORWARDED_FOR"),$self->getId]);
return $hasRated;
}
#-------------------------------------------------------------------
=head2 incrementCounter ( counter )
Increments one of the Matrix Listing's counters.
=head3 counter
The name of the counter to increment this should be 'views', 'clicks' or 'compares').
=cut
sub incrementCounter {
my $self = shift;
my $db = $self->session->db;
my $counter = shift;
my $currentIp = $self->session->env->get("HTTP_X_FORWARDED_FOR");
print "current ip: ".$currentIp."<br>";
print "dsfsdf lastIp : ".$self->get($counter."LastIp")."<br>";
unless ($self->get($counter."LastIp") eq $currentIp) {
$self->update({
$counter."LastIp" => $currentIp,
$counter => $self->get($counter)+1,
});
}
}
#-------------------------------------------------------------------
=head2 indexContent ( )
Making private. See WebGUI::Asset::indexContent() for additonal details.
@ -241,8 +355,8 @@ See WebGUI::Asset::prepareView() for details.
sub prepareView {
my $self = shift;
$self->SUPER::prepareView();
my $template = WebGUI::Asset::Template->new($self->session, $self->get("templateId"));
$template->prepare;
my $template = WebGUI::Asset::Template->new($self->session, $self->getParent->get('detailTemplateId'));
$template->prepare;
$self->{_viewTemplate} = $template;
}
@ -251,15 +365,26 @@ sub prepareView {
=head2 processPropertiesFromFormPost ( )
Used to process properties from the form posted. Do custom things with
noFormPost fields here, or do whatever you want. This method is called
when /yourAssetUrl?func=editSave is requested/posted.
Used to process properties from the form posted.
=cut
sub processPropertiesFromFormPost {
my $self = shift;
my $self = shift;
my $session = $self->session;
$self->SUPER::processPropertiesFromFormPost;
my $attributes = $session->db->read("select * from Matrix_attribute where assetId = ?",[$self->getParent->getId]);
while (my $attribute = $attributes->hashRef) {
my $name = 'attribute_'.$attribute->{attributeId};
#my $value = $session->form->process($name);
my $value = $session->form->process($name,$attribute->{fieldType},$attribute->{defaultValue},$attribute);
$session->db->write("replace into MatrixListing_attribute (matrixId, matrixListingId, attributeId, value)
values (?, ?, ?, ?)",
[$self->getParent->getId,$self->getId,$attribute->{attributeId},$value]);
}
$self->requestAutoCommit;
}
@ -275,7 +400,13 @@ purges it's data.
=cut
sub purge {
my $self = shift;
my $self = shift;
my $db = $self->session->db;
$db->write("delete from MatrixListing_attribute where matrixListingId=?",[$self->getId]);
$db->write("delete from MatrixListing_rating where listingId=?" ,[$self->getId]);
$db->write("delete from MatrixListing_ratingSummary where listingId=?" ,[$self->getId]);
return $self->SUPER::purge;
}
@ -293,22 +424,249 @@ sub purgeRevision {
}
#-------------------------------------------------------------------
=head2 view ( )
=head2 setRatings ( ratings )
Sets the ratings for a matrix listing
=head3 ratings
A hashref containing the ratings to set for this listing.
=cut
sub setRatings {
my $self = shift;
my $ratings = shift;
my $session = $self->session;
my $db = $session->db;
my $matrixId = $self->getParent->getId;
foreach my $category (keys %{$self->getParent->getCategories}) {
if ($ratings->{$category}) {
$db->write("insert into MatrixListing_rating
(userId, category, rating, timeStamp, listingId, ipAddress, matrixId) values (?,?,?,?,?,?,?)",
[$session->user->userId,$category,$ratings->{$category},$session->datetime->time(),$self->getId,
$session->env->get("HTTP_X_FORWARDED_FOR"),$matrixId]);
}
my $sql = "from MatrixListing_rating where listingId=? and category=?";
my $sum = $db->quickScalar("select sum(rating) $sql", [$self->getId,$category]);
my $count = $db->quickScalar("select count(*) $sql", [$self->getId,$category]);
my $half = round($count/2);
my $mean = $sum / ($count || 1);
my $median = $db->quickScalar("select rating $sql limit $half,$half",[$self->getId,$category]);
$db->write("replace into MatrixListing_ratingSummary
(listingId, category, meanValue, medianValue, countValue, matrixId)
values (?,?,?,?,?,?)",[$self->getId,$category,$mean,$median,$count,$matrixId]);
}
}
#-------------------------------------------------------------------
=head2 view ( hasRated )
method called by the container www_view method.
=head3 hasRated
A boolean indicating if the user has rated this listing.
=head3 hasRated
A boolean indicating if an email to the listing maintianer was sent.
=cut
sub view {
my $self = shift;
my $var = $self->get; # $var is a hash reference.
$var->{controls} = $self->getToolbar;
$var->{fileUrl} = $self->getFileUrl;
$var->{fileIcon} = $self->getFileIconUrl;
my $self = shift;
my $hasRated = shift || $self->hasRated;
my $emailSent = shift;
my $db = $self->session->db;
my $i18n = WebGUI::International->new($self->session, "Asset_Matrix");
my @categories = keys %{$self->getParent->getCategories};
# Increment views before getting template var hash so that the views tmpl_var has the incremented value.
$self->incrementCounter("views");
my $var = $self->get;
if ($emailSent){
$var->{emailSent} = 1;
}
$var->{controls} = $self->getToolbar;
$var->{productName} = $var->{title};
$var->{lastUpdated_epoch} = $self->get('lastUpdated');
$var->{lastUpdated_date} = $self->session->datetime->epochToHuman($self->get('lastUpdated'),"%z");
$var->{manufacturerUrl_click} = $self->getUrl("func=click;manufacturer=1");
$var->{productUrl_click} = $self->getUrl("func=click");
# Attributes
foreach my $category (@categories) {
my $attributes;
my @attribute_loop;
my $categoryLoopName = $self->session->url->urlize($category)."_loop";
$attributes = $db->read("select * from Matrix_attribute as a
left join MatrixListing_attribute as l on (a.attributeId = l.attributeId and l.matrixListingId = ?)
where category =? and a.assetId = ?",
[$self->getId,$category,$self->getParent->getId]);
while (my $attribute = $attributes->hashRef) {
$attribute->{label} = $attribute->{name};
if ($attribute->{fieldType} eq 'MatrixCompare'){
$attribute->{value} = WebGUI::Form::MatrixCompare->new($self->session,$attribute)->getValueAsHtml;
}
#$attribute->{value} = $attribute->{description};
#$tabform->getTab("properties")->dynamicField(%{$attribute});
#my $categoryLoopName = $self->session->url->urlize($category)."_loop";
push(@attribute_loop,$attribute);
}
$var->{$categoryLoopName} = \@attribute_loop;
push(@{$var->{category_loop}},{
categoryLabel => $category,
attribute_loop => \@attribute_loop,
});
}
# Screenshots
if ($var->{screenshots}) {
my $file = WebGUI::Form::File->new($self->session,{ value=>$var->{screenshots} });
my $storage = $file->getStorageLocation;
my @files = @{ $storage->getFiles } if (defined $storage);
if (scalar(@files)) {
$var->{screenshots} = $file->getFilePreview($storage);
}
}
# Rating form
my %rating;
tie %rating, 'Tie::IxHash';
%rating = (
1=>"1 - Worst",
2=>2,
3=>3,
4=>4,
5=>"5 - Respectable",
6=>6,
7=>7,
8=>8,
9=>9,
10=>"10 - Best"
);
my $ratingsTable = "<table class='ratingForm'><tbody>\n
<tr><th></th><th>Mean</th><th>Median</th><th>Count</th></tr>\n";
my $ratingForm = WebGUI::HTMLForm->new($self->session,
-extras =>'class="content"',
-tableExtras=>'class="content"'
);
$ratingForm = WebGUI::HTMLForm->new($self->session,
-extras =>'class="ratingForm"',
-tableExtras=>'class="ratingForm"'
);
$ratingForm->hidden(
-name =>"listingId",
-value =>$self->getId
);
$ratingForm->hidden(
-name =>"func",
-value =>"rate"
);
foreach my $category (@categories) {
my ($mean,$median,$count) = $db->quickArray("select meanValue, medianValue, countValue
from MatrixListing_ratingSummary
where listingId=? and category=?",[$self->getId,$category]);
$ratingsTable .= '<tr><th>'.$category.'</th><td>'.$mean.'</td><td>'.$median.'</td><td>'.$count.'</td></tr>';
$ratingForm->selectBox(
-name =>$category,
-label =>$category,
-value =>[5],
-extras =>'class="ratingForm"',
-options=>\%rating
);
}
$ratingsTable .= '</tbody></table>';
$ratingForm->submit(
-extras =>'class="ratingForm"',
-value =>$i18n->get('rate submit label'),
-label =>'<a href="'.$self->getUrl("func=rate").'">'.$i18n->get('show ratings').'</a>'
);
if ($hasRated) {
$var->{ratings} = $ratingsTable;
} else {
$var->{ratings} = $ratingForm->print;
}
# Mail form
my $mailForm = WebGUI::HTMLForm->new($self->session,
-extras =>'class="content"',
-tableExtras=>'class="content"'
);
$mailForm->hidden(
-name =>"func",
-value =>"sendEmail"
);
$mailForm->captcha(
-name =>"verify"
);
$mailForm->email(
-extras =>'class="content"',
-name =>"from",
-value =>$self->session->user->profileField("email"),
-label =>$i18n->get('your email label'),
);
$mailForm->selectBox(
-name =>"subject",
-extras =>'class="content"',
-options =>{
$i18n->get('report error label') =>$i18n->get('report error label'),
$i18n->get('general comment label') =>$i18n->get('general comment label'),
},
-label =>$i18n->get('request type label'),
);
$mailForm->textarea(
-rows =>4,
-extras =>'class="content"',
-columns =>35,
-name =>"body",
-label =>$i18n->get('comment label'),
);
$mailForm->submit(
-extras =>'class="content"',
-value =>$i18n->get('send button label'),
);
$var->{emailForm} = $mailForm->print;
return $self->processTemplate($var,undef, $self->{_viewTemplate});
}
#-------------------------------------------------------------------
=head2 www_click ( )
Redirects to the manufacturerUrl or productUrl and increments clicks.
=cut
sub www_click {
my $self = shift;
my $session = $self->session;
$self->incrementCounter('clicks');
if ($session->form->process("manufacturer")) {
$session->http->setRedirect( $self->get('manufacturerUrl') );
}
else {
$session->http->setRedirect( $self->get('productUrl') );
}
return undef;
}
#-------------------------------------------------------------------
=head2 www_edit ( )
@ -330,6 +688,75 @@ sub www_edit {
#-------------------------------------------------------------------
=head2 www_rate ( )
Saves a rating of a matrix listing and returns the listing view.
=cut
sub www_rate {
my $self = shift;
my $form = $self->session->form;
my $hasRated = $self->hasRated;
my $sameRating = 1;
my $first = 1;
my $lastRating;
foreach my $category (keys %{$self->getParent->getCategories}) {
if ($first) {
$first=0;
} else {
if ($lastRating != $form->process($category)) {
$sameRating = 0;
}
}
$lastRating = $form->process($category);
}
# Throw out ratings that are all the same number, or if the user rates twice.
unless ($hasRated || $sameRating) {
$self->setRatings($self->session->form->paramsHashRef);
}
$self->prepareView;
return $self->view;
}
#-------------------------------------------------------------------
=head2 www_sendEmail ( )
Sends an email to the maintainer of this matrix listing and returns www_view
=cut
sub www_sendEmail {
my $self = shift;
my $form = $self->session->form;
return $self->session->privilege->noAccess() unless $self->canView;
if ($form->process("verify","captcha")) {
if ($form->process("body") ne "") {
my $user = WebGUI::User->new($self->session, $self->get('maintainerId'));
my $mail = WebGUI::Mail::Send->create($self->session,{
to =>$user->profileField("email"),
subject =>$self->get('productName')." - ".$form->process("subject"),
from=>$form->process("from")
});
$mail->addText($form->process("body"));
$mail->addFooter;
$mail->queue;
}
}
$self->prepareView;
return $self->view(0,1);
}
#-------------------------------------------------------------------
=head2 www_view ( )
Web facing method which is the default view page. This method does a
@ -340,11 +767,8 @@ Web facing method which is the default view page. This method does a
sub www_view {
my $self = shift;
return $self->session->privilege->noAccess() unless $self->canView;
if ($self->session->var->isAdminOn) {
return $self->getContainer->www_view;
}
$self->session->http->setRedirect($self->getFileUrl($self->getValue("showPage")));
return undef;
$self->prepareView;
return $self->view;
}
#-------------------------------------------------------------------
@ -390,6 +814,13 @@ sub install {
productURL varchar(255),
primary key (assetId, revisionDate)
)");
$session->db->write("create table MatrixListing_attribute (
matrixId char(22) not null,
matrixListingId char(22) not null,
attributeId char(22) not null,
value char(255),
primary key (matrixId, matrixListingId, attributeId)
)");
$session->var->end;
$session->close;
print "Done. Please restart Apache.\n";

View file

@ -374,11 +374,161 @@ to be displayed within the page style.
=cut
sub view {
my $self = shift;
my $self = shift;
my $session = $self->session;
my $db = $session->db;
#This automatically creates template variables for all of your wobject's properties.
my $var = $self->get;
$var->{isLoggedIn} = ($self->session->user->userId ne "1");
$var->{addMatrixListing_url} = $self->getUrl('func=add;class=WebGUI::Asset::MatrixListing');
# Get the MatrixListing with the most views as an object using getLineage.
my ($bestViews_listing) = @{ $self->getLineage(['descendants'], {
includeOnlyClasses => ['WebGUI::Asset::MatrixListing'],
joinClass => "WebGUI::Asset::MatrixListing",
orderByClause => "views desc",
limit => 1,
returnObjects => 1,
}) };
$var->{bestViews_url} = $bestViews_listing->getUrl;
$var->{bestViews_count} = $bestViews_listing->get('views');
$var->{bestViews_name} = $bestViews_listing->get('title');
# Get the MatrixListing with the most compares as an object using getLineage.
my ($bestCompares_listing) = @{ $self->getLineage(['descendants'], {
includeOnlyClasses => ['WebGUI::Asset::MatrixListing'],
joinClass => "WebGUI::Asset::MatrixListing",
orderByClause => "compares desc",
limit => 1,
returnObjects => 1,
}) };
$var->{bestCompares_url} = $bestCompares_listing->getUrl;
$var->{bestCompares_count} = $bestCompares_listing->get('views');
$var->{bestCompares_name} = $bestCompares_listing->get('title');
# Get the MatrixListing with the most clicks as an object using getLineage.
my ($bestClicks_listing) = @{ $self->getLineage(['descendants'], {
includeOnlyClasses => ['WebGUI::Asset::MatrixListing'],
joinClass => "WebGUI::Asset::MatrixListing",
orderByClause => "clicks desc",
limit => 1,
returnObjects => 1,
}) };
$var->{bestClicks_url} = $bestClicks_listing->getUrl;
$var->{bestClicks_count} = $bestClicks_listing->get('views');
$var->{bestClicks_name} = $bestClicks_listing->get('title');
# Get the MatrixListing that was last updated as an object using getLineage.
my ($bestUpdated_listing) = @{ $self->getLineage(['descendants'], {
includeOnlyClasses => ['WebGUI::Asset::MatrixListing'],
orderByClause => "revisionDate desc",
limit => 1,
returnObjects => 1,
}) };
$var->{bestUpdated_url} = $bestUpdated_listing->getUrl;
$var->{bestUpdated_date} = $session->datetime->epochToHuman( $bestUpdated_listing->get('revisionDate') );
$var->{bestUpdated_name} = $bestUpdated_listing->get('title');
# Get the 5 MatrixListings that were last updated as objects using getLineage.
my @lastUpdatedListings = @{ $self->getLineage(['descendants'], {
includeOnlyClasses => ['WebGUI::Asset::MatrixListing'],
orderByClause => "revisionDate desc",
limit => 5,
returnObjects => 1,
}) };
foreach my $lastUpdatedListing (@lastUpdatedListings){
push (@{ $var->{last_updated_loop} }, {
url => $lastUpdatedListing->getUrl,
name => $lastUpdatedListing->get('title'),
lastUpdated => $self->session->datetime->epochToHuman($lastUpdatedListing->get('revisionDate'),"%z")
});
}
# Get all the MatrixListings that are still pending.
my @pendingListings = @{ $self->getLineage(['descendants'], {
includeOnlyClasses => ['WebGUI::Asset::MatrixListing'],
orderByClause => "revisionDate asc",
returnObjects => 1,
statusToInclude => ['pending'],
}) };
foreach my $pendingListing (@pendingListings){
push (@{ $var->{pending_loop} }, {
url => $pendingListing->getUrl,
name => $pendingListing->get('title'),
});
}
# For each category, get the MatrixListings with the best ratings.
foreach my $category (keys %{$self->getCategories}) {
my $data;
my $sql = "
select
assetData.title as productName,
assetData.url,
listing.assetId,
rating.meanValue,
rating.medianValue,
rating.countValue
from MatrixListing as listing
left join asset on listing.assetId = asset.assetId
left join MatrixListing_ratingSummary as rating on rating.listingId = listing.assetId
left join assetData on assetData.assetId = listing.assetId and listing.revisionDate =
assetData.revisionDate
where
asset.parentId=?
and asset.state='published'
and asset.className='WebGUI::Asset::MatrixListing'
and assetData.revisionDate=(
select
max(revisionDate)
from
assetData
where
assetData.assetId=asset.assetId
and (status='approved' or status='archived')
)
and status='approved'
and rating.category=?
group by
assetData.assetId
order by rating.meanValue ";
$data = $db->quickHashRef($sql." desc limit 1",[$self->getId,$category]);
push(@{ $var->{best_rating_loop} },{
url=>'/'.$data->{url},
category=>$category,
name=>$data->{productName},
mean=>$data->{meanValue},
median=>$data->{medianValue},
count=>$data->{countValue}
});
$data = $db->quickHashRef($sql." asc limit 1",[$self->getId,$category]);
push(@{ $var->{worst_rating_loop} },{
url=>'/'.$data->{url},
category=>$category,
name=>$data->{productName},
mean=>$data->{meanValue},
median=>$data->{medianValue},
count=>$data->{countValue}
});
}
$var->{listingCount} = scalar $db->buildArray("
select *
from asset, assetData
where asset.assetId=assetData.assetId
and asset.parentId=?
and asset.state='published'
and asset.className='WebGUI::Asset::MatrixListing'
and assetData.status='approved'
group by asset.assetId",
[$self->getId]);
#This is an example of debugging code to help you diagnose problems.
#WebGUI::ErrorHandler::warn($self->get("templateId"));

View file

@ -115,6 +115,27 @@ sub getValue {
#-------------------------------------------------------------------
=head2 getValueAsHtml ()
Shows either Yes or No.
=cut
sub getValueAsHtml {
my $self = shift;
my $i18n = WebGUI::International->new($self->session,'Form_MatrixCompare');
my %options = (
0 => $i18n->get('no'),
1 => $i18n->get('limited'),
2 => $i18n->get('costs extra'),
3 => $i18n->get('free add on'),
4 => $i18n->get('yes'),
);
return $options{$self->getOriginalValue};
}
#-------------------------------------------------------------------
=head2 isDynamicCompatible ( )
Returns 0.
@ -135,7 +156,7 @@ Renders a fieldType selector.
sub toHtml {
my $self = shift;
my $i18n = WebGUI::International->new($session,'Form_MatrixCompare');
my $i18n = WebGUI::International->new($self->session,'Form_MatrixCompare');
my %options;
tie %options, "Tie::IxHash";
%options = (

View file

@ -153,16 +153,16 @@ our $HELP = {
{ 'name' => 'search.url' },
{ 'name' => 'isLoggedIn' },
{ 'name' => 'field.list.url' },
{ 'name' => 'listing.add.url' },
{ 'name' => 'best.views.url' },
{ 'name' => 'best.views.count' },
{ 'name' => 'best.views.name' },
{ 'name' => 'best.compares.url' },
{ 'name' => 'best.compares.count' },
{ 'name' => 'best.compares.name' },
{ 'name' => 'best.clicks.url' },
{ 'name' => 'best.clicks.count' },
{ 'name' => 'best.clicks.name' },
{ 'name' => 'addMatrixListing_url' },
{ 'name' => 'bestViews_url' },
{ 'name' => 'bestViews_count' },
{ 'name' => 'bestViews_name' },
{ 'name' => 'bestCompares_url' },
{ 'name' => 'bestCompares_count' },
{ 'name' => 'bestCompares_name' },
{ 'name' => 'bestClicks_url' },
{ 'name' => 'bestClicks_count' },
{ 'name' => 'bestClicks_name' },
{ 'name' => 'best_rating_loop',
'variables' => [
{ 'name' => 'url',
@ -203,9 +203,9 @@ our $HELP = {
},
{ 'name' => 'ratings.details.url' },
{ 'name' => 'best.posts.url' },
{ 'name' => 'best.updated.url' },
{ 'name' => 'best.updated.date' },
{ 'name' => 'best.updated.name' },
{ 'name' => 'bestUpdated_url' },
{ 'name' => 'bestUpdated_date' },
{ 'name' => 'bestUpdated_name' },
{ 'name' => 'last_update_loop',
'variables' => [
{ 'name' => 'url',
@ -221,7 +221,7 @@ our $HELP = {
},
{ 'name' => 'user.count' },
{ 'name' => 'current.user.count' },
{ 'name' => 'listing.count' },
{ 'name' => 'listingCount' },
{ 'name' => 'pending_list',
'variables' => [
{ 'name' => 'url',
@ -266,8 +266,8 @@ our $HELP = {
{ 'name' => 'approve.url' },
{ 'name' => 'delete.url' },
{ 'name' => 'isPending' },
{ 'name' => 'lastUpdated.epoch' },
{ 'name' => 'lastUpdated.date' },
{ 'name' => 'lastUpdated_epoch' },
{ 'name' => 'lastUpdated_date' },
{ 'name' => 'id' },
{ 'name' => 'description',
'description' => 'listing description'

View file

@ -63,6 +63,12 @@ our $I18N = {
lastUpdated => 1149783768,
},
'categoryLabel' => {
message => q|The label of a category.|,
lastUpdated => 1149783768,
},
'tmplVar category' => {
message => q|The name of the current category.|,
lastUpdated => 1149783768,
@ -158,64 +164,59 @@ our $I18N = {
lastUpdated => 1167186037,
},
'lastUpdated.epoch' => {
'lastUpdated_epoch' => {
message => q|The epoch date of when this listing was last updated.|,
lastUpdated => 1149784175,
lastUpdated => 0,
},
'lastUpdated.date' => {
'lastUpdated_date' => {
message => q|A human readable date of when this listing was last updated.|,
lastUpdated => 1149784175,
lastUpdated => 0,
},
'id' => {
message => q|The unique identifier of this listing.|,
lastUpdated => 1149784175,
},
'listing description' => {
'description' => {
message => q|The description of this listing.|,
lastUpdated => 1149784175,
lastUpdated => 0,
},
'productName' => {
message => q|The name of this listing.|,
lastUpdated => 1149784175,
message => q|The name of this listing. This is the same as this matrix listing's asset title.|,
lastUpdated => 0,
},
'productUrl' => {
message => q|The manufacturer's URL for this listing.|,
lastUpdated => 1149784175,
lastUpdated => 0,
},
'productUrl.click' => {
'productUrl_click' => {
message => q|The product URL to use if you want to register the click count for this listing.|,
lastUpdated => 1149784175,
lastUpdated => 0,
},
'manufacturerUrl' => {
message => q|The manufacturer's URL.|,
lastUpdated => 1149784175,
lastUpdated => 0,
},
'manufacturerUrl.click' => {
'manufacturerUrl_click' => {
message => q|The manufacturer URL to use if you want to register the click count for this listing.|,
lastUpdated => 1149784175,
lastUpdated => 0,
},
'views' => {
message => q|The total number of views this listing has received.|,
lastUpdated => 1149784175,
lastUpdated => 0,
},
'compares' => {
message => q|The total number of compares this listing has received.|,
lastUpdated => 1149784175,
lastUpdated => 0,
},
'clicks' => {
message => q|The total number of clicks this listing has received.|,
lastUpdated => 1149784175,
lastUpdated => 0,
},
'ratings' => {
@ -224,10 +225,15 @@ our $I18N = {
},
'CATEGORY_NAME_loop' => {
message => q|A loop is created for each category in this matrix. The name of the loop is the category name with spaces replaced with hyphens and a _loop added to the end. So if you have a category called "Bells and Whistles" then the loop would be called "bells-and-whistles_loop".|,
lastUpdated => 1167186070,
message => q|A loop containting attributes and values for those attributes is created for each category in this matrix. The name of the loop is the category name with spaces replaced with hyphens and a _loop added to the end. So if you have a category called "Bells and Whistles" then the loop would be called "bells-and-whistles_loop".|,
lastUpdated => 0,
},
'attribute_loop' => {
message => q|A loop containing attributes and values for those attributes.|,
lastUpdated => 0,
},
'tmplVar name' => {
message => q|The name of this field.|,
lastUpdated => 1149784175,
@ -273,124 +279,124 @@ our $I18N = {
lastUpdated => 1149795214,
},
'listing.add.url' => {
'addMatrixListing_url' => {
message => q|The URL to the page where a user can add a new listing to the matrix.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'best.views.url' => {
'bestViews_url' => {
message => q|The URL to the listing that has the most views.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'best.views.count' => {
'bestViews_count' => {
message => q|The total number of views of the listing that has the most views.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'best.views.name' => {
'bestViews_name' => {
message => q|The name of the listing that has the most views.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'best.compares.url' => {
'bestCompares_url' => {
message => q|The URL to the listing that has the most compares.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'best.compares.count' => {
'bestCompares_count' => {
message => q|The number of compares of the listing that has the most compares.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'best.compares.name' => {
'bestCompares_name' => {
message => q|The name of the listing that has the most compares.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'best.clicks.url' => {
'bestClicks_url' => {
message => q|The URL of the listing that has the most clicks.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'best.clicks.count' => {
'bestClicks_count' => {
message => q|The number of clicks of the listing that has the most clicks.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'best.clicks.name' => {
'bestClicks_name' => {
message => q|The name of the listing that has the most clicks.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'best_rating_loop' => {
message => q|A loop containing all of the categories for this matrix and their best ratings.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'tmplVar best.url' => {
message => q|The URL of the listing that has the best rating for this category.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'tmplVar best.category' => {
message => q|The name of this category.|,
lastUpdated => 1167186103,
lastUpdated => 0,
},
'tmplVar best.name' => {
message => q|The name of the listing that has the best rating for this category.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'mean' => {
message => q|The mean (or average) rating of the best listing in this category.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'median' => {
message => q|The median (or middle) rating of the best listing in this category.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'count' => {
message => q|The sum of all the votes of the best listing in this category.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'worst_rating_loop' => {
message => q|A loop containing all of the categories for this matrix and their worst ratings.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'tmplVar worst.url' => {
message => q|The URL of the listing that has the worst rating for this category.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'tmplVar worst.category' => {
message => q|The name of this category.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'tmplVar worst.name' => {
message => q|The name of the listing that has the worst rating for this category.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'tmplVar worst.mean' => {
message => q|The mean (or average) rating of the worst listing in this category.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'tmplVar worst.median' => {
message => q|The median (or middle) rating of the worst listing in this category.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'tmplVar worst.count' => {
message => q|The sum of all the votes of the worst listing in this category.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'ratings.details.url' => {
@ -403,19 +409,19 @@ our $I18N = {
lastUpdated => 1149795214,
},
'best.updated.url' => {
'bestUpdated_url' => {
message => q|The URL to the listing that was updated most recently.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'best.updated.date' => {
'bestUpdated_date' => {
message => q|The date of the most recently updated listing.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'best.updated.name' => {
'bestUpdated_name' => {
message => q|The name of the listing that was most recently updated.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'last_update_loop' => {
@ -448,26 +454,36 @@ our $I18N = {
lastUpdated => 1149795214,
},
'listing.count' => {
'listingCount' => {
message => q|The number of listings in this matrix.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'pending_list' => {
'pending_loop' => {
message => q|A loop containing the list of pending listing.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'tmplVar pending.url' => {
message => q|The URL to the pending listing.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'tmplVar pending.productName' => {
'tmplVar pending.name' => {
message => q|The product title of the pending listing.|,
lastUpdated => 1149795214,
lastUpdated => 0,
},
'narrow the matrix label' => {
message => q|Narrow The Matrix|,
lastUpdated => 0,
},
'expand the matrix label' => {
message => q|Expand The Matrix|,
lastUpdated => 0,
},
'matrix template help title' => {
message => q|Matrix Main Template Variables|,
lastUpdated => 1184949132,
@ -827,36 +843,47 @@ our $I18N = {
lastUpdated => 0,
},
'your email' => {
'your email label' => {
message => q|Your Email Address|,
lastUpdated => 1133758944,
lastUpdated => 0,
},
'report error' => {
'report error label' => {
message => q|Report an error.|,
lastUpdated => 1133758944,
lastUpdated => 0,
},
'general comment' => {
'general comment label' => {
message => q|General comment.|,
lastUpdated => 1133758944,
lastUpdated => 0,
},
'request type' => {
'request type label' => {
message => q|Type of Request|,
lastUpdated => 1133758944,
lastUpdated => 0,
},
'comment' => {
'comment label' => {
message => q|Comment|,
lastUpdated => 1133758944,
lastUpdated => 0,
},
'send button label' => {
message => q|Send...|,
lastUpdated => 0,
},
'show ratings' => {
message => q|Show Ratings|,
lastUpdated => 1133758944,
lastUpdated => 0,
},
'rate submit label' => {
message => q|Rate|,
lastUpdated => 0,
},
'no copy' => {
message => q|This asset may not be copied.|,
lastUpdated => 1133758944,