From edeae898f6d6bbe4fbcbe89079e1f7f7c13abf70 Mon Sep 17 00:00:00 2001 From: Silvio Date: Fri, 30 Mar 2012 16:20:06 -0300 Subject: Initial view support (upstream #1121906) --- fblikebutton.handlers.inc | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 fblikebutton.handlers.inc (limited to 'fblikebutton.handlers.inc') diff --git a/fblikebutton.handlers.inc b/fblikebutton.handlers.inc new file mode 100644 index 0000000..aeb40a3 --- /dev/null +++ b/fblikebutton.handlers.inc @@ -0,0 +1,51 @@ +field_alias = 'views_fblikebutton_button_' . $this->position; + } + + /** + * Renders the field. + */ + function render($values) { + if (isset($values->nid)) { + global $user, $base_url; + $types = variable_get('fblikebutton_node_types', array()); + $fullnodedisplay = variable_get('fblikebutton_full_node_display', 0); + $teaserdisplay = variable_get('fblikebutton_teaser_display', 0); + $full = ($view_mode == 'full') ? TRUE : FALSE; + $show = ( ! empty($types[$values->type]) && user_access('access fblikebutton')); + // Thanks to corbacho for supplying the code for the $webpage_to_like variable... + // (It was apparently throwing errors/notices the way I had it set up.) + $webpage_to_like = url("node/$values->nid", array('absolute' => TRUE)); + $likebutton_weight = variable_get('fblikebutton_weight', '0'); + $conf = array( + 'layout' => variable_get('fblikebutton_layout', 'standard'), + 'action' => variable_get('fblikebutton_action', 'like'), + 'color_scheme' => variable_get('fblikebutton_color_scheme', 'light'), + 'show_faces' => variable_get('fblikebutton_show_faces', 'true'), + 'font' => variable_get('fblikebutton_font', 'arial'), + 'height' => variable_get('fblikebutton_iframe_height', '80'), + 'width' => variable_get('fblikebutton_iframe_width', '450'), + 'send' => variable_get('fblikebutton_send', 'true'), + 'other_css' => variable_get('fblikebutton_iframe_css', ''), + 'language' => variable_get('fblikebutton_language', 'en_US'), + ); + + return _fblikebutton_field($webpage_to_like, $conf); + } + } +} -- cgit v1.2.3