merging back with HEAD
This commit is contained in:
parent
cd30eb437c
commit
f8b11b5423
42 changed files with 1201 additions and 182 deletions
|
|
@ -52,6 +52,7 @@ sub countClick {
|
|||
my $session = shift;
|
||||
my $id = shift;
|
||||
my ($url) = $session->db->quickArray("select url from advertisement where adId=?",[$id]);
|
||||
return $url if $session->env->requestNotViewed();
|
||||
$session->db->write("update advertisement set clicks=clicks+1 where adId=?",[$id]);
|
||||
return $url;
|
||||
}
|
||||
|
|
@ -131,6 +132,7 @@ A boolean that tells the ad system not to count this impression if true.
|
|||
sub displayImpression {
|
||||
my $self = shift;
|
||||
my $dontCount = shift;
|
||||
return '' if $self->session->env->requestNotViewed();
|
||||
my ($id, $ad, $priority, $clicks, $clicksBought, $impressions, $impressionsBought) = $self->session->db->quickArray("select adId, renderedAd, priority, clicks, clicksBought, impressions, impressionsBought from advertisement where adSpaceId=? and isActive=1 order by nextInPriority asc limit 1",[$self->getId]);
|
||||
unless ($dontCount) {
|
||||
my $isActive = 1;
|
||||
|
|
|
|||
|
|
@ -262,10 +262,25 @@ sub set {
|
|||
# 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").' 1px;"><a href="'.$self->session->url->gateway(undef, "op=clickAd;id=".$self->getId).'" 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>';
|
||||
$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="'.$self->session->url->gateway(undef, "op=clickAd;id=".$self->getId).'" 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>';
|
||||
$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") {
|
||||
my $ad = $self->get("richMedia");
|
||||
WebGUI::Macro::process($self->session, \$ad);
|
||||
|
|
|
|||
|
|
@ -215,17 +215,27 @@ A reference to the current session.
|
|||
|
||||
If supplied, provides a list of defaults such as title and icons for the admin console.
|
||||
|
||||
=head3 options
|
||||
|
||||
A hash reference of options with the following keys
|
||||
|
||||
=head4 showAdminBar
|
||||
|
||||
If true, will show the admin bar on this admin console page
|
||||
|
||||
=cut
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $id = shift;
|
||||
my $options = shift;
|
||||
my $self;
|
||||
$self->{_session} = $session;
|
||||
bless $self, $class;
|
||||
$self->{_function} = {};
|
||||
$self->{_functionId} = $id;
|
||||
$self->{_options} = $options;
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
|
@ -289,7 +299,17 @@ sub render {
|
|||
}
|
||||
|
||||
$var{"backtosite.url"} = $self->session->url->getBackToSiteURL();
|
||||
return $self->session->style->process(WebGUI::Asset::Template->new($self->session,$self->session->setting->get("AdminConsoleTemplate"))->process(\%var),"PBtmpl0000000000000137");
|
||||
my $template
|
||||
= WebGUI::Asset::Template->new(
|
||||
$self->session,
|
||||
$self->session->setting->get("AdminConsoleTemplate")
|
||||
);
|
||||
if ( $self->{_options}->{showAdminBar} ) {
|
||||
$var{adminBar}
|
||||
= WebGUI::Macro::AdminBar::process($self->session);
|
||||
}
|
||||
my $output = $template->process(\%var);
|
||||
return $self->session->style->process($output,"PBtmpl0000000000000137");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -317,7 +317,15 @@ sub getEditForm {
|
|||
}
|
||||
}
|
||||
|
||||
$form->submit();
|
||||
$form->raw(
|
||||
'<tr><td COLSPAN=2>'.
|
||||
WebGUI::Form::Button($session, {}).
|
||||
WebGUI::Form::Button($session, {
|
||||
-value => $i18n->get('cancel', 'WebGUI'),
|
||||
-extras => q|onclick="history.go(-1);" class="backwardButton"|
|
||||
}).
|
||||
'</td></tr>'
|
||||
);
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
|
@ -631,53 +639,28 @@ sub view {
|
|||
@files = @{ $storage->getFiles } if (defined $storage);
|
||||
|
||||
$var->{screenshots} = qq|
|
||||
<script language="javascript">AC_FL_RunContent = 0;</script>
|
||||
<script src="/extras/ukplayer/AC_RunActiveContent.js" language="javascript"></script>
|
||||
<script language="javascript">
|
||||
if (AC_FL_RunContent == 0) {
|
||||
alert("This page requires AC_RunActiveContent.js.");
|
||||
} else {
|
||||
AC_FL_RunContent(
|
||||
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
|
||||
'width', '400',
|
||||
'height', '300',
|
||||
'src', 'swc/assets',
|
||||
'quality', 'high',
|
||||
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
|
||||
'align', 'middle',
|
||||
'play', 'true',
|
||||
'loop', 'true',
|
||||
'scale', 'showall',
|
||||
'wmode', 'window',
|
||||
'devicefont', 'false',
|
||||
'id', 'slideShow',
|
||||
'bgcolor', '#ffffff',
|
||||
'name', 'coverflow',
|
||||
'menu', 'true',
|
||||
// note: the width & height in the flashVars below MUST match the width & height set above
|
||||
'flashVars',
|
||||
'config=?func=getScreenshotsConfig&width=400&height=300&backgroundColor=0xCCCCCC&fontColor=&textBorderColor=&textBackgroundColor=&controlsColor=&controlsBorderColor=&controlsBackgroundColor=',
|
||||
'allowFullScreen', 'false',
|
||||
'allowScriptAccess','sameDomain',
|
||||
'movie', '/extras/ukplayer/slideShow',
|
||||
'salign', ''
|
||||
); //end AC code
|
||||
}
|
||||
<script type="text/javascript" src="/extras/ukplayer/swfobject.js"></script>
|
||||
<script type="text/javascript">
|
||||
swfobject.registerObject("myFlashContent","9.0.0","/extras/ukplayer/expressInstall.swf");
|
||||
</script>
|
||||
<noscript>
|
||||
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
|
||||
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="400"
|
||||
height="300" id="swc/assets" align="middle">
|
||||
<param name="allowScriptAccess" value="sameDomain" />
|
||||
<param name="allowFullScreen" value="false" />
|
||||
<param name="flashVars" value="config=?func=getScreenshotsConfig" />
|
||||
<param name="movie" value="/extras/ukplayer/slideShow.swf" /><param name="quality" value="high" /><param
|
||||
name="bgcolor" value="#ffffff" /> <embed src="/extras/ukplayer/slideShow.swf" quality="high" bgcolor="#ffffff"
|
||||
width="400" height="300" name="swc/assets" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false"
|
||||
flashvars="config=?func=getScreenshotsConfig" type="application/x-shockwave-flash"
|
||||
pluginspage="http://www.macromedia.com/go/getflashplayer" />
|
||||
<div>
|
||||
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400" height="300" id="myFlashContent">
|
||||
<param name="movie" value="/extras/ukplayer/slideShow.swf" />
|
||||
<param name="flashvars" value="config=?func=getScreenshotsConfig" />
|
||||
<!--[if !IE]>-->
|
||||
<object type="application/x-shockwave-flash" data="/extras/ukplayer/slideShow.swf" width="400"
|
||||
height="300">
|
||||
<param name="flashvars" value="config=?func=getScreenshotsConfig" />
|
||||
<!--<![endif]-->
|
||||
<a href="http:/www.adobe.com/go/getflashplayer">
|
||||
<img src="http:/www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe
|
||||
Flash player" />
|
||||
</a>
|
||||
<!--[if !IE]>-->
|
||||
</object>
|
||||
<!--<![endif]-->
|
||||
</object>
|
||||
</noscript>
|
||||
</div>
|
||||
|;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -484,9 +484,7 @@ sub deleteAttachedFiles {
|
|||
my $form = $self->_createForm($fieldConfig->{$field}, $entryData->{$field});
|
||||
if ($form->can('getStorageLocation')) {
|
||||
my $storage = $form->getStorageLocation;
|
||||
if ($storage) {
|
||||
$storage->delete;
|
||||
}
|
||||
$storage->delete if $storage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -498,7 +496,7 @@ sub deleteAttachedFiles {
|
|||
my $form = $self->_createForm($fieldConfig->{$field}, $entryData->{$field});
|
||||
if ($form->can('getStorageLocation')) {
|
||||
my $storage = $form->getStorageLocation;
|
||||
$storage->delete;
|
||||
$storage->delete if $storage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -647,7 +647,8 @@ sub prepareView {
|
|||
= WebGUI::Asset::Template->new($self->session, $templateId);
|
||||
$template->prepare($self->getMetaDataAsTemplateVariables);
|
||||
|
||||
$self->{_viewTemplate} = $template;
|
||||
$self->{_viewTemplate} = $template;
|
||||
$self->{_viewVariables} = $self->getTemplateVars;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
@ -776,7 +777,7 @@ to be displayed within the page style.
|
|||
sub view {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $var = $self->getTemplateVars;
|
||||
my $var = delete $self->{_viewVariables};
|
||||
|
||||
my $p = $self->getFilePaginator;
|
||||
$p->appendTemplateVars( $var );
|
||||
|
|
|
|||
|
|
@ -98,70 +98,80 @@ sub definition {
|
|||
maxResponsesPerUser => {
|
||||
fieldType => 'integer',
|
||||
defaultValue => 1,
|
||||
label => 'Max user reponses',
|
||||
label => $i18n->get('Max user responses'),
|
||||
hoverHelp => $i18n->get('Max user responses help'),
|
||||
},
|
||||
overviewTemplateId => {
|
||||
tab => 'display',
|
||||
fieldType => 'template',
|
||||
defaultValue => 'PBtmpl0000000000000063',
|
||||
label => 'Overview template id',
|
||||
namespace => 'Survey/Overview',
|
||||
label => $i18n->get('Survey Overview Template'),
|
||||
hoverHelp => $i18n->get('Survey Overview Template help'),
|
||||
},
|
||||
gradebookTemplateId => {
|
||||
tab => 'display',
|
||||
fieldType => 'template',
|
||||
label => 'Grabebook template id',
|
||||
defaultValue => 'PBtmpl0000000000000062',
|
||||
namespace => 'Survey/Gradebook',
|
||||
label => $i18n->get('Gradebook Template'),
|
||||
hoverHelp => $i18n->get('Gradebook Template help'),
|
||||
},
|
||||
responseTemplateId => {
|
||||
tab => 'display',
|
||||
fieldType => 'template',
|
||||
label => 'Response template id',
|
||||
defaultValue => 'PBtmpl0000000000000064',
|
||||
namespace => 'Survey/Response',
|
||||
label => $i18n->get('Response Template'),
|
||||
hoverHelp => $i18n->get('Response Template help'),
|
||||
},
|
||||
surveyEditTemplateId => {
|
||||
tab => 'display',
|
||||
fieldType => 'template',
|
||||
label => 'Survey edit template id',
|
||||
defaultValue => 'GRUNFctldUgop-qRLuo_DA',
|
||||
namespace => 'Survey/Edit',
|
||||
label => $i18n->get('Edit Survey Template'),
|
||||
hoverHelp => $i18n->get('Edit Survey Template help'),
|
||||
},
|
||||
surveyTakeTemplateId => {
|
||||
tab => 'display',
|
||||
fieldType => 'template',
|
||||
label => 'Take survey template id',
|
||||
defaultValue => 'd8jMMMRddSQ7twP4l1ZSIw',
|
||||
namespace => 'Survey/Take',
|
||||
label => $i18n->get('Take Survey Template'),
|
||||
hoverHelp => $i18n->get('Take Survey Template help'),
|
||||
},
|
||||
surveyQuestionsId => {
|
||||
tab => 'display',
|
||||
fieldType => 'template',
|
||||
label => 'Questions template id',
|
||||
defaultValue => 'CxMpE_UPauZA3p8jdrOABw',
|
||||
namespace => 'Survey/Take',
|
||||
label => $i18n->get('Questions Template'),
|
||||
hoverHelp => $i18n->get('Questions Template help'),
|
||||
},
|
||||
sectionEditTemplateId => {
|
||||
tab => 'display',
|
||||
fieldType => 'template',
|
||||
label => 'Section Edit Tempalte',
|
||||
defaultValue => '1oBRscNIcFOI-pETrCOspA',
|
||||
namespace => 'Survey/Edit',
|
||||
label => $i18n->get('Section Edit Template'),
|
||||
hoverHelp => $i18n->get('Section Edit Template help'),
|
||||
},
|
||||
questionEditTemplateId => {
|
||||
tab => 'display',
|
||||
fieldType => 'template',
|
||||
label => 'Question Edit Tempalte',
|
||||
defaultValue => 'wAc4azJViVTpo-2NYOXWvg',
|
||||
namespace => 'Survey/Edit',
|
||||
label => $i18n->get('Question Edit Template'),
|
||||
hoverHelp => $i18n->get('Question Edit Template help'),
|
||||
},
|
||||
answerEditTemplateId => {
|
||||
tab => 'display',
|
||||
fieldType => 'template',
|
||||
label => 'Answer Edit Tempalte',
|
||||
defaultValue => 'AjhlNO3wZvN5k4i4qioWcg',
|
||||
namespace => 'Survey/Edit',
|
||||
label => $i18n->get('Answer Edit Template'),
|
||||
hoverHelp => $i18n->get('Answer Edit Template help'),
|
||||
},
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -785,7 +785,7 @@ sub updateQuestionAnswers {
|
|||
}
|
||||
elsif ( $type eq 'Party' ) {
|
||||
my @ans
|
||||
= ( 'Democratic party', 'Republican party (or GOP)', 'Independant party', 'Other party (verbatim)' );
|
||||
= ( 'Democratic party', 'Republican party (or GOP)', 'Independent party', 'Other party (verbatim)' );
|
||||
$self->addAnswersToQuestion( \@addy, \@ans, { 3, 1 } );
|
||||
}
|
||||
elsif ( $type eq 'Race' ) {
|
||||
|
|
|
|||
|
|
@ -323,7 +323,9 @@ JavaScript that will take over if the browser has the cojones.
|
|||
|
||||
sub www_manage {
|
||||
my ( $session ) = @_;
|
||||
my $ac = WebGUI::AdminConsole->new( $session, "assets" );
|
||||
my $ac = WebGUI::AdminConsole->new( $session, "assets", {
|
||||
showAdminBar => 1
|
||||
} );
|
||||
my $currentAsset = getCurrentAsset( $session );
|
||||
my $i18n = WebGUI::International->new( $session, "Asset" );
|
||||
|
||||
|
|
@ -413,7 +415,7 @@ sub www_manage {
|
|||
YAHOO.util.Event.onDOMReady( WebGUI.AssetManager.initManager );
|
||||
</script>
|
||||
ENDHTML
|
||||
my $output = WebGUI::Macro::AdminBar::process($session).'<div class="yui-skin-sam" id="assetManager">' . getHeader( $session );
|
||||
my $output = '<div class="yui-skin-sam" id="assetManager">' . getHeader( $session );
|
||||
|
||||
### Crumbtrail
|
||||
my $crumb_markup = '<li><a href="%s">%s</a> ></li>';
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ sub fieldSetEnd {
|
|||
my $legend = shift;
|
||||
$self->{_data} .= "</tbody></table>\n"
|
||||
."</fieldset>\n"
|
||||
."<table ".$self->{_tableExtras}.'" style="width: 100%;"><tbody>'
|
||||
."<table ".$self->{_tableExtras}.' style="width: 100%;"><tbody>'
|
||||
."\n";
|
||||
}
|
||||
|
||||
|
|
@ -208,7 +208,7 @@ sub fieldSetStart {
|
|||
my $legend = shift;
|
||||
$self->{_data} .= "</tbody></table>\n"
|
||||
."<fieldset>\n<legend>".$legend."</legend>\n"
|
||||
."<table ".$self->{_tableExtras}.'" style="width: 100%;"><tbody>'
|
||||
."<table ".$self->{_tableExtras}.' style="width: 100%;"><tbody>'
|
||||
."\n";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,58 @@ our $HELP = {
|
|||
related => [ ],
|
||||
},
|
||||
|
||||
'view inbox' => {
|
||||
title => 'view inbox template',
|
||||
body => '',
|
||||
isa => [
|
||||
{
|
||||
tag => 'common vars',
|
||||
namespace => 'Account_Inbox',
|
||||
},
|
||||
{
|
||||
tag => 'pagination template variables',
|
||||
namespace => 'WebGUI',
|
||||
},
|
||||
],
|
||||
fields => [ ],
|
||||
variables => [
|
||||
{ name => 'subject_url', },
|
||||
{ name => 'status_url', },
|
||||
{ name => 'from_url', },
|
||||
{ name => 'dateStamp_url', },
|
||||
{ name => 'rpp_url', },
|
||||
{ name => 'has_messages', },
|
||||
{ name => 'message_total', },
|
||||
{ name => 'new_message_url', },
|
||||
{ name => 'canSendMessages', },
|
||||
{ name => 'message_rpp', },
|
||||
{ name => 'form_header',
|
||||
required => 1, },
|
||||
{ name => 'form_footer',
|
||||
required => 1, },
|
||||
{
|
||||
name => 'message_loop',
|
||||
variables => [
|
||||
{ name => 'message_id', },
|
||||
{ name => 'message_url', },
|
||||
{ name => 'subject', },
|
||||
{ name => 'status', },
|
||||
{ name => 'status_class', },
|
||||
{ name => 'isRead', },
|
||||
{ name => 'isReplied', },
|
||||
{ name => 'isPending', },
|
||||
{ name => 'isCompleted', },
|
||||
{ name => 'from_id', },
|
||||
{ name => 'from_url', },
|
||||
{ name => 'from', },
|
||||
{ name => 'dateStamp', },
|
||||
{ name => 'dateStamp_formatted', },
|
||||
{ name => 'inbox_form_delete', },
|
||||
],
|
||||
},
|
||||
],
|
||||
related => [ ],
|
||||
},
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -161,26 +161,38 @@ sub _processMacro {
|
|||
$parameters =~ s/^\(//;
|
||||
$parameters =~ s/\)$//;
|
||||
|
||||
# there are two possible matches and only one will ever match at a time, so we filter out the undef ones
|
||||
my @params = grep { defined $_ } ($parameters =~ /
|
||||
my @params;
|
||||
while ($parameters =~ /
|
||||
(?<!\z) # don't try to match if we are at the end of the string
|
||||
(?: # either
|
||||
\s* " # white space followed by quotes
|
||||
\s* " # white space followed by a double quote
|
||||
( (?: # capture inside
|
||||
[^"\\] # something other than a quote or backslash
|
||||
[^"\\] # something other than backslash or double quote
|
||||
| # or
|
||||
\\. # a backslash followed by any character
|
||||
) * ) # as many times as needed
|
||||
" \s* # end quote and any white space
|
||||
" \s* # end quote and any white space
|
||||
| # or
|
||||
([^,]*) # anything but a comma
|
||||
\s* ' # same as above, but with single quotes
|
||||
( (?:
|
||||
[^'\\]
|
||||
|
|
||||
\\.
|
||||
) * )
|
||||
' \s*
|
||||
| # or
|
||||
([^,]*) # anything but a comma
|
||||
)
|
||||
(?: # followed by
|
||||
\z # end of the string
|
||||
| # or
|
||||
, # a comma
|
||||
)
|
||||
/xg);
|
||||
/xg) {
|
||||
# three matches, only one will exist per run
|
||||
push @params, defined $1 ? $1 : defined $2 ? $2 : $3;
|
||||
}
|
||||
|
||||
for my $param (@params) {
|
||||
$param =~ s/\\(.)/$1/xmsg; # deal with backslash escapes
|
||||
process($session, \$param)
|
||||
|
|
|
|||
|
|
@ -504,6 +504,10 @@ sub getPageLinks {
|
|||
my $start = ($minPage > 0) ? $minPage : 1;
|
||||
my $maxPage = $start + $limit - 1;
|
||||
my $end = ($maxPage < $self->getPageNumber) ? $self->getPageNumber : $maxPage;
|
||||
if ($maxPage > $self->getNumberOfPages) {
|
||||
$end = $self->getNumberOfPages;
|
||||
$start = $self->getNumberOfPages - $limit + 1;
|
||||
}
|
||||
my @temp;
|
||||
foreach my $page (@pages) {
|
||||
if ($i <= $end && $i >= $start) {
|
||||
|
|
@ -754,5 +758,24 @@ sub setAlphabeticalKey {
|
|||
return 1;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setPageNumber ( pageNumber )
|
||||
|
||||
Sets the page number. This is really a convenience method for testing.
|
||||
Returns the page number that was set.
|
||||
|
||||
=head3 pageNumber
|
||||
|
||||
Sets the pageNumber. Setting the pageNumber outside of the set of
|
||||
pages would cause the Paginator to behave poorly.
|
||||
|
||||
=cut
|
||||
|
||||
sub setPageNumber {
|
||||
my $self = shift;
|
||||
$self->{_pn} = shift;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ $env = WebGUI::Session::Env->new;
|
|||
|
||||
$value = $env->get('REMOTE_ADDR');
|
||||
|
||||
return 'not gonna see it' if $env->requestNotViewed() ;
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
These methods are available from this package:
|
||||
|
|
@ -37,6 +39,66 @@ These methods are available from this package:
|
|||
=cut
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 callerIsSearchSite ( )
|
||||
|
||||
returns true if the remote address matches a site which is a known indexer or spider.
|
||||
|
||||
=cut
|
||||
|
||||
sub callerIsSearchSite {
|
||||
|
||||
my $self = shift;
|
||||
my $remoteAddress = $self->getIp;
|
||||
|
||||
return 1 if $remoteAddress =~ /203\.87\.123\.1../ # Blaiz Enterprise Rawgrunt search
|
||||
|| $remoteAddress =~ /123\.113\.184\.2../ # Unknown Yahoo Robot
|
||||
|| $remoteAddress == '';
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 clientIsSpider ( )
|
||||
|
||||
returns true is the client/agent is a spider/indexer or some other non-human interface
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
sub clientIsSpider {
|
||||
|
||||
my $self = shift;
|
||||
my $userAgent = $self->get('HTTP_USER_AGENT');
|
||||
|
||||
return 1 if $userAgent eq ''
|
||||
|| $userAgent =~ m<(^wre\/| # the WRE wget's http://localhost/ every 2-3 minutes 24 hours a day...
|
||||
^morpheus|
|
||||
libwww|
|
||||
s[pb]ider|
|
||||
bot|
|
||||
robo|
|
||||
sco[ou]t|
|
||||
crawl|
|
||||
miner|
|
||||
reaper|
|
||||
finder|
|
||||
search|
|
||||
engine|
|
||||
download|
|
||||
fetch|
|
||||
scan|
|
||||
slurp)>ix;
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 DESTROY ( )
|
||||
|
|
@ -100,5 +162,22 @@ sub new {
|
|||
bless {_env=>\%ENV}, $class;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 requestNotViewed ( )
|
||||
|
||||
returns true is the client/agent is a spider/indexer or some other non-human interface
|
||||
|
||||
=cut
|
||||
|
||||
sub requestNotViewed {
|
||||
|
||||
my $self = shift;
|
||||
return $self->clientIsSpider()
|
||||
|| $self->callerIsSearchSite();
|
||||
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ sub www_addPaymentGateway {
|
|||
my $className = $session->form->process('className')
|
||||
|| WebGUI::Error::InvalidParam->throw(error => 'No class name passed');
|
||||
|
||||
my $payDriver = $self->addPaymentGateway( $className, $className->getName( $session ), { enabled => 0 } );
|
||||
my $payDriver = $self->addPaymentGateway( $className, { enabled => 0, label => $className->getName($session), } );
|
||||
return $payDriver->www_edit;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ our $I18N = {
|
|||
message => q|Edit Layout Template|,
|
||||
lastUpdated => 1119068809
|
||||
},
|
||||
|
||||
|
||||
'inbox layout template hoverHelp' => {
|
||||
message => q{Choose a layout from the list to display the various account pluggins that are editable by the current user as well as the contents of the one currently chosen},
|
||||
lastUpdated => 1119068809
|
||||
|
|
@ -194,7 +194,7 @@ our $I18N = {
|
|||
message => q|Subject|,
|
||||
lastUpdated => 1119068809
|
||||
},
|
||||
|
||||
|
||||
'status label' => {
|
||||
message => q{Status},
|
||||
lastUpdated => 1119068809
|
||||
|
|
@ -214,7 +214,7 @@ our $I18N = {
|
|||
message => q{Add Recipients},
|
||||
lastUpdated => 1119068809
|
||||
},
|
||||
|
||||
|
||||
'from label' => {
|
||||
message => q{From},
|
||||
lastUpdated => 1119068809
|
||||
|
|
@ -224,7 +224,7 @@ our $I18N = {
|
|||
message => q{To},
|
||||
lastUpdated => 1119068809
|
||||
},
|
||||
|
||||
|
||||
'member since' => {
|
||||
message => q{Member Since },
|
||||
lastUpdated => 1119068809
|
||||
|
|
@ -234,7 +234,7 @@ our $I18N = {
|
|||
message => q{Delete},
|
||||
lastUpdated => 1119068809
|
||||
},
|
||||
|
||||
|
||||
'view my profile' => {
|
||||
message => q{view my profile as others see it},
|
||||
lastUpdated => 1119068809
|
||||
|
|
@ -546,6 +546,181 @@ our $I18N = {
|
|||
lastUpdated => 0,
|
||||
context => "Description of Inbox setting",
|
||||
},
|
||||
|
||||
'subject_url' => {
|
||||
message => q{The URL to sort the inbox by subject.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'status_url' => {
|
||||
message => q{The URL to sort the inbox by status.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'from_url' => {
|
||||
message => q{The URL to sort the inbox by who sent the messages.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'dateStamp_url' => {
|
||||
message => q{The URL to sort the inbox by when the message was sent.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'rpp_url' => {
|
||||
message => q{The current URL with sort, sort direction and user filtering params added.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'has_messages' => {
|
||||
message => q{A boolean which is true if the user has messages.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'message_total' => {
|
||||
message => q{The total number of messages the user has in their inbox.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'new_message_url' => {
|
||||
message => q{The URL to take the user to the screen where they can send new messages to other users.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'canSendMessages' => {
|
||||
message => q{A boolean which is true if the user has friends that he can send messages to.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'message_loop' => {
|
||||
message => q{A loop containing all messages, as determined by the sorting and number of messages per page options.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'view inbox template' => {
|
||||
message => q{View Inbox Template},
|
||||
lastUpdated => 1235421123,
|
||||
context => "The template that allows you to view the contents of the Inbox",
|
||||
},
|
||||
|
||||
'message_rpp' => {
|
||||
message => q{A select box that allows the user to change the number of messages displayed per page},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'form_header' => {
|
||||
message => q{HTML elements to begin the form on this page},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'form_footer' => {
|
||||
message => q{HTML elements to end the form on this page},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'message_id' => {
|
||||
message => q{The unique identifier for this message.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'message_url' => {
|
||||
message => q{The URL to view the contents of this message.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'subject' => {
|
||||
message => q{The subject of this message.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'status' => {
|
||||
message => q{The status of this message, internationalized.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'status_class' => {
|
||||
message => q{The status of this message, raw.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'isRead' => {
|
||||
message => q{A boolean which will be true if this message has been read.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'isReplied' => {
|
||||
message => q{A boolean which will be true if this message has been replied to.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'isPending' => {
|
||||
message => q{A boolean which will be true if this message represents an action by the user that is pending.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'isCompleted' => {
|
||||
message => q{A boolean which will be true if this message represents an action by the user that has been completed.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'from_id' => {
|
||||
message => q{The userId of the person who sent this message.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'from_url' => {
|
||||
message => q{The URL to view the profile of the user who sent this message.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'from' => {
|
||||
message => q{The name of the person who sent this message.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'dateStamp' => {
|
||||
message => q{The date the message was sent, as an epoch.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'dateStamp_formatted' => {
|
||||
message => q{The date the message was sent, using the user's preferred date and time format.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
'inbox_form_delete' => {
|
||||
message => q{A little checkbox for the user to check if they want to delete this message.},
|
||||
lastUpdated => 1235421123,
|
||||
context => "template variable for view inbox template",
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -418,8 +418,8 @@ listing,|,
|
|||
},
|
||||
|
||||
'max comparisons privileged description' => {
|
||||
message => q|Specifies how many comparisons are allowed in searches and comparisons for users in the privileged group.|,
|
||||
lastUpdated => 0,
|
||||
message => q|Specifies how many comparisons are allowed in searches and comparisons for users who have accounts on the site.|,
|
||||
lastUpdated => 1235681965,
|
||||
},
|
||||
|
||||
'rating timeout description' => {
|
||||
|
|
@ -548,8 +548,8 @@ listing,|,
|
|||
},
|
||||
|
||||
'max comparisons privileged label' => {
|
||||
message => q|Maximum Comparisons (For Privileged Users)|,
|
||||
lastUpdated => 0,
|
||||
message => q|Maximum Comparisons (For Registered Users)|,
|
||||
lastUpdated => 1235681967,
|
||||
},
|
||||
|
||||
'rating timeout' => {
|
||||
|
|
|
|||
|
|
@ -161,14 +161,10 @@ 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.|,
|
||||
lastUpdated => 1170549113,
|
||||
},
|
||||
|
||||
'no_results' => {
|
||||
message => q|An internationalized label for telling the user that no results were found.|,
|
||||
lastUpdated => 1170549119,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -490,6 +490,116 @@ our $I18N = {
|
|||
lastUpdated => 1233714385,
|
||||
},
|
||||
|
||||
'Max user responses' => {
|
||||
message => q|Max user responses|,
|
||||
context => q|The maximum number of times a user may take this survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Max user responses help' => {
|
||||
message => q|The maximum number of times a user may take this survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Survey Overview Template' => {
|
||||
message => q|Survey Overview Template|,
|
||||
context => q|The template that provides an overview of the survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Survey Overview Template help' => {
|
||||
message => q|The template that provides an overview of the survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Gradebook Template' => {
|
||||
message => q|Gradebook Template|,
|
||||
context => q|The template for displaying the gradebook.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Gradebook Template help' => {
|
||||
message => q|The template for displaying the gradebook.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Response Template' => {
|
||||
message => q|Response Template|,
|
||||
context => q|The template for displaying responses to the survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Response Template help' => {
|
||||
message => q|The template for displaying responses to the survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Edit Survey Template' => {
|
||||
message => q|Edit Survey Template|,
|
||||
context => q|The template for displaying the screen for editing the survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Edit Survey Template help' => {
|
||||
message => q|The template for displaying the screen for editing the survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Take Survey Template' => {
|
||||
message => q|Take Survey Template|,
|
||||
context => q|The template for displaying the screen where a user takes the survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Take Survey Template help' => {
|
||||
message => q|The template for displaying the screen where a user takes the survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Questions Template' => {
|
||||
message => q|Questions Template|,
|
||||
context => q|The template for rendering questions in the survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Questions Template help' => {
|
||||
message => q|The template for rendering questions in the survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Section Edit Template' => {
|
||||
message => q|Section Edit Template|,
|
||||
context => q|The template for adding or editing sections.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Section Edit Template help' => {
|
||||
message => q|The template for adding or editing sections.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Question Edit Template' => {
|
||||
message => q|Question Edit Template|,
|
||||
context => q|The template for adding or editing questions.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Question Edit Template help' => {
|
||||
message => q|The template for adding or editing questions.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Answer Edit Template' => {
|
||||
message => q|Answer Edit Template|,
|
||||
context => q|The template for adding or editing answers.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Answer Edit Template help' => {
|
||||
message => q|The template for adding or editing answers.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'percentage label' => {
|
||||
message => q|Percentage|,
|
||||
context => q|Label for the Percentage column on the gradebook screen.|,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue