# Copyright (c) 2001-2006 bivio Software, Inc. All rights reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: UserMailbox.pm,v 1.1 2006/12/06 19:49:27 moeller Exp $ package Bivio::UI::Mail::Widget::UserMailbox; use strict; $Bivio::UI::Mail::Widget::UserMailbox::VERSION = sprintf('%d.%02d', q$Revision: 1.1 $ =~ /\d+/g); $_ = $Bivio::UI::Mail::Widget::UserMailbox::VERSION; =head1 NAME Bivio::UI::Mail::Widget::UserMailbox - Mailbox for a User =head1 RELEASE SCOPE bOP =head1 SYNOPSIS use Bivio::UI::Mail::Widget::UserMailbox; =cut =head1 EXTENDS L =cut use Bivio::UI::Mail::Widget::Mailbox; @Bivio::UI::Mail::Widget::UserMailbox::ISA = ('Bivio::UI::Mail::Widget::Mailbox'); =head1 DESCRIPTION C single user's mailbox =head1 ATTRIBUTES =over 4 =item user_id : any (required) User to render. =back =cut #=IMPORTS #=VARIABLES =head1 METHODS =cut =for html =head2 initialize() Initializes child widgets. =cut sub initialize { my($self) = @_; $self->initialize_attr('user_id'); return; } =for html =head2 static internal_new_args(any args, ...) : any Implements positional argument parsing for L. =cut sub internal_new_args { my(undef, $user_id, $attrs) = @_; return '"user_id" attribute must be defined' unless $user_id; return { user_id => $user_id, ($attrs ? %$attrs : ()), }; } =for html =head2 render(any source, string buffer) Sets email and name and calls superclass. =cut sub render { my($self, $source) = @_; my($user_id) = $self->render_attr('user_id', $source); my($user) = Bivio::Biz::Model->new($source->get_request, 'User') ->unauth_load_or_die({ user_id => $$user_id, }); $self->put(name => $user->format_full_name); $self->put(email => $user->new_other('Email')->unauth_load_or_die({ realm_id => $$user_id, })->get('email')); shift->SUPER::render(@_); return; } #=PRIVATE METHODS =head1 COPYRIGHT Copyright (c) 2001-2006 bivio Software, Inc. All rights reserved. Visit http://www.bivio.biz for more info. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; If not, you may get a copy from: http://www.opensource.org/licenses/lgpl-license.html =head1 VERSION $Id: UserMailbox.pm,v 1.1 2006/12/06 19:49:27 moeller Exp $ =cut 1;