ref: master
plugins/fb_app/lib/fb_app_plugin/base.rb
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 |
class FbAppPlugin::Base < Noosfero::Plugin def stylesheet? true end def js_files ['fb_app.js'].map{ |j| "javascripts/#{j}" } end def head_ending return unless FbAppPlugin.config.present? lambda do tag 'meta', property: 'fb:app_id', content: FbAppPlugin.config[:app][:id] end end def control_panel_buttons return unless FbAppPlugin.config.present? { title: FbAppPlugin.plugin_name, icon: 'fb-app', url: {host: FbAppPlugin.config[:app][:domain], profile: profile.identifier, controller: :fb_app_plugin_myprofile} } end end ActiveSupport.on_load :open_graph_plugin do OpenGraphPlugin::Stories.register_publisher FbAppPlugin::Publisher.default end ActiveSupport.on_load :metadata_plugin do MetadataPlugin::Controllers.class_eval do def fb_app_plugin_page_tab :@product end end end |