molpe / tog_podcasts

tog plugin for managing podcasts

tog_podcasts / init.rb
100644 29 lines (21 sloc) 1.325 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require_plugin 'tog_core'
require_plugin 'seo_urls'
require_plugin 'flashplayrhelpr'
require_plugin 'paperclip'
 
 
 
require "i18n" unless defined?(I18n)
Dir[File.dirname(__FILE__) + '/locale/**/*.yml'].each do |file|
  I18n.load_path << file
end
 
Tog::Plugins.settings :tog_podcasts, "channel.cover.max_file_size_kb"=> 1000, #kb
                                     "channel.cover.big" => "150x150#",
                                     "channel.cover.medium" => "100x100#",
                                     "channel.cover.small" => "50x50#",
                                     "channel.cover.tiny" => "25x25#",
                                     "channel.cover.default_image" => '/tog_podcasts/images/default_cover.jpg',
                                     "episodes.max_file_size_kb" => 30000, #kb
                                     "allowed_mime_types" => %w( audio/mpeg audio/mpg audio/mp3 audio/mp4 audio/mpeg3 audio/x-mp3 audio/x-mpeg3 ).join(', ')
                                   
Tog::Plugins.helpers Podcasts::ChannelsHelper
 
Tog::Interface.sections(:site).add "Podcasts", "/podcasts/channels"
Tog::Interface.sections(:member).add "Podcasts", "/member/podcasts/channels"
 
Tog::Search.sources << "Channel"
Tog::Search.sources << "Episode"