Skip to content
Browse files

mod_facebook: fix dispatch. Add open graph html head. Added 'useauth'…

… option.

Fixes #442
  • Loading branch information...
1 parent 1471464 commit 9599650b1d3292a268e4b65131b356d52d0cd61c @mworrell mworrell committed Oct 7, 2012
View
3 modules/mod_facebook/controllers/controller_admin_facebook.erl
@@ -50,7 +50,8 @@ save_settings([], Context) ->
Context;
save_settings([{Key, Value} | T], Context) when Key == "appid";
Key == "appsecret" ;
- Key == "scope"->
+ Key == "scope" ;
+ Key == "useauth" ->
m_config:set_value(mod_facebook, list_to_atom(Key), Value, Context),
save_settings(T, Context);
save_settings([_|T], Context) ->
View
2 modules/mod_facebook/mod_facebook.erl
@@ -76,6 +76,6 @@ observe_admin_menu(admin_menu, Acc, Context) ->
parent=admin_modules,
label=?__("Facebook", Context),
url={admin_facebook},
- visiblecheck={acl, use, ?MODULE}}
+ visiblecheck={acl, use, mod_facebook}}
|Acc].
View
10 modules/mod_facebook/templates/_html_head.tpl
@@ -0,0 +1,10 @@
+{% if m.config.site.title.value %}
+ <meta property="og:site_name" content="{{ m.config.site.title.value }}"/>
+{% endif %}
+{% if id %}
+ <meta property="og:title" content="{{ id.title }}"/>
+ <meta property="og:url" content="http://{{ m.site.hostname }}{{ id.page_url }}"/>
+ {% if id.depiction %}
+ <meta property="og:image" content="http://{{ m.site.hostname }}{% image_url id.depiction mediaclass="facebook-og" %}"/>
+ {% endif %}
+{% endif %}
View
2 modules/mod_facebook/templates/_logon_extra.tpl
@@ -1,3 +1,5 @@
+{% if m.config.mod_facebook.useauth.value and m.config.mod_facebook.appid.value %}
<li id="logon_facebook">
{% include "_facebook_login_link.tpl" %}
</li>
+{% endif %}
View
2 modules/mod_facebook/templates/_signup_services.tpl
@@ -1,3 +1,5 @@
+{% if m.config.mod_facebook.useauth.value and m.config.mod_facebook.appid.value %}
<li id="logon_facebook">
{% include "_facebook_login_link.tpl" %}
</li>
+{% endif %}
View
19 modules/mod_facebook/templates/admin_facebook.tpl
@@ -13,10 +13,6 @@
{% wire id="admin_facebook" type="submit" postback="admin_facebook" %}
<form name="admin_facebook" id="admin_facebook" method="POST" action="postback">
- <div class="well">
- <button class="btn btn-primary" type="submit">{_ Save Facebook settings _}</button>
- </div>
-
<div class="widget">
<h3 class="widget-header">Facebook</h3>
<div class="widget-content">
@@ -41,6 +37,21 @@
<input type="text" id="scope" name="scope" value="{{ m.config.mod_facebook.scope.value|default:'email'|escape }}" class="span6" />
</div>
</div>
+
+ <div class="control-group">
+ <div class="controls">
+ <label class="checkbox" for="useauth">
+ <input type="checkbox" id="useauth" name="useauth" {% if m.config.mod_facebook.useauth.value %}checked="checked"{% endif %} value="1" />
+ {_ Use Facebook authentication _}
+ </label>
+ </div>
+ </div>
+
+ <div class="control-group">
+ <div class="controls">
+ <button class="btn btn-primary" type="submit">{_ Save Facebook Settings _}</button>
+ </div>
+ </div>
</div>
</div>
View
9 modules/mod_facebook/templates/mediaclass.config
@@ -0,0 +1,9 @@
+[
+ {"facebook-og", [
+ {width, 200},
+ {height, 200},
+ upscale,
+ {quality, 70},
+ {crop, center}
+ ]}
+].

0 comments on commit 9599650

Please sign in to comment.
Something went wrong with that request. Please try again.