environment_notification_plugin.rb
953 Bytes
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
class EnvironmentNotificationPlugin < Noosfero::Plugin
def self.plugin_name
"Environment Notifications Plugin"
end
def self.plugin_description
_("A plugin for environment notifications.")
end
def stylesheet?
true
end
def js_files
%w(
public/environment_notification_plugin.js
)
end
def body_beginning
lambda do
extend EnvironmentNotificationHelper
render template: 'environment_notification_plugin_admin/show_notification'
end
end
def admin_panel_links
{:title => _('Notification Manager'), :url => {:controller => 'environment_notification_plugin_admin', :action => 'index'}}
end
def account_controller_filters
block = proc do
if !logged_in?
cookies[:hide_notifications] = nil
end
end
[{
:type => "after_filter",
:method_name => "clean_hide_notifications_cookie",
:options => { },
:block => block
}]
end
end