package MT::Plugin::NozawaPlugin;
use strict;
use MT;
use vars qw($VERSION @ISA);#グローバル変数を定義している
@ISA = qw(MT::Plugin);
#@ISAはpackage継承するクラスを指定するために使用される
$VERSION = "1.0";
#ここでインスタンス生成のようなことをしている
my $plugin = new MT::Plugin::NozawaPlugin({
    name => 'Nozawa Made Plugin: prototype',
    version => $VERSION,
    description => "to show something on dashboard.",
    author_name => 'Shinichi Nozawa',
    author_link => 'http://melonsode.fem.jp/',
    doc_link => 'http://melonsode.fem.jp/fs/',
});
MT->add_plugin($plugin);
#これがwidgetの部分
sub init_registry {
    my $plugin = shift;
    $plugin->registry({
        widgets => {
            hello_world => {
                label    => 'Hello World',
                plugin   => $plugin,
                template => 'hello_world.mtml',
            },
        },
    });
}
1;
sub init_registry部分を削除すると何にもしないプラグインになる。
参考ページ:
1.プラグイン開発のためのファーストステップ
2.Registering Dashboard Widgets
3.MT4Beta : DashboardWidgetを作ってみた。はてブの新着を表示するよ。
2.のリンクにあるDashboard Widget Registry Propertiesを簡単にまとめる。
- label
この場合はhelloworld - plugin
プラグイン? - template
テンプレートの在り処 - system_permission と permission
ある種の権限やシステムを必要とする。例えばpermission => 'post'でユーザーがブログにポストできないと、ウィジェットを追加することができない。 - condition
カスタムハンドラーが、ユーザーを評価し、ダッシュボードがウィジェットを追加し使用することを必要とする。 - singular
ダッシュボード上にただひとつのウィジェットのインスタンスを許す - set
ダッュボードの特定のカラムだけを特定する。mainかsidebarか。 - code あるいは handler
ウィジェットのランタイム環境をカスタマイズする。($app, $tmpl, $widget_paramの引数で呼ばれる。