Subject: | additional propfind() patch/idea |
Itd be excellent to have these properties available in the next version:<D:quota/> and
<D:quotaused/>
in propfind() something like this:
} elsif ($ns eq 'DAV:' && $name eq 'quota') {
$prop = $doc->createElement('D:quota');
$prop->appendText( _my_get_quota() );
$okprops->addChild($prop);
} elsif ($ns eq 'DAV:' && $name eq 'quotaused') {
$prop = $doc->createElement('D:quotaused');
$prop->appendText( _my_get_quota_used() );
$okprops->addChild($prop);
What may be even better is support for any given set of properties by having an additional
hashref like this created as needed by the author:
my $props = {
'quota' => _my_get_quota( $user ),
'quotaused' => _my_get_quota_used( $user ),
};
then have it passed to propget() and have propget do
for my $prp (keys %{ $props }) {
if($ns eq 'DAV:' && $name eq $prp) {
$prop = $doc->createElement("D:$prp");
$prop->appendText(
ref $props->{$prp} eq 'CODE' ? $props->{$prp}->() : $props->{$prp}
);
$okprops->addChild($prop);
}
}
Thanks for your time