joomla/joomla-cms — pull request #1550 by wilsonge (2013-07-16 00:09:24+00:00)
Title: Start a JLayout Social

This starts the process of making some features not already in the CMS available as JLayouts. This starts with:
* Facebook Like
* Twitter Share
* Twitter Follow
* Google +1

## Screenshot
![image](https://f.cloud.github.com/assets/1986000/801702/e531a0c8-eda8-11e2-8032-e401b9481fcc.png)

## Layout Params
### Google+1
* **data-size** *small, medium, standard, tall* Size of the icon - default standard.
* **data-annotation** *inline, bubble, none* The style of annotation to appear - default inline.

### Facebook Like
* **appid** *integer* The appid if one exists for the like to link with
* **data-href** *URL* The URL for the like to link to. By default the current URL (JUri::current())
* **data-width** *integer* The width of the icon - default 450
* **data-show-faces** *true/false* Shows the faces of others who have liked the page. Default true.
* **data-layout** *standard, button_count, box_count* Layout of button. Default standard.
* **data-action** *'empty attribute'/like, recommend* Verb for the button. Default empty (which is "like").
* **data-colorscheme** *light, dark* Color scheme. Default like

### Twitter
#### Share
To be written up (see code for now)

#### Follow
To be written up (see code for now)

## Issues
* A new language file is created as the twitter follow view requires a user, so I'm creating a JLog event if one isn't specified. When the twitter hashtag one gets created clearly that requires a hashtag as well which will need to generate a similar error message. Is my language file in the correct location and got a suitable naming scheme??
* The JS created by these layouts is still duplicated. FB wants part of their script at the top of the page just beneath the body tag, Google wants it's JS beneath the last instance of calling the tag. I simply ignored this
* @infograf768 might want to comment on how to get the language of the google +1 button to be consistent. Currently I've made it the standard en-GB but other options are alternative (see https://developers.google.com/+/web/+1button/ ) Should this just be an option in an array or something else? I can't find anything for facebook or twitter - is this universal?

## Testers
* Check multiple instances of each icon work
* Check each icon work
* Check parameters work as expected

Suggested code:

$layout = new JLayoutFile('social.google');
echo $layout->render(array());
$layout2 = new JLayoutFile('social.twitter.share');
echo $layout2->render(array());
$layout3 = new JLayoutFile('social.facebook');
echo $layout3->render(array());
$layout4 = new JLayoutFile('social.twitter.follow;);
echo $layout4->render(array('user'=>'GW1992')); // or similar for a twitter username (please don't spam mine :P)