Changeset 2667

Show
Ignore:
Timestamp:
07/01/08 04:52:13 (20 months ago)
Author:
bchoate
Message:

Added support for a plugin/component to define an init handler.

Location:
branches/release-41/lib
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/release-41/lib/MT.pm.pre

    r2276 r2667  
    21132113                my $label = $c->label || $pack->{label}; 
    21142114                $label = $label->() if ref($label) eq 'CODE'; 
     2115                # if the component did not declare a label, 
     2116                # it isn't wanting to be visible on the app footer. 
     2117                next if $label eq $c->{plugin_sig}; 
    21152118                push @packs_installed, { 
    21162119                    label => $label, 
  • branches/release-41/lib/MT/Component.pm

    r1927 r2667  
    137137        } 
    138138    } 
     139    if (my $init = _getset( $c, 'init' )) { 
     140        if ( $init && !ref($init) ) { 
     141            $init = MT->handler_to_coderef($init); 
     142        } 
     143        return $init->($c); 
     144    } 
     145    return 1; 
    139146} 
    140147