package MT::Plugin::SKR::OmitCancelBtnUpload;
# OmitCancelBtnUpload - 
#       Copyright (c) 2008 SKYARC System Co.,Ltd.
#       http://www.skyarc.co.jp/engineerblog/entry/omitcancelbtnupload.html

use strict;

use vars qw( $MYNAME $VERSION );
$MYNAME = 'OmitCancelBtnUpload';
$VERSION = '1.00';

use base qw( MT::Plugin );
my $plugin = __PACKAGE__->new({
        name => $MYNAME,
        id => lc $MYNAME,
        key => lc $MYNAME,
        version => $VERSION,
        author_name => 'SKYARC System Co.,Ltd.',
        author_link => 'http://www.skyarc.co.jp/',
        doc_link => 'http://www.skyarc.co.jp/engineerblog/entry/omitcancelbtnupload.html',
        description => <<HTMLHEREDOC,
<__trans phrase="OmitCancelBtnUpload">
HTMLHEREDOC
#        l10n_class  => $MYNAME. '::L10N',
});
MT->add_plugin( $plugin );

sub instance { $plugin; }

### Registry
sub init_registry {
    my $plugin = shift;
    $plugin->registry({
        callbacks => {
            'MT::App::CMS::template_source.asset_options' => \&_edit_entry_source,
        },
    });
}



###
sub _edit_entry_source {
    my ($eh, $app, $tmpl) = @_;

    my $old = quotemeta(<<'HTMLHEREDOC');
            <button
                onclick="closeDialog(); return false"
                type="submit"
                accesskey="x"
                title="<__trans phrase="Cancel (x)">"
                ><__trans phrase="Cancel"></button>
HTMLHEREDOC
    $$tmpl =~ s/$old//;
}

1;
__END__
