video_plugin.rb
1.15 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
class VideoPlugin < Noosfero::Plugin
def self.plugin_name
"Video Content type, Video Block and Video Gallery Plugin"
end
def self.plugin_description
_("A plugin that adds a block where you can add videos from youtube, vimeo and html5.")
end
def self.extra_blocks
{
VideoPlugin::VideoBlock => {}
}
end
def stylesheet?
true
end
def content_types
[VideoPlugin::VideoGallery, VideoPlugin::Video]
end
def content_remove_new(content)
if content.kind_of?(VideoPlugin::VideoGallery) or content.kind_of?(VideoPlugin::Video)
true
end
end
def content_remove_upload(content)
if content.kind_of?(VideoPlugin::VideoGallery) or content.kind_of?(VideoPlugin::Video)
true
end
end
def article_extra_toolbar_buttons(content)
if content.kind_of?(VideoPlugin::VideoGallery)
proc do
content_tag('a', _("New Video"),
{ :id=>"new-video-btn",
:class=>"button with-text icon-new",
:href=>url_for(:action => 'new', :type=>'VideoPlugin::Video', :controller=>'cms', :parent_id => content.id),
:title=>_("New Video")
})
end
end
end
end