diff --git a/lib/noosfero/plugin.rb b/lib/noosfero/plugin.rb index 3d6f213..feca62d 100644 --- a/lib/noosfero/plugin.rb +++ b/lib/noosfero/plugin.rb @@ -13,6 +13,10 @@ class Noosfero::Plugin context.environment if self.context end + def profile + context.send :profile if self.context + end + class << self include Noosfero::Plugin::ParentMethods diff --git a/plugins/analytics/lib/analytics_plugin/base.rb b/plugins/analytics/lib/analytics_plugin/base.rb index 082a2bd..36bcfc6 100644 --- a/plugins/analytics/lib/analytics_plugin/base.rb +++ b/plugins/analytics/lib/analytics_plugin/base.rb @@ -42,7 +42,7 @@ class AnalyticsPlugin::Base < Noosfero::Plugin { title: I18n.t('analytics_plugin.lib.plugin.panel_button'), icon: 'analytics-access', - url: {controller: 'analytics_plugin/stats', action: :index} + url: {controller: 'analytics_plugin/stats', profile: profile.identifier, action: :index} } end diff --git a/plugins/custom_forms/lib/custom_forms_plugin.rb b/plugins/custom_forms/lib/custom_forms_plugin.rb index 4caa8ee..f7f1833 100644 --- a/plugins/custom_forms/lib/custom_forms_plugin.rb +++ b/plugins/custom_forms/lib/custom_forms_plugin.rb @@ -13,7 +13,7 @@ class CustomFormsPlugin < Noosfero::Plugin end def control_panel_buttons - {:title => _('Manage Forms'), :icon => 'custom-forms', :url => {:controller => 'custom_forms_plugin_myprofile'}} + {title: _('Manage Forms'), icon: 'custom-forms', url: {profile: profile.identifier, controller: 'custom_forms_plugin_myprofile'}} end end diff --git a/plugins/sub_organizations/lib/sub_organizations_plugin.rb b/plugins/sub_organizations/lib/sub_organizations_plugin.rb index 55e928a..75ebe7d 100644 --- a/plugins/sub_organizations/lib/sub_organizations_plugin.rb +++ b/plugins/sub_organizations/lib/sub_organizations_plugin.rb @@ -20,7 +20,7 @@ class SubOrganizationsPlugin < Noosfero::Plugin def control_panel_buttons if context.profile.organization? && Organization.parents(context.profile).blank? - { :title => _('Manage sub-groups'), :icon => 'groups', :url => {:controller => 'sub_organizations_plugin_myprofile'} } + { title: _('Manage sub-groups'), icon: 'groups', url: {profile: profile.identifier, controller: :sub_organizations_plugin_myprofile} } end end -- libgit2 0.21.2