%# BEGIN LICENSE BLOCK
%# 
%#  Copyright (c) 2002-2003 Jesse Vincent <jesse@bestpractical.com>
%#  
%#  This program is free software; you can redistribute it and/or modify
%#  it under the terms of version 2 of the GNU General Public License 
%#  as published by the Free Software Foundation.
%# 
%#  A copy of that license should have arrived with this
%#  software, but in any event can be snarfed from www.gnu.org.
%# 
%#  This program 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 General Public License for more details.
%# 
%# END LICENSE BLOCK

% while (my $CustomField = $CustomFields->Next()) {
<tr>
    <td class="labeltop"><b><%$CustomField->Name%></b><br /><i><%$CustomField->FriendlyType%></i></td>
    <td class="entry"><& /Elements/EditCustomField, 
        Object => $ArticleObj, 
        CustomField => $CustomField, 
        NamePrefix => $NamePrefix,
        Default => 
            ($CFContent->{$CustomField->Id} || 
              $ARGS{$NamePrefix .$CustomField->id .'-Values'} ||
              $ARGS{$NamePrefix .$CustomField->id .'-Value'})
              ,
        Rows => 15,
        Cols => 70
        &></td>
</tr>
% }
<%INIT>
my $CustomFields;
my $NamePrefix;

if ($ArticleObj->id && $ArticleObj->ClassObj->id) {
    $CustomFields = $ArticleObj->CustomFields();
    $NamePrefix = "Object-RT::FM::Article-".$ArticleObj->Id."-CustomField-";
}
else {
    $CustomFields = $ClassObj->ArticleCustomFields();
    $NamePrefix = "Object-RT::FM::Article--CustomField-";
}
</%INIT>
<%ARGS>
$ArticleObj => undef
$ClassObj => undef
$CFContent => undef
$id => undef
</%ARGS>
