Name

widget-info — Access information for a particular widget

ATTRIBUTES

Attribute Pos. Req. Default Description
name Yes
attribute Yes
interpolate     0 interpolate output?
hide     0 Hide the tag return value?

DESCRIPTION

BEHAVIOR

This tag does not appear to be affected by, or affect, the rest of Interchange.

EXAMPLES

No examples are available at this time. We do consider this a problem and will try to supply some.

NOTES

AVAILABILITY

widget-info is available in Interchange versions:

4.6.0-5.9.0 (git-head)

SOURCE

Interchange 5.9.0:

Source: code/UI_Tag/widget_info.coretag
Lines: 65


UserTag widget-info  Order  name attribute
UserTag widget-info  Version  $Revision: 1.1 $
UserTag  widget-info  Routine  <<EOR
my %wi_attr = ((map { (lc $_, $_) } qw(
Widget
Documentation
Visibility
Description
Help
Multiple
Version
)), qw(
exists  Widget
));

sub {
my ($name, $attr) = @_;

if (length $name) {
  # Global or Local?
  my $repo = $Global::CodeDef->{Widget};
  $repo = $Vend::Cfg->{CodeDef}{Widget} if $Vend::Cfg->{CodeDef}{Widget}{Widget}{$name};
  return unless $repo->{Widget}{$name};

  if (length $attr) {
    # return just one attribute for the given name.
    $attr = $wi_attr{lc $attr} or return;
    return $repo->{$attr}{$name};
  }
  else {
    # return a hashref with all the available attributes for a given name.
    my %build = reverse %wi_attr;
    while (my $key = each %build) {
      if (exists $repo->{$key}{$name}) {
        $build{$key} = $repo->{$key}{$name};
      }
      else {
        delete $build{$key};
      }
    }
    return \%build;
  }
}
else {
  # return a hashref of hashrefs for all the widgets and their attributes.
  my %build = %{$Global::CodeDef->{Widget}{Widget}};
  @build{keys %build} = ($Global::CodeDef->{Widget}) x scalar keys %build;
  @build{keys %{$Vend::Cfg->{CodeDef}{Widget}{Widget}}} = ($Vend::Cfg->{CodeDef}{Widget}) \
 x scalar keys %{$Vend::Cfg->{CodeDef}{Widget}{Widget}};

  foreach my $name (keys %build) {
    my $repo = $build{$name};
    $build{$name} = {reverse %wi_attr};
    while (my $key = each %{$build{$name}}) {
      if (exists $repo->{$key}{$name}) {
        $build{$name}{$key} = $repo->{$key}{$name};
      }
      else {
        delete $build{$name}{$key};
      }
    }
  }
  return \%build;
}
}
EOR

AUTHORS

Interchange Development Group

SEE ALSO

DocBook! Interchange!