Skip to Content.
Sympa Menu

devel - is_moderated

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: Petr Prazak <address@concealed>
  • To: Olivier Salaun <address@concealed>
  • Cc: address@concealed
  • Subject: is_moderated
  • Date: Fri, 20 Apr 2001 19:50:53 +0200

Hi,

18.4.2001, Olivier Salaun wrote on subject `[sympa-dev] Sympa l10n and other
issues':

> I suppose you mean the [is_moderated] var available in templates.
> Have a look at list_menu.tpl for an example :
> (it works well for us)
> [IF is_moderated]
> Moderators
> [FOREACH e IN editor]
> <BR><FONT SIZE=-1><A
> HREF="mailto:[e->>NAME]">[e->gecos]</A></FONT>
> [END]
> [ENDIF]


I have taken a look at the List::is_moderated. It seem that it gets
defined sometimes, even when the list of editors is empty.

The currect definition is

## Is the list moderated ?
sub is_moderated {
return 1 if (defined shift->{'admin'}{'editor'});

return 0;
}

I have changed it to the following:

sub is_moderated {
my $ref = shift;
return 0 if (not defined $ref); # this is probably unnecessary
return 0 if (not defined $ref->{'admin'}{'editor'});
return 1 if (scalar @{$ref->{'admin'}{'editor'}});

return 0;
}

However, I am no Perl guru and it seems to fix only the consequence, not
the cause. :)

Best regards,
Petr Prazak





Archive powered by MHonArc 2.6.19+.

Top of Page