a ton of $session fixes (thanks to Colin), and a new $session checker, that supposedly, shouldn't be needed now. It can be backed out, however, easily.

This commit is contained in:
Matthew Wilson 2006-01-16 22:45:21 +00:00
parent 5fadc70eac
commit 09483e18c5
208 changed files with 505 additions and 533 deletions

View file

@ -218,6 +218,26 @@ sub upgrading {
}
sub dumpSession {
my $session = shift;
if ($session) {
if (ref $session eq 'WebGUI::Session') {
return;
} else {
use Data::Dumper; print '<html><body><pre>$session is '.Dumper($session).' (not a WebGUI::Session!) at ';
}
} else {
print '<html><body><pre>$session is empty at ';
}
my $i = 1;
my $output;
while (my @data = caller($i)) {
print "\t".join(",",@data)."\n";
$i++;
}
print '</pre></body></html>';
exit;
}
1;

View file

@ -368,7 +368,7 @@ If supplied, updates the _function of the AdminFunction.
sub new {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $id = shift;
my %self;
$self{_function} = $class->getAdminFunction($id) if ($id);

View file

@ -49,7 +49,7 @@ A reference to the current session.
=cut
sub grabReferral {
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
if ($session->user->userId ne "1" && $session->user->referringAffiliate) {
return "";
} elsif ($session->user->userId ne "1" && (($session->user->referringAffiliate eq "0" && $session->scratch->process("referringAffiliate")) || $session->form->process("affiliateId"))) {

View file

@ -76,7 +76,7 @@ Only developers extending this method should use this parameter. By default WebG
sub canAdd {
my $className = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $userId = shift || $session->user->userId;
my $subclassGroupId = shift;
my $groupId = $session->config->get("assetAddPrivilege")->{$className} || $subclassGroupId || '12';
@ -150,7 +150,7 @@ An array reference containing additional information to include with the default
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session, "Asset");
push(@{$definition}, {
@ -466,7 +466,7 @@ A reference to the current session.
sub getDefault {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
return $class->newByDynamicClass($session, $session->setting->get("defaultPage"));
}
@ -733,7 +733,7 @@ A reference to the current session.
sub getImportNode {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
return WebGUI::Asset->newByDynamicClass($session, "PBasset000000000000002");
}
@ -797,7 +797,7 @@ A reference to the current session.
sub getNotFound {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
if ($session->url->getRequestedUrl eq "*give-credit-where-credit-is-due*") {
my $content = "";
open(FILE,"<".$session->config->getWebguiRoot."/docs/credits.txt");
@ -834,7 +834,7 @@ A reference to the current session.
sub getRoot {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
return WebGUI::Asset->new($session, "PBasset000000000000001");
}
@ -1008,7 +1008,7 @@ An epoch date that represents a specific version of an asset. By default the mos
sub new {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $assetId = shift;
return undef unless ($assetId);
my $className = shift;
@ -1077,7 +1077,7 @@ A specific revision date for the asset to retrieve. If not specified, the most r
sub newByDynamicClass {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $assetId = shift;
my $revisionDate = shift;
return undef unless defined $assetId;
@ -1111,7 +1111,7 @@ A properties hash reference. The className of the properties hash must be valid.
sub newByPropertyHashRef {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $properties = shift;
return undef unless defined $properties;
return undef unless exists $properties->{className};
@ -1144,7 +1144,7 @@ A specific revision to instanciate. By default we instanciate the newest publish
sub newByUrl {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $url = shift || $session->url->getRequestedUrl;
my $revisionDate = shift;
$url = lc($url);

View file

@ -25,7 +25,7 @@ our @ISA = qw(WebGUI::Asset);
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_Event");
push(@{$definition}, {

View file

@ -75,7 +75,7 @@ A hash reference passed in from a subclass definition.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_File");
push(@{$definition}, {

View file

@ -60,7 +60,7 @@ A hash reference passed in from a subclass definition.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_Image");
push(@{$definition}, {

View file

@ -103,7 +103,7 @@ A hash reference passed in from a subclass definition.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_ZipArchive");
push(@{$definition}, {

View file

@ -53,7 +53,7 @@ sub addRevision {
#-------------------------------------------------------------------
sub canAdd {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
$class->SUPER::canAdd($session, undef, '7');
}
@ -103,7 +103,7 @@ sub chopTitle {
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_Post");
push(@{$definition}, {

View file

@ -67,7 +67,7 @@ sub decrementReplies {
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_Thread");
push(@{$definition}, {

View file

@ -56,7 +56,7 @@ A hash reference passed in from a subclass definition.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_Redirect");
push(@{$definition}, {

View file

@ -58,7 +58,7 @@ A hash reference passed in from a subclass definition.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,'Asset_RichEdit');
push(@{$definition}, {

View file

@ -155,7 +155,7 @@ sub canManage {
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_Shortcut");
push(@{$definition}, {

View file

@ -57,7 +57,7 @@ A hash reference passed in from a subclass definition.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_Snippet");
push(@{$definition}, {

View file

@ -43,19 +43,9 @@ These methods are available from this class:
=cut
#-------------------------------------------------------------------
sub _getTemplateFile {
my $templateId = shift;
my $filename = $templateId.".tmpl";
$filename =~ s/\//-/g;
$filename =~ s/ /-/g;
return WebGUI::Attachment->new($filename,"temp","templates");
}
#-------------------------------------------------------------------
sub _execute {
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $params = shift;
my $vars = shift;
my $t;
@ -97,7 +87,7 @@ A hash reference passed in from a subclass definition.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session, 'Asset_Template');
push(@{$definition}, {
@ -201,7 +191,7 @@ Specify the namespace to build the list for.
sub getList {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $namespace = shift;
my $sql = "select asset.assetId, assetData.revisionDate from template left join asset on asset.assetId=template.assetId left join assetData on assetData.revisionDate=template.revisionDate and assetData.assetId=template.assetId where template.namespace=".$session->db->quote($namespace)." and template.showInForms=1 and asset.state='published' and assetData.revisionDate=(SELECT max(revisionDate) from assetData where assetData.assetId=asset.assetId and (assetData.status='approved' or assetData.tagId=".$session->db->quote($session->scratch->get("versionTag")).")) order by assetData.title";
my $sth = $session->dbSlave->read($sql);
@ -232,57 +222,9 @@ sub process {
my $self = shift;
my $vars = shift;
return $self->processRaw($self->session, $self->get("template"),$vars);
# skip all the junk below here for now until we have time to bring it inline with the new system
my $file = _getTemplateFile($self->get("templateId"));
my $fileCacheDir = $self->session->config->get("uploadsPath").'/temp/templatecache';
my %params = (
filename=>$file->getPath,
global_vars=>1,
loop_context_vars=>1,
die_on_bad_params=>0,
no_includes=>1,
file_cache_dir=>$fileCacheDir,
strict=>0
);
my $error=0;
if ($self->session->config->get("templateCacheType") =~ /file/) {
eval { mkpath($fileCacheDir) };
if($@) {
$self->session->errorHandler->error("Could not create dir $fileCacheDir: $@\nTemplate file caching disabled");
$error++;
}
if(not -w $fileCacheDir) {
$self->session->errorHandler->error("Directory $fileCacheDir is not writable. Template file caching is disabled");
$error++;
}
}
if ($self->session->config->get("templateCacheType") eq "file" && not $error) {
# disabled until we can figure out what's wrong with it
# $params{file_cache} = 1;
} elsif ($self->session->config->get("templateCacheType") eq "memory") {
$params{cache} = 1;
} elsif ($self->session->config->get("templateCacheType") eq "ipc") {
$params{shared_cache} = 1;
} elsif ($self->session->config->get("templateCacheType") eq "memory-ipc") {
$params{double_cache} = 1;
} elsif ($self->session->config->get("templateCacheType") eq "memory-file" && not $error) {
$params{double_file_cache} = 1;
}
my $template;
unless (-e $file->getPath) {
$file->saveFromScalar($self->get("template"));
unless (-e $file->getPath) {
$self->session->errorHandler->error("Could not create file ".$file->getPath."\nTemplate file caching is disabled");
$params{scalarref} = \$template;
delete $params{filename};
}
}
return _execute($self->session, \%params,$vars);
}
#-------------------------------------------------------------------
=head2 processRaw ( template, vars )
@ -307,7 +249,7 @@ A hash reference containing template variables and loops. Automatically includes
sub processRaw {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $template = shift;
my $vars = shift;
return _execute($session, {

View file

@ -60,7 +60,7 @@ An array of hashes to prepend to the list
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,'Wobject');
my %properties;

View file

@ -67,7 +67,7 @@ text will come out formatted as paragraphs.
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,'Asset_Article');
my %properties;

View file

@ -32,7 +32,7 @@ sub appendPostListTemplateVars {
my $page = $p->getPageData;
my $i = 0;
foreach my $row (@$page) {
my $post = WebGUI::Asset->new($row->{assetId}, $row->{className}, $row->{revisionDate});
my $post = WebGUI::Asset->new($self->session,$row->{assetId}, $row->{className}, $row->{revisionDate});
$post->{_parent} = $self; # caching parent for efficiency
my $controls = $self->session->icon->delete('func=delete',$post->get("url"),"Delete").$self->session->icon->edit('func=edit',$post->get("url"));
if ($self->get("sortBy") eq "lineage") {
@ -253,7 +253,7 @@ sub decrementThreads {
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_Collaboration");
push(@{$definition}, {

View file

@ -38,7 +38,7 @@ sub canPersonalize {
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my %properties;
tie %properties, 'Tie::IxHash';

View file

@ -130,7 +130,7 @@ sub defaultViewForm {
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_DataForm");
push(@{$definition}, {

View file

@ -35,7 +35,7 @@ our @ISA = qw(WebGUI::Asset::Wobject);
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_EventsCalendar");
push(@{$definition}, {

View file

@ -55,7 +55,7 @@ A hash reference passed in from a subclass definition.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_Folder");
push(@{$definition}, {

View file

@ -28,7 +28,7 @@ our @ISA = qw(WebGUI::Asset::Wobject);
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_HttpProxy");
push(@{$definition}, {

View file

@ -59,7 +59,7 @@ sub _fetchDepartments {
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_InOutBoard");
push(@{$definition}, {

View file

@ -19,7 +19,7 @@ our @ISA = qw(WebGUI::Asset::Wobject);
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_IndexedSearch");
push (@{$definition}, {

View file

@ -55,7 +55,7 @@ A hash reference passed in from a subclass definition.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_Layout");
push(@{$definition}, {

View file

@ -17,7 +17,7 @@ our @ISA = qw(WebGUI::Asset::Wobject);
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_Matrix");
push(@{$definition}, {

View file

@ -22,7 +22,7 @@ our @ISA = qw(WebGUI::Asset::Wobject);
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_MessageBoard");
my %properties;

View file

@ -39,7 +39,7 @@ defines wobject properties for MultiSearch instances
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session, "Asset_MultiSearch");
my $properties = {

View file

@ -25,7 +25,7 @@ our @ISA = qw(WebGUI::Asset::Wobject);
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_Navigation");
push(@{$definition}, {

View file

@ -33,7 +33,7 @@ sub _hasVoted {
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_Poll");
push(@{$definition}, {

View file

@ -92,7 +92,7 @@ sub addRevision {
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_Product");
push(@{$definition}, {
@ -813,7 +813,7 @@ sub view {
$segment = $self->session->icon->delete('func=deleteAccessoryConfirm&aid='.$id,$self->get("url"),$i18n->get(2))
.$self->session->icon->moveUp('func=moveAccessoryUp&aid='.$id,$self->get("url"))
.$self->session->icon->moveDown('func=moveAccessoryDown&aid='.$id,$self->get("url"));
my $accessory = WebGUI::Asset->newByDynamicClass($id);
my $accessory = WebGUI::Asset->newByDynamicClass($self->session,$id);
push(@accessoryloop,{
"accessory.URL"=>$accessory->getUrl,
"accessory.title"=>$accessory->getTitle,
@ -834,7 +834,7 @@ sub view {
$segment = $self->session->icon->delete('func=deleteRelatedConfirm&rid='.$id,$self->get("url"),$i18n->get(4))
.$self->session->icon->moveUp('func=moveRelatedUp&rid='.$id,$self->get("url"))
.$self->session->icon->moveDown('func=moveRelatedDown&rid='.$id,$self->get("url"));
my $related = WebGUI::Asset->newByDynamicClass($id);
my $related = WebGUI::Asset->newByDynamicClass($self->session,$id);
push(@relatedloop,{
"relatedproduct.URL"=>$related->getUrl,
"relatedproduct.title"=>$related->getTitle,

View file

@ -26,7 +26,7 @@ our @ISA = qw(WebGUI::Asset::Wobject);
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,"Asset_SQLReport");
push(@{$definition}, {

View file

@ -269,7 +269,7 @@ defines wobject properties for Stock Data instances
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $properties = {
templateId =>{

View file

@ -55,7 +55,7 @@ sub completeResponse {
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session,'Asset_Survey');
push(@{$definition}, {

View file

@ -63,7 +63,7 @@ A hash reference passed in from a subclass definition.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my %properties;
tie %properties, 'Tie::IxHash';

View file

@ -31,7 +31,7 @@ sub _create_cache_key {
#-------------------------------------------------------------------
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $httpHeaderFieldType;
if ($session->config->get('soapHttpHeaderOverride')) {

View file

@ -41,7 +41,7 @@ defines wobject properties for WeatherData instances
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift;
my $i18n = WebGUI::International->new($session, "Asset_WeatherData");
my $properties = {

View file

@ -98,7 +98,7 @@ sub www_editBranch {
my $ac = WebGUI::AdminConsole->new($self->session,"assets");
my $i18n = WebGUI::International->new($self->session,"Asset");
return $self->session->privilege->insufficient() unless ($self->canEdit);
my $tabform = WebGUI::TabForm->new;
my $tabform = WebGUI::TabForm->new($self->session);
$tabform->hidden({name=>"func",value=>"editBranchSave"});
$tabform->addTab("properties",$i18n->get("properties"),9);
$tabform->getTab("properties")->readOnly(
@ -214,7 +214,7 @@ sub www_editBranch {
}
my $clause;
if ($self->session->user->isInGroup(3)) {
my $contentManagers = WebGUI::Group->new(4)->getUsers(1);
my $contentManagers = WebGUI::Group->new($self->session,4)->getUsers(1);
push (@$contentManagers, $self->session->user->userId);
$clause = "userId in (".$self->session->db->quoteAndJoin($contentManagers).")";
} else {

View file

@ -59,7 +59,7 @@ sub addChild {
$self->session->db->beginTransaction;
my $now =$self->session->datetime->time();
$self->session->db->write("insert into asset (assetId, parentId, lineage, creationDate, createdBy, className, state) values (".$self->session->db->quote($id).",".$self->session->db->quote($self->getId).", ".$self->session->db->quote($lineage).", ".$now.", ".$self->session->db->quote($self->session->user->userId).", ".$self->session->db->quote($properties->{className}).", 'published')");
my $temp = WebGUI::Asset->newByPropertyHashRef({
my $temp = WebGUI::Asset->newByPropertyHashRef($self->session,{
assetId=>$id,
className=>$properties->{className}
});
@ -93,7 +93,7 @@ sub cascadeLineage {
my $now =$self->session->datetime->time();
my $prepared = $self->session->db->prepare("update asset set lineage=? where assetId=?");
my $descendants = $self->session->db->read("select assetId,lineage from asset where lineage like ".$self->session->db->quote($oldLineage.'%'));
my $cache = WebGUI::Cache->new;
my $cache = WebGUI::Cache->new($self->session);
while (my ($assetId, $lineage) = $descendants->array) {
my $fixedLineage = $newLineage.substr($lineage,length($oldLineage));
$prepared->execute([$fixedLineage,$assetId]);
@ -162,7 +162,7 @@ sub getFirstChild {
$self->session->stow->set("assetLineage", $assetLineage);
}
}
$self->{_firstChild} = WebGUI::Asset->newByLineage($lineage);
$self->{_firstChild} = WebGUI::Asset->newByLineage($self->session,$lineage);
}
return $self->{_firstChild};
}
@ -186,7 +186,7 @@ sub getLastChild {
$assetLineage->{lastChild}{$self->getId} = $lineage;
$self->session->stow->set("assetLineage", $assetLineage);
}
$self->{_lastChild} = WebGUI::Asset->newByLineage($lineage);
$self->{_lastChild} = WebGUI::Asset->newByLineage($self->session,$lineage);
}
return $self->{_lastChild};
}
@ -429,7 +429,7 @@ Returns an asset hash of the parent of current Asset.
sub getParent {
my $self = shift;
return $self if ($self->getId eq "PBasset000000000000001");
$self->{_parent} = WebGUI::Asset->newByDynamicClass($self->get("parentId")) unless (exists $self->{_parent});
$self->{_parent} = WebGUI::Asset->newByDynamicClass($self->session,$self->get("parentId")) unless (exists $self->{_parent});
return $self->{_parent};
}
@ -515,7 +515,7 @@ Lineage string.
sub newByLineage {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $lineage = shift;
my $assetLineage = $session->stow->get("assetLineage");
my $id = $assetLineage->{$lineage}{id};

View file

@ -79,7 +79,7 @@ sub getAssetsInTrash {
assetData.title desc
");
while (my ($id, $date, $class) = $sth->array) {
push(@assets, WebGUI::Asset->new($id,$class,$date));
push(@assets, WebGUI::Asset->new($self->session,$id,$class,$date));
}
$sth->finish;
return \@assets;
@ -105,7 +105,7 @@ sub purge {
$self->session->db->write("delete from asset where assetId=".$self->session->db->quote($self->getId));
$self->session->db->commit;
$self->purgeCache;
WebGUI::Cache->new->deleteChunk(["asset",$self->getId]);
WebGUI::Cache->new($self->session)->deleteChunk(["asset",$self->getId]);
$self->updateHistory("purged");
$self = undef;
}
@ -161,7 +161,7 @@ sub www_deleteList {
my $self = shift;
return $self->session->privilege->insufficient() unless $self->canEdit;
foreach my $assetId ($self->session->request->param("assetId")) {
my $asset = WebGUI::Asset->newByDynamicClass($assetId);
my $asset = WebGUI::Asset->newByDynamicClass($self->session,$assetId);
if ($asset->canEdit) {
$asset->trash;
}
@ -246,7 +246,7 @@ sub www_restoreList {
my $self = shift;
return $self->session->privilege->insufficient() unless $self->canEdit;
foreach my $id ($self->session->request->param("assetId")) {
my $asset = WebGUI::Asset->newByDynamicClass($id);
my $asset = WebGUI::Asset->newByDynamicClass($self->session,$id);
$asset->publish;
}
if ($self->session->form->process("proceed") ne "") {

View file

@ -66,7 +66,7 @@ sub addRevision {
$self->session->db->write("insert into ".$definition->{tableName}." (assetId,revisionDate) values (".$self->session->db->quote($self->getId).",".$now.")");
}
}
my $newVersion = WebGUI::Asset->new($self->getId, $self->get("className"), $now);
my $newVersion = WebGUI::Asset->new($self->session,$self->getId, $self->get("className"), $now);
$newVersion->updateHistory("created revision");
$newVersion->update($self->get);
$newVersion->setVersionLock unless ($self->session->setting->get("autoCommit"));
@ -147,7 +147,7 @@ sub commitVersionTag {
my $tagId = shift;
my $sth = $self->session->db->read("select asset.assetId,asset.className,assetData.revisionDate from assetData left join asset on asset.assetId=assetData.assetId where assetData.tagId=".$self->session->db->quote($tagId));
while (my ($id,$class,$version) = $sth->array) {
WebGUI::Asset->new($id,$class,$version)->commit;
WebGUI::Asset->new($self->session,$id,$class,$version)->commit;
}
$sth->finish;
$self->session->db->write("update assetVersionTag set isCommitted=1, commitDate=".$self->session->datetime->time().", committedBy=".$self->session->db->quote($self->session->user->userId)." where tagId=".$self->session->db->quote($tagId));
@ -235,7 +235,7 @@ sub rollbackToTime {
}
my $sth = $self->session->db->read("select asset.className, asset.assetId, assetData.revisionDate from assetData left join asset on asset.assetId=assetData.assetId where assetData.revisionDate > ".$toTime." order by assetData.revisionDate desc");
while (my ($class, $id, $revisionDate) = $sth->array) {
my $revision = WebGUI::Asset->new($id, $class, $revisionDate);
my $revision = WebGUI::Asset->new($self->session,$id, $class, $revisionDate);
$revision->purgeRevision;
}
$sth->finish;
@ -267,7 +267,7 @@ sub rollbackVersionTag {
}
my $sth = $self->session->db->read("select asset.className, asset.assetId, assetData.revisionDate from assetData left join asset on asset.assetId=assetData.assetId where assetData.tagId = ".$self->session->db->quote($tagId)." order by assetData.revisionDate desc");
while (my ($class, $id, $revisionDate) = $sth->array) {
my $revision = WebGUI::Asset->new($id, $class, $revisionDate);
my $revision = WebGUI::Asset->new($self->session,$id, $class, $revisionDate);
$revision->purgeRevision;
}
$sth->finish;
@ -414,7 +414,7 @@ sub www_manageCommittedVersions {
my $self = shift;
my $ac = WebGUI::AdminConsole->new($self->session,"versions");
return $self->session->privilege->insufficient() unless ($self->session->user->isInGroup(3));
my $i18n = WebGUI::International->new("Asset");
my $i18n = WebGUI::International->new($self->session,"Asset");
my $rollback = $i18n->get('rollback');
my $rollbackPrompt = $i18n->get('rollback version tag confirm');
$ac->addSubmenuItem($self->getUrl('func=addVersionTag'), $i18n->get("add a version tag"));
@ -423,7 +423,7 @@ sub www_manageCommittedVersions {
<tr><th>Tag Name</th><th>Committed On</th><th>Committed By</th><th></th></tr> ';
my $sth = $self->session->db->read("select tagId,name,commitDate,committedBy from assetVersionTag where isCommitted=1");
while (my ($id,$name,$date,$by) = $sth->array) {
my $u = WebGUI::User->new($by);
my $u = WebGUI::User->new($self->session,$by);
$output .= '<tr>
<td><a href="'.$self->getUrl("func=manageRevisionsInTag;tagId=".$id).'">'.$name.'</a></td>
<td>'.$self->session->datetime->epochToHuman($date).'</td>
@ -446,9 +446,9 @@ Shows a list of the revisions for this asset.
sub www_manageRevisions {
my $self = shift;
my $ac = WebGUI::AdminConsole->new("versions");
my $ac = WebGUI::AdminConsole->new($self->session,"versions");
return $self->session->privilege->insufficient() unless ($self->session->user->isInGroup(3));
my $i18n = WebGUI::International->new("Asset");
my $i18n = WebGUI::International->new($self->session,"Asset");
my $output = '<table width=100% class="content">
<tr><th></th><th>Revision Date</th><th>Revised By</th><th>Tag Name</th></tr> ';
my $sth = $self->session->db->read("select assetData.revisionDate, users.username, assetVersionTag.name,assetData.tagId from assetData
@ -477,9 +477,9 @@ Shows a list of the currently available asset version tags.
sub www_manageVersions {
my $self = shift;
my $ac = WebGUI::AdminConsole->new("versions");
my $ac = WebGUI::AdminConsole->new($self->session,"versions");
return $self->session->privilege->insufficient() unless ($self->session->user->isInGroup(3));
my $i18n = WebGUI::International->new("Asset");
my $i18n = WebGUI::International->new($self->session,"Asset");
$ac->setHelp("versions manage");
$ac->addSubmenuItem($self->getUrl('func=addVersionTag'), $i18n->get("add a version tag"));
$ac->addSubmenuItem($self->getUrl('func=manageCommittedVersions'), $i18n->get("manage committed versions"));
@ -494,7 +494,7 @@ sub www_manageVersions {
<tr><th></th><th>Tag Name</th><th>Created On</th><th>Created By</th><th></th></tr> ';
my $sth = $self->session->db->read("select tagId,name,creationDate,createdBy from assetVersionTag where isCommitted=0");
while (my ($id,$name,$date,$by) = $sth->array) {
my $u = WebGUI::User->new($by);
my $u = WebGUI::User->new($self->session,$by);
$output .= '<tr>
<td>'.$self->session->icon->delete("func=rollbackVersionTag;tagId=".$id,$self->get("url"),$rollbackPrompt).'</td>
<td><a href="'.$self->getUrl("func=manageRevisionsInTag;tagId=".$id).'">'.$name.'</a></td>
@ -514,9 +514,9 @@ sub www_manageVersions {
sub www_manageRevisionsInTag {
my $self = shift;
my $ac = WebGUI::AdminConsole->new("versions");
my $ac = WebGUI::AdminConsole->new($self->session,"versions");
return $self->session->privilege->insufficient() unless ($self->session->user->isInGroup(3));
my $i18n = WebGUI::International->new("Asset");
my $i18n = WebGUI::International->new($self->session,"Asset");
$ac->addSubmenuItem($self->getUrl('func=addVersionTag'), $i18n->get("add a version tag"));
$ac->addSubmenuItem($self->getUrl('func=manageCommittedVersions'), $i18n->get("manage committed versions"));
$ac->addSubmenuItem($self->getUrl('func=manageVersions'), $i18n->get("manage versions"));
@ -528,7 +528,7 @@ sub www_manageRevisionsInTag {
where assetData.tagId=".$self->session->db->quote($self->session->form->process("tagId")));
foreach my $row (@{$p->getPageData}) {
my ($date,$by,$id, $class) = ($row->{revisionDate}, $row->{username}, $row->{assetId}, $row->{className});
my $asset = WebGUI::Asset->new($id,$class,$date);
my $asset = WebGUI::Asset->new($self->session,$id,$class,$date);
$output .= '<tr><td>'.$self->session->icon->delete("func=purgeRevision;proceed=manageRevisionsInTag;tagId=".$self->session->form->process("tagId").";revisionDate=".$date,$asset->get("url"),$i18n->get("purge revision prompt")).'</td>
<td>'.$asset->getTitle.'</td>
<td><img src="'.$asset->getIcon(1).'" alt="'.$asset->getName.'" />'.$asset->getName.'</td>
@ -548,7 +548,7 @@ sub www_purgeRevision {
return $self->session->privilege->insufficient() unless $self->canEdit;
my $revisionDate = $self->session->form->process("revisionDate");
return undef unless $revisionDate;
WebGUI::Asset->new($self->getId,$self->get("className"),$revisionDate)->purgeRevision;
WebGUI::Asset->new($self->session,$self->getId,$self->get("className"),$revisionDate)->purgeRevision;
if ($self->session->form->process("proceed") eq "manageRevisionsInTag") {
return $self->www_manageRevisionsInTag;
}
@ -601,7 +601,7 @@ sub www_setVersionTag () {
sub www_viewRevision {
my $self = shift;
my $otherSelf = WebGUI::Asset->new($self->getId,$self->get("className"),$self->session->form->process("revisionDate"));
my $otherSelf = WebGUI::Asset->new($self->session,$self->getId,$self->get("className"),$self->session->form->process("revisionDate"));
return (defined $otherSelf) ? $otherSelf->www_view : undef;
}

View file

@ -411,7 +411,7 @@ sub login {
#-------------------------------------------------------------------
sub new {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $authMethod = $_[0];
my $userId = $_[1];
my @callable = ('createAccount','deactivateAccount','displayAccount','displayLogin','login','logout','createAccountSave','deactivateAccountConfirm');

View file

@ -504,7 +504,7 @@ sub login {
#-------------------------------------------------------------------
sub new {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $authMethod = $_[0];
my $userId = $_[1];
my @callable = ('validateEmail','createAccount','deactivateAccount','displayAccount','displayLogin','login','logout','recoverPassword','resetExpiredPassword','recoverPasswordFinish','createAccountSave','deactivateAccountConfirm','resetExpiredPasswordSave','updateAccount');
@ -631,7 +631,7 @@ sub validateEmail {
my $self = shift;
my ($userId) = $self->session->db->quickArray("select userId from authentication where fieldData=".$self->session->db->quote($self->session->form->process("key"))." and fieldName='emailValidationKey' and authMethod='WebGUI'");
if (defined $userId) {
my $u = WebGUI::User->new($userId);
my $u = WebGUI::User->new($self->session,$userId);
$u->status("Active");
}
return $self->displayLogin;

View file

@ -116,7 +116,7 @@ A subdivider to store this cache under. When building your own cache plug-in def
sub new {
my $cache;
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
if ($session->config->get("memcached_servers")) {
require WebGUI::Cache::Memcached;
return WebGUI::Cache::Memcached->new($session,@_);

View file

@ -210,7 +210,7 @@ Defaults to the config filename for the current site. The only reason to overrid
sub new {
my $cache;
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $key = $class->parseKey(shift);
my $namespace = shift || $session->config->getFilename;
bless {_session=>$session, _key=>$key, _namespace=>$namespace}, $class;

View file

@ -115,7 +115,7 @@ Defaults to the config filename for the current site. The only reason to overrid
sub new {
my $cache;
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $key = $class->parseKey(shift);
my $namespace = shift || $session->config->getFilename;

View file

@ -4,7 +4,7 @@ use strict;
#-------------------------------------------------------------------
sub setCommerceSetting {
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my ($entry);
$entry = shift;
$session->db->write("delete from commerceSettings where ".

View file

@ -9,15 +9,15 @@ Package WebGUI::Commerce::Item
This is the SUPER class off all Item plugins. Item plugins are an abstraction layer to connect
arbitrary types of products and other stuff you might want to sell to the commerce system.
The SUPER class new method provides an easy way to load Item plugins: WebGUI::Item->new('1234', 'MyItem')
is equivalent to WebGUI::Item::MyItem->new('1234'). The SUPER class new has the benefit of added
The SUPER class new method provides an easy way to load Item plugins: WebGUI::Item->new($self->session,'1234', 'MyItem')
is equivalent to WebGUI::Item::MyItem->new($self->session,'1234'). The SUPER class new has the benefit of added
error checking, so you should use this.
=head1 SYNOPSIS
use WebGUI::Item;
$item = WebGUI::Item->new($itemId, $itemType);
$item = WebGUI::Item->new($self->session,$itemId, $itemType);
$description = $item->description;
$duration = $item->duration;

View file

@ -280,7 +280,7 @@ The namespace of the plugin.
sub load {
my ($class, $namespace, $load, $cmd, $plugin);
$class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
$namespace = shift;
$cmd = "WebGUI::Commerce::Payment::$namespace";

View file

@ -38,7 +38,7 @@ sub cancelRecurringPayment {
$self->{_recurring} = 1;
my $itemProperties = $recurring->{transaction}->getItems->[0];
my $item = WebGUI::Commerce::Item->new($itemProperties->{itemId}, $itemProperties->{itemType});
my $item = WebGUI::Commerce::Item->new($self->session,$itemProperties->{itemId}, $itemProperties->{itemType});
my $recipe = _resolveRecipe($item->duration);
# Set up a user agent that uses cookies and allows POST redirects
@ -479,7 +479,7 @@ sub confirmRecurringTransaction {
my $transaction = WebGUI::Commerce::Transaction->getByGatewayId($self->session->form->process("orig_xid"), $self->namespace);
my $itemProperties = $transaction->getItems->[0];
my $item = WebGUI::Commerce::Item->new($itemProperties->{itemId}, $itemProperties->{itemType});
my $item = WebGUI::Commerce::Item->new($self->session,$itemProperties->{itemId}, $itemProperties->{itemType});
my $startEpoch = $self->session->datetime->setToEpoch(sprintf("%4d-%02d-%02d %02d:%02d:%02d", unpack('a4a2a2a2a2a2', $self->session->form->process("start_date"))));
my $currentEpoch = $self->session->datetime->setToEpoch(sprintf("%4d-%02d-%02d %02d:%02d:%02d", unpack('a4a2a2a2a2a2', $self->session->form->process("when"))));
@ -802,7 +802,7 @@ sub validateFormData {
my ($self, @error, $i18n, $currentYear, $currentMonth);
$self = shift;
$i18n = WebGUI::International->new('CommercePaymentITransact');
$i18n = WebGUI::International->new($self->session,'CommercePaymentITransact');
push (@error, $i18n->get('invalid firstName')) unless ($self->session->form->process("firstName"));
push (@error, $i18n->get('invalid lastName')) unless ($self->session->form->process("lastName"));

View file

@ -206,7 +206,7 @@ The namespace of the plugin.
sub load {
my ($class, $namespace, $load, $cmd, $plugin);
$class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
$namespace = shift;
$session->errorHandler->fatal('No namespace passed to load.') unless ($namespace);

View file

@ -64,7 +64,7 @@ sub add {
$itemType = shift;
$quantity = shift || 1;
$item = WebGUI::Commerce::Item->new($itemId, $itemType);
$item = WebGUI::Commerce::Item->new($self->session,$itemId, $itemType);
return "" unless ($item->available);
$self->{_items}{$itemId."_".$itemType} = {
@ -209,7 +209,7 @@ sub getItems {
$periodResolve = WebGUI::Commerce::Payment::recurringPeriodValues($self->session);
%cartContent = %{$self->{_items}};
foreach (values(%cartContent)) {
$item = WebGUI::Commerce::Item->new($_->{itemId}, $_->{itemType});
$item = WebGUI::Commerce::Item->new($self->session,$_->{itemId}, $_->{itemType});
$properties = {
quantity => $_->{quantity},
period => lc($periodResolve->{$item->duration}),

View file

@ -87,7 +87,7 @@ sub completeTransaction {
$self = shift;
foreach (@{$self->getItems}) {
$item = WebGUI::Commerce::Item->new($_->{itemId}, $_->{itemType});
$item = WebGUI::Commerce::Item->new($self->session,$_->{itemId}, $_->{itemType});
$item->handler;
}
@ -414,7 +414,7 @@ sub new {
my ($class, $transactionId, $gatewayId, $userId, $properties, $sth, $row, @items);
$class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
$transactionId = shift;
$gatewayId = shift;
$userId = shift || $session->user->userId;

View file

@ -77,7 +77,7 @@ A hash reference containing the list of params to set. See the set() method for
sub create {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $params = shift;
$params->{databaseLinkId} = "new";
my $id = $session->db->setRow("databaseLink","databaseLinkId",$params);
@ -193,7 +193,7 @@ A reference to the current session.
sub getList {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $list = $session->db->buildHashRef("select databaseLinkId, title from databaseLink order by title");
my $i18n = WebGUI::International->new($session);
$list->{'0'} = $i18n->get(1076);
@ -221,7 +221,7 @@ sub new {
my ($class, $databaseLinkId, %databaseLink);
tie %databaseLink, 'Tie::CPHash';
$class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
$databaseLinkId = shift;
unless ($databaseLinkId eq "") {
if ($databaseLinkId eq "0") {

View file

@ -60,7 +60,7 @@ Dynamically creates functions on the fly for all the different form control type
sub AUTOLOAD {
our $AUTOLOAD;
my $name = ucfirst((split /::/, $AUTOLOAD)[-1]);
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my @params = @_;
my $cmd = "use WebGUI::Form::".$name;
eval ($cmd);
@ -123,7 +123,7 @@ If you want to add anything special to the form header like javascript actions o
=cut
sub formHeader {
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $params = shift;
my $action = $params->{action} || $session->url->page();
my $hidden;

View file

@ -65,7 +65,7 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session, "Asset");
push(@{$definition}, {

View file

@ -54,7 +54,7 @@ The default text to appear on the button. Defaults to an internationalized versi
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session,"WebGUI");
push(@{$definition}, {

View file

@ -58,7 +58,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -61,7 +61,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -55,7 +55,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -46,7 +46,7 @@ See the super class for additional details.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -56,7 +56,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -62,7 +62,7 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -35,7 +35,7 @@ Base class for all form field objects. Never use this class directly.
Subclasses will look like this:
use WebGUI::Form::subclass;
my $obj = WebGUI::Form::subclass->new(%params);
my $obj = WebGUI::Form::subclass->new($session,%params);
my $html = $obj->toHtml;
my $html = $obj->toHtmlAsHidden;
@ -149,7 +149,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
push(@{$definition}, {
formName=>{
@ -304,7 +304,7 @@ Returns a human readable name for this form control type. You MUST override this
sub getName {
my $self = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = $self->definition($session);
return $definition->[0]->{formName}->{defaultValue};
}
@ -397,6 +397,7 @@ Retrieves a value from a form GET or POST and returns it. If the value comes bac
sub getValueFromPost {
my $self = shift;
$self->session->errorHandler->warn("trying to get ".$self->get("name"));
my $formValue = $self->session->request->param($self->get("name"));
if (defined $formValue) {
return $formValue;
@ -430,7 +431,7 @@ Please note that an id attribute is automatically added to every form element wi
sub new {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my %raw;
# deal with a hash reference full of properties
if (ref $_[0] eq "HASH") {

View file

@ -71,7 +71,7 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -72,7 +72,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
@ -170,7 +170,7 @@ Renders the form field to HTML as a hidden field rather than whatever field type
sub toHtmlAsHidden {
my $self = shift;
return WebGUI::Form::Hidden->new(
return WebGUI::Form::Hidden->new($self->session,
name=>$self->get("name"),
value=>$self->session->datetime->epochToSet($self->get("value"))
)->toHtmlAsHidden;

View file

@ -67,7 +67,7 @@ If no value is specified, this will be used. Defaults to today and now.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -55,7 +55,7 @@ Defaults to "Text". Should be any valid field type.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
@ -97,7 +97,7 @@ array will be used.
sub new {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my %raw = @_;
my $param = \%raw;
my $fieldType = ucfirst($param->{fieldType});

View file

@ -54,7 +54,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -60,7 +60,7 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
@ -90,7 +90,7 @@ and DynamicField, the form class dispatcher.
sub getTypes {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
opendir(DIR,$session->config->getWebguiRoot."/lib/WebGUI/Form/");
my @rawTypes = readdir(DIR);
closedir(DIR);

View file

@ -63,7 +63,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
@ -106,7 +106,7 @@ sub displayForm {
my $action = join '_', '_', $self->get("name"), 'delete';
$fileForm .= $i18n->get(392)
. "&nbsp"x4
. WebGUI::Form::YesNo->new({-name=>$action, -value=>0})->toHtml;
. WebGUI::Form::YesNo->new($self->session,{-name=>$action, -value=>0})->toHtml;
}
my $hid = $self->toHtmlAsHidden();
$fileForm .= $hid;

View file

@ -63,7 +63,7 @@ A tooltip for what to do with this field. Defaults to a general explaination of
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -66,7 +66,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -71,7 +71,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -69,7 +69,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
@ -118,9 +118,9 @@ sub toHtml {
my $self = shift;
$self->session->style->setScript($self->session->config->get("extrasURL").'/textFix.js',{ type=>'text/javascript' });
$self->get("extras") .= ' onblur="fixChars(this.form.'.$self->get("name").')" mce_editable="true" ';
return $self->SUPER::toHtml.WebGUI::Asset::RichEdit->new($self->get("richEditId"))->getRichEditor($self->get('id'));
return $self->SUPER::toHtml.WebGUI::Asset::RichEdit->new($self->session,$self->get("richEditId"))->getRichEditor($self->get('id'));
my $i18n = WebGUI::International->new($self->session);
my $richEdit = WebGUI::Asset::RichEdit->new($self->get("richEditId"));
my $richEdit = WebGUI::Asset::RichEdit->new($self->session,$self->get("richEditId"));
if (defined $richEdit) {
return $self->SUPER::toHtml.$richEdit->getRichEditor($self->get('id'));
} else {

View file

@ -54,7 +54,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -62,7 +62,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -64,7 +64,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -66,7 +66,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -63,7 +63,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -75,7 +75,7 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -145,7 +145,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -62,7 +62,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -54,7 +54,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -58,7 +58,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -70,7 +70,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -55,7 +55,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -68,7 +68,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -62,7 +62,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -46,7 +46,7 @@ See the super class for additional details.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -63,7 +63,7 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session, 'Asset_Template');
push(@{$definition}, {
@ -131,7 +131,7 @@ editing the template show up if the user is allowed to do that.
sub setManageIcons {
my $self = shift;
my $template = WebGUI::Asset::Template->new($self->get('value'));
my $template = WebGUI::Asset::Template->new($self->session,$self->get('value'));
if (defined $template && $template->canEdit) {
my $returnUrl;
if (defined $self->session->asset && ref $self->session->asset eq "WebGUI::Asset::Template") {

View file

@ -62,7 +62,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -66,7 +66,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -64,7 +64,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
@ -113,6 +113,7 @@ sub toHtml {
$self->get("extras") .= ' onkeyup="doInputCheck(this.form.'.$self->get("name").',\'0123456789:\')"';
return $self->SUPER::toHtml
.WebGUI::Form::Button->new(
$self->session,
id=>$self->get('id'),
extras=>'style="font-size: 8pt;" onclick="window.timeField = this.form.'.$self->get("name").';clockSet = window.open(\''.$self->session->config->get("extrasURL"). '/timeChooser.html\',\'timeChooser\',\'WIDTH=230,HEIGHT=100\');return false"',
value=>$i18n->get(970)

View file

@ -46,7 +46,7 @@ See the super class for additional details.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -58,7 +58,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -58,7 +58,7 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -59,7 +59,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -58,7 +58,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

Some files were not shown because too many files have changed in this diff Show more