Skip to content

Commit

Permalink
LinkMe 0.01
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.magicvox.net/var/svn/mt-plugins/__misc@128 adbff654-c4ea-448a-8ae3-cad037306009
  • Loading branch information
piroli committed Feb 6, 2010
1 parent 16bfb54 commit a3359f5
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions LinkMe.pl
@@ -0,0 +1,25 @@
package MT::Plugin::OMV::LinkMe;

use strict;
use MT 4;
use MT::Template::Context;

use vars qw( $MYNAME $VERSION );
$MYNAME = 'LinkMe';
$VERSION = '0.01';

### BuildPage callback
MT->add_callback ('BuildFileFilter', 9, undef, sub {
my (undef, %args) = @_;
$args{Context}->stash ($MYNAME. '::file_info', $args{FileInfo});
1;
});

### Functional tag
MT::Template::Context->add_tag ($MYNAME => sub {
my $finfo = $_[0]->stash ($MYNAME. '::file_info')
or return '';
$finfo->url || '';
});

1;

0 comments on commit a3359f5

Please sign in to comment.