Account release candidate - final changes before merge

This commit is contained in:
Frank Dillon 2008-11-15 02:39:23 +00:00
parent aec93573f0
commit 11d18075fa
45 changed files with 3379 additions and 1325 deletions

View file

@ -52,6 +52,10 @@ the asset and simply return the url of the first file it finds
If id is passed in and the isStorageId flag is set, you may pass in filename
to specify the name of the file you'd like returned.
head3 isImage
If id is passed in and the isImage flag is set, the first image will be returned
=cut
sub process {
@ -60,11 +64,18 @@ sub process {
my $id = shift;
my $isStorageId = shift;
my $filename = shift;
my $isImage = shift;
my $i18n = WebGUI::International->new($session, 'Macro_FileUrl');
#Handle storageId case
if($isStorageId && $id) {
my $store = WebGUI::Storage->get($session,$id);
my $store = undef;
if($isImage) {
$store = WebGUI::Storage::Image->get($session,$id);
}
else {
$store = WebGUI::Storage->get($session,$id);
}
$filename = $store->getFiles->[0] unless ($filename);
return "" unless ($filename);
return $store->getUrl($filename);

View file

@ -29,7 +29,7 @@ sub _createURL {
my $session = shift;
my $text = shift;
my $class = shift;
my $url = '<a href="'.$session->url->page("op=viewInbox").'"';
my $url = '<a href="'.$session->url->page("op=account;module=inbox").'"';
$url .= ' class="'.$class.'"' if($class);
$url .= '>'.$text.'</a>';
return $url;

View file

@ -18,19 +18,34 @@ Package WebGUI::Macro::User
=head1 DESCRIPTION
Macro for displaying information from the current User's profile.
Macro for displaying information from the a User's profile.
=head2 process( field )
=head2 process( field [, userId] )
process takes a single parameter, the name of a field in the current user's User Profile from
the data stored in $session . If the field does not exist, undef is returned.
This macro tries to return the profile field passed in for the user
passed in. If not user is passed in, the current user in session
will be used.
=head3 field
=cut
#-------------------------------------------------------------------
sub process {
my $session = shift;
return $session->user->profileField(shift);
my $session = shift;
my $field = shift;
my $userId = shift;
return undef unless ($field);
my $user = ($userId)
? WebGUI::User->new($session,$userId)
: $session->user
;
return $user->profileField($field);
}