merge back with HEAD for 7.7.0
This commit is contained in:
parent
426bc41b04
commit
04105713f0
23 changed files with 120 additions and 60 deletions
|
|
@ -261,27 +261,32 @@ sub set {
|
|||
$self->{_properties}{priority} = exists $properties->{priority} ? $properties->{priority} : $self->{_properties}{priority};
|
||||
# prerender the ad for faster display
|
||||
my $adSpace = WebGUI::AdSpace->new($self->session, $self->get("adSpaceId"));
|
||||
if ($self->get("type") eq "text") {
|
||||
$self->{_properties}{renderedAd} = '<div style="position:relative; width:' . ($adSpace->get("width")-2) . 'px; height:' .
|
||||
($adSpace->get("height")-2) . 'px; margin:0px; overflow:hidden; border:solid ' . $self->get("borderColor") .
|
||||
q{ 1px;"><a href='#' OnClick="window.location.assign('} .
|
||||
$self->session->url->gateway(undef, "op=clickAd;id=".$self->getId) .
|
||||
q{')" style="position:absolute; padding: 3px; top:0px; left:0px; width:100%; height:100%; z-index:10;} .
|
||||
' display:block; text-decoration:none; vertical-align:top; background-color:' . $self->get("backgroundColor") .
|
||||
'; font-size: 13px; font-weight: normal;"><b><span style="color:' . $self->get("textColor") . ';">' .
|
||||
$self->get("title") . '</span></b><br /><span style="color:' . $self->get("textColor") . ';">' .
|
||||
$self->get("adText") . '</span></a></div>';
|
||||
} elsif ($self->get("type") eq "image") {
|
||||
my $storage = WebGUI::Storage->get($self->session, $self->get("storageId"));
|
||||
$self->{_properties}{renderedAd} = '<div style="position:relative; width:' . $adSpace->get("width") . 'px; height:' .
|
||||
$adSpace->get("height") . 'px; margin:0px; overflow:hidden; border:0px;"><a href="#" ' .
|
||||
q{onClick="window.location.assign('} .
|
||||
$self->session->url->gateway(undef, "op=clickAd;id=".$self->getId) . q{')" style="position:absolute; padding: } .
|
||||
'3px; top:0px; left:0px; width:100%; height:100%; z-index:10; display:block; text-decoration:none; ' .
|
||||
'vertical-align:top;"><img ' .
|
||||
'src="' . $storage->getUrl($storage->getFiles->[0]) . '" alt="' . $self->get("title") .
|
||||
'" style="z-index:0;position:relative;border-style:none;border: 0px;" /></a></div>';
|
||||
} elsif ($self->get("type") eq "rich") {
|
||||
if ($self->get("type") eq "text") {
|
||||
$self->{_properties}{renderedAd} =
|
||||
q{<div style="position:relative; width:} . ($adSpace->get("width")-2) . q{px; height:}
|
||||
. ($adSpace->get("height")-2) . q{px; margin:0px; overflow:hidden; border:solid }
|
||||
. $self->get("borderColor") . q{ 1px;"><a href='#' onclick="window.location.assign('}
|
||||
. $self->session->url->gateway(undef, "op=clickAd;id=".$self->getId)
|
||||
. q{')" style="position:absolute; padding: 3px; top:0px; left:0px; width:100%; height:100%; z-index:10;}
|
||||
. q{ display:block; text-decoration:none; vertical-align:top; background-color:}
|
||||
. $self->get("backgroundColor") . q{; font-size: 13px; font-weight: normal;"><b><span style="color:}
|
||||
. $self->get("textColor") . q{;">} . $self->get("title")
|
||||
. q{</span></b><br /><span style="color:} . $self->get("textColor") . q{;">}
|
||||
. $self->get("adText") . q{</span></a></div>};
|
||||
}
|
||||
elsif ($self->get("type") eq "image") {
|
||||
my $storage = WebGUI::Storage->get($self->session, $self->get("storageId"));
|
||||
$self->{_properties}{renderedAd} =
|
||||
q{<div style="position:relative; width:} . $adSpace->get("width") . q{px; height:}
|
||||
. $adSpace->get("height") . q{px; margin:0px; overflow:hidden; border:0px;"><a href="#" }
|
||||
. q{onclick="window.location.assign('} .$self->session->url->gateway(undef, "op=clickAd;id=".$self->getId)
|
||||
. q{')" style="position:absolute; padding: }
|
||||
. q{3px; top:0px; left:0px; width:100%; height:100%; z-index:10; display:block; text-decoration:none; }
|
||||
. q{vertical-align:top;"><img }
|
||||
. q{src="} . $storage->getUrl($storage->getFiles->[0]) . q{" alt="} . $self->get("title")
|
||||
. q{" style="z-index:0;position:relative;border-style:none;border: 0px;" /></a></div>};
|
||||
}
|
||||
elsif ($self->get("type") eq "rich") {
|
||||
my $ad = $self->get("richMedia");
|
||||
WebGUI::Macro::process($self->session, \$ad);
|
||||
$self->{_properties}{renderedAd} = $ad;
|
||||
|
|
|
|||
|
|
@ -313,6 +313,14 @@ sub getEditForm {
|
|||
$attribute->{label} = $attribute->{name};
|
||||
$attribute->{subtext} = $attribute->{description};
|
||||
$attribute->{name} = 'attribute_'.$attribute->{attributeId};
|
||||
if($attribute->{fieldType} eq 'Combo'){
|
||||
my %options;
|
||||
tie %options, 'Tie::IxHash';
|
||||
%options = $db->buildHash("select value, value from MatrixListing_attribute
|
||||
where attributeId = ? and value != '' order by value",[$attribute->{attributeId}]);
|
||||
$attribute->{options} = \%options;
|
||||
$attribute->{extras} = "style='width:120px'";
|
||||
}
|
||||
$form->dynamicField(%{$attribute});
|
||||
}
|
||||
}
|
||||
|
|
@ -572,6 +580,8 @@ sub view {
|
|||
if ($emailSent){
|
||||
$var->{emailSent} = 1;
|
||||
}
|
||||
$var->{canEdit} = $self->canEdit;
|
||||
$var->{editUrl} = $self->getUrl("func=edit");
|
||||
$var->{controls} = $self->getToolbar;
|
||||
$var->{comments} = $self->getFormattedComments();
|
||||
$var->{productName} = $var->{title};
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ sub definition {
|
|||
},
|
||||
parser => {
|
||||
noFormPost => 1,
|
||||
fieldType => 'selectList',
|
||||
fieldType => 'selectBox',
|
||||
defaultValue => [$session->config->get("defaultTemplateParser")],
|
||||
},
|
||||
namespace => {
|
||||
|
|
@ -144,6 +144,7 @@ sub processPropertiesFromFormPost {
|
|||
my %data;
|
||||
my $needsUpdate = 0;
|
||||
if ($self->getValue("parser") ne $self->session->form->process("parser","className") && ($self->session->form->process("parser","className") ne "")) {
|
||||
$needsUpdate = 1;
|
||||
if (isIn($self->session->form->process("parser","className"),@{$self->session->config->get("templateParsers")})) {
|
||||
%data = ( parser => $self->session->form->process("parser","className") );
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1104,6 +1104,7 @@ sub www_addAlbumService {
|
|||
description => $form->get('synopsis','textarea'),
|
||||
synopsis => $form->get('synopsis','textarea'),
|
||||
othersCanAdd => $form->get('othersCanAdd','yesNo'),
|
||||
ownerUserId => $session->user->userId,
|
||||
});
|
||||
|
||||
$album->requestAutoCommit;
|
||||
|
|
|
|||
|
|
@ -1019,6 +1019,7 @@ sub www_addFileService {
|
|||
title => $form->get('title','text'),
|
||||
description => $form->get('synopsis','textarea'),
|
||||
synopsis => $form->get('synopsis','textarea'),
|
||||
ownerUserId => $session->user->userId,
|
||||
});
|
||||
|
||||
my $storage = $file->getStorageLocation;
|
||||
|
|
|
|||
|
|
@ -442,6 +442,8 @@ sub view {
|
|||
# javascript and css files for compare form datatable
|
||||
$self->session->style->setLink($self->session->url->extras('yui/build/datatable/assets/skins/sam/datatable.css'),
|
||||
{type =>'text/css', rel=>'stylesheet'});
|
||||
$self->session->style->setScript($self->session->url->extras('yui/build/yahoo-dom-event/yahoo-dom-event.js'), {type =>
|
||||
'text/javascript'});
|
||||
$self->session->style->setScript($self->session->url->extras('yui/build/json/json-min.js'), {type =>
|
||||
'text/javascript'});
|
||||
$self->session->style->setScript($self->session->url->extras('yui/build/connection/connection-min.js'), {type =>
|
||||
|
|
@ -1024,6 +1026,7 @@ sub www_getCompareListData {
|
|||
unless (scalar(@listingIds)) {
|
||||
@listingIds = $self->session->form->checkList("listingId");
|
||||
}
|
||||
my @responseFields = ("attributeId", "name", "description","fieldType", "checked");
|
||||
|
||||
foreach my $listingId (@listingIds){
|
||||
$listingId =~ s/_____/-/g;
|
||||
|
|
@ -1038,11 +1041,13 @@ sub www_getCompareListData {
|
|||
url =>$listing->getUrl,
|
||||
lastUpdated =>$session->datetime->epochToHuman( $listing->get('revisonDate'),"%z" ),
|
||||
});
|
||||
push(@responseFields, $listingId_safe, $listingId_safe."_compareColor");
|
||||
}
|
||||
push(@results,{name=>$i18n->get('last updated label'),fieldType=>'lastUpdated'});
|
||||
|
||||
my $jsonOutput;
|
||||
$jsonOutput->{ColumnDefs} = \@columnDefs;
|
||||
$jsonOutput->{ColumnDefs} = \@columnDefs;
|
||||
$jsonOutput->{ResponseFields} = \@responseFields;
|
||||
|
||||
foreach my $category (keys %{$self->getCategories}) {
|
||||
push(@results,{name=>$category,fieldType=>'category'});
|
||||
|
|
@ -1144,6 +1149,7 @@ sub www_search {
|
|||
|
||||
my $self = shift;
|
||||
my $var = $self->get;
|
||||
my $db = $self->session->db;
|
||||
|
||||
$var->{compareForm} = $self->getCompareForm;
|
||||
$self->session->style->setScript($self->session->url->extras('yui/build/yahoo/yahoo-min.js'),
|
||||
|
|
@ -1175,7 +1181,7 @@ sub www_search {
|
|||
my $attributes;
|
||||
my @attribute_loop;
|
||||
my $categoryLoopName = $self->session->url->urlize($category)."_loop";
|
||||
$attributes = $self->session->db->read("select * from Matrix_attribute where category =? and assetId = ?",
|
||||
$attributes = $db->read("select * from Matrix_attribute where category =? and assetId = ?",
|
||||
[$category,$self->getId]);
|
||||
while (my $attribute = $attributes->hashRef) {
|
||||
$attribute->{label} = $attribute->{name};
|
||||
|
|
@ -1184,10 +1190,14 @@ sub www_search {
|
|||
$attribute->{extras} = " class='attributeSelect'";
|
||||
if($attribute->{fieldType} eq 'Combo'){
|
||||
$attribute->{fieldType} = 'SelectBox';
|
||||
}
|
||||
if($attribute->{fieldType} eq 'SelectBox'){
|
||||
$attribute->{options} = "blank\n".$attribute->{options};
|
||||
my %options;
|
||||
tie %options, 'Tie::IxHash';
|
||||
%options = $db->buildHash('select value, value from MatrixListing_attribute
|
||||
where attributeId = ? order by value',[$attribute->{attributeId}]);
|
||||
$options{'blank'} = 'blank';
|
||||
$attribute->{options} = \%options;
|
||||
$attribute->{value} = 'blank';
|
||||
$attribute->{extras} = "style='width:120px'";
|
||||
}
|
||||
$attribute->{form} = WebGUI::Form::DynamicField->new($self->session,%{$attribute})->toHtml;
|
||||
push(@attribute_loop,$attribute);
|
||||
|
|
|
|||
|
|
@ -212,6 +212,7 @@ sub purgeRevision {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 view ( )
|
||||
|
||||
method called by the container www_view method.
|
||||
|
|
@ -261,6 +262,7 @@ our @EXPORT = qw(install uninstall);
|
|||
use WebGUI::Session;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
sub install {
|
||||
my $config = $ARGV[0];
|
||||
my $home = $ARGV[1] || "/data/WebGUI";
|
||||
|
|
@ -279,6 +281,7 @@ sub install {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
sub uninstall {
|
||||
my $config = $ARGV[0];
|
||||
my $home = $ARGV[1] || "/data/WebGUI";
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ sub acceptsPrivateMessages {
|
|||
my $userId = shift;
|
||||
|
||||
return 0 if ($self->isVisitor); #Visitor can't get private messages
|
||||
return 0 if ($userId eq "1"); # Visitor can't send private messages
|
||||
return 0 if ($self->userId eq $userId); #Can't send private messages to yourself
|
||||
|
||||
my $pmSetting = $self->profileField('allowPrivateMessages');
|
||||
|
|
|
|||
|
|
@ -161,10 +161,16 @@ our $I18N = { ##hashref of hashes
|
|||
|
||||
'no results' => {
|
||||
message => q|No results were found.|,
|
||||
content => q|An internationalized label for telling the user that no results were found.|,
|
||||
context => q|An internationalized label for telling the user that no results were found.|,
|
||||
lastUpdated => 1170549113,
|
||||
},
|
||||
|
||||
'no_results' => {
|
||||
message => q|An internationalized label for telling the user that no results were found.|,
|
||||
context => q|Template variable in the view method.|,
|
||||
lastUpdated => 1236101532,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ use strict;
|
|||
our $I18N = {
|
||||
|
||||
'assetName' => {
|
||||
message => q|Survey|,
|
||||
lastUpdated => 1224686319
|
||||
message => q|Survey (beta)|,
|
||||
lastUpdated => 1236187015
|
||||
},
|
||||
'edit survey' => {
|
||||
message => q|Edit Survey|,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue