<?php

/**
 * Snippet to implement a twitter share button.
 *
 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @package clearFusionCMS\module\social
 * @copyright Copyright (c) 2012 - 2013 clearFusionCMS. All rights reserved.
 * @link http://clearfusioncms.com
 */

/** @var $tplEngine cfTemplateEngine */
$link = isset($link) ? $link : $tplEngine->controller->getRequest()->getSelf(true);
$desc = isset($desc) ? 'data-text="' . str_replace('"', "'", $desc) . '"' : '';

echo '<div class="cfSocialTweet"><a href="https://twitter.com/share" class="twitter-share-button" data-count="vertical" data-lang="en" data-url="' . $link . '"' . $desc . '>Tweet</a></div>';
$tplEngine->getCodeBuffer()->requireCore()->bufferHeadJS('system/modules/social/js/social.js');
