joomla/joomla-cms — pull request #5252 by wilsonge (2014-11-29 22:55:14+00:00)
Title: Create JLayout's for common social buttons

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
* Twitter Hashtag
* Twitter Mention
* Google +1

Tracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=31516
Note this is the same PR as https://github.com/joomla/joomla-cms/pull/1550 except targeted at staging instead of master

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

Note including them in articles is ***NOT*** included in this PR - this is just demonstrating their use

## 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.
* **data-width** *integer* The width of the icon - default 300
* **data-href** *URL* The URL for the like to link to. By default the current URL (JUri::current())
* **show-count** *true/false* Show/Hide the number of people who have +1'd the page
* **language** *Language string recognized by google* Defaults to the locale according to the language (https://github.com/joomla/joomla-cms/blob/master/libraries/joomla/language/language.php#L1213).

### 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
* **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
* **language** *Language string recognized by fb* Defaults to the locale according to the language (https://github.com/joomla/joomla-cms/blob/master/libraries/joomla/language/language.php#L1213).

### Twitter
#### Follow
* **show-count** *true/false* Show the number of users followed. Default false
* **user** *Valid Twitter user* The user for twitter. If not entered will give a JLog priority warning.

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

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

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

## Issues
* Is my new language file in a good location and with a good name?
* Twitter hashtag langs don't seem to work at the moment (the other twitter views do)
* Is the location of the social layouts package in a good place?

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

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)