<?php

$facebook_enabled = get_option('facebook_enabled', $params['id']) == 'y';

$twitter_enabled = get_option('twitter_enabled', $params['id']) == 'y';

$googleplus_enabled = get_option('googleplus_enabled', $params['id']) == 'y';

$pinterest_enabled = get_option('pinterest_enabled', $params['id']) == 'y';

if ($facebook_enabled == 'y') {
    $facebook_enabled = true;
}

if ($twitter_enabled == 'y') {
    $twitter_enabled = true;
}

if ($googleplus_enabled == 'y') {
    $googleplus_enabled = true;
}

if ($pinterest_enabled == 'y') {
    $pinterest_enabled = true;
}

?>


    <div class="share-icons section">
        <span>share :</span>
        <?php if ($facebook_enabled) { ?>
            <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=<?php print mw()->url->current(); ?>" target="_blank"><i class="fa fa-facebook"></i></a>
        <?php } ?>

        <?php if ($twitter_enabled) { ?>
            <a href="https://twitter.com/intent/tweet?text=<?php print content_title(); ?>&url=<?php print mw()->url->current(); ?>" target="_blank"><i class="fa fa-twitter"></i></a>
        <?php } ?>

        <?php if ($googleplus_enabled) { ?>
            <a href="https://plus.google.com/share?url=<?php print mw()->url->current(); ?>" target="_blank"><i class="fa fa-google-plus"></i></a>
        <?php } ?>

        <?php if ($pinterest_enabled) { ?>
            <script type="text/javascript">
                if (!mw.pinMarklet) {
                    mw.pinMarklet = function () {
                        var script = mwd.createElement('script');
                        script.src = '//assets.pinterest.com/js/pinmarklet.js';
                        mwd.body.appendChild(script)
                    }
                }
            </script>

            <a href="javascript:mw.pinMarklet();" target="_self"><i class="fa fa-pinterest"></i></a>
        <?php } ?>
    </div>

<?php if ($facebook_enabled == '' AND $twitter_enabled == '' AND $googleplus_enabled == '' AND $pinterest_enabled == '') {
    print lnotif('Click here to edit Social Media Share');
}
?>