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

@ -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);