plataforma_social 0.0.25 → 0.0.26
Sign up to get free protection for your applications and to get access to all the features.
@@ -94,28 +94,30 @@ module PlataformaSocial
|
|
94
94
|
params.present? && params[:controller].present? && params[:controller].index(PlataformaSocial.admin_controller_name) == 0
|
95
95
|
end
|
96
96
|
|
97
|
-
def
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
link_to_facebook *args
|
97
|
+
def link_to *args, &block
|
98
|
+
args[2] ||= {}
|
99
|
+
|
100
|
+
if args[2][:normal] === true
|
101
|
+
super
|
104
102
|
else
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
103
|
+
unless block_given?
|
104
|
+
if from_facebook? && !from_admin?
|
105
|
+
server_domain = request.env['HTTP_HOST']
|
106
|
+
url = 'apps.facebook.com/' + PlataformaSocial.facebook_app_namespace
|
107
|
+
|
108
|
+
if args[1].include? server_domain
|
109
|
+
args[1].gsub! server_domain, url
|
110
|
+
else
|
111
|
+
args[1] = request.protocol + url + args[1]
|
112
|
+
end
|
113
|
+
|
114
|
+
args[2][:target] = '_top'
|
115
|
+
else
|
116
|
+
super
|
117
|
+
end
|
114
118
|
end
|
115
|
-
|
116
|
-
args[2][:target] = '_top'
|
117
119
|
|
118
|
-
|
120
|
+
super
|
119
121
|
end
|
120
122
|
end
|
121
123
|
end
|