1 package PluginManager::Repository;
4 my ($create_if_not_exists) = @_;
6 my $app = MT->instance;
7 my $dir_mode = (~ oct(MT->config('DirUmask'))) & oct('777');
8 #File::Spec->catdir($app->server_path(), 'mpm');
9 my $path = File::Spec->catdir($app->support_directory_path, 'mpm');
10 if (! -d $path && $create_if_not_exists) {
12 chmod($dir_mode, $path);
18 my ($create_if_not_exists) = @_;
20 my $dir_mode = (~ oct(MT->config('DirUmask'))) & oct('777');
21 my $path = File::Spec->catdir(repository_root(@_), 'pool');
22 if (! -d $path && $create_if_not_exists) {
24 chmod($dir_mode, $path);
30 my ($create_if_not_exists) = @_;
32 my $app = MT->instance;
33 my $root_path = repository_root;
35 return '' if ! -d $root_path;
37 return $app->support_directory_url . 'mpm/';
40 sub available_components {
44 markdown/smartypants.pl
45 spamlookup/spamlookup_words.pl
46 spamlookup/spamlookup.pl
49 spamlookup/spamlookup_urls.pl
50 wxrimporter/wxrimporter.pl
62 communityactionstreams
64 my $defaults_count = scalar(@defaults);
65 my %comp = %MT::Components;
68 grep({ $_ ne $c } @defaults) == $defaults_count
69 } keys(%MT::Components));