# Copyright (c) 2001-2009 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: TaskInfo.pm,v 2.4 2010/04/09 23:48:34 nagler Exp $ package Bivio::UI::HTML::Widget::TaskInfo; use strict; use Bivio::Base 'UI.Widget'; use Bivio::UI::ViewLanguageAUTOLOAD; our($VERSION) = sprintf('%d.%02d', q$Revision: 2.4 $ =~ /\d+/g); my($_SC); sub render { my($self, $source, $buffer) = @_; my($req) = $source->get_request; my($task) = $req->get('task'); $$buffer .= <<"EOF"
Control Logic for This Page
(click on link to see the source code)
Name: @{[$task->get('id')->get_name]}
Realm: @{[$task->get('realm_type')->get_name]}
Permissions: @{[join('&',
map($_->get_name, @{Bivio::Auth::PermissionSet->to_array(
$task->get('permission_set'))}))]}
EOF
. join("\n",
map({
my($object, $method, $args) = @$_;
$object = ref($object)
if ref($object);
#TODO: Does not handle inline subs
my($b) = '';
($_SC ||= SourceCode({})->package_name)->render_source_link(
$req,
$object->isa('Bivio::UI::View::LocalFile')
? 'View.' . $args->[0]
: $object,
$object . '->'
. $method
. (@$args ? '(' . join(', ', @$args) . ')' : ''),
\$b,
);
$b;
} @{$task->get('items')}),
"\n",
);
#TODO: render attributes
return;
}
1;