<?php

/**
 * Snippet to include JavaScript onto a page.
 *
 * 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\snippet\javascript
 * @copyright Copyright (c) 2012 - 2016 clearFusionCMS. All rights reserved.
 * @link http://clearfusioncms.com
 */

/* @var $tplEngine cfTemplateEngine */

// If including jQuery
if(isset($jQuery)) $tplEngine->getCodeBuffer()->includeJQuery();

// If JavaScript file given
if(isset($src)) {
	if (isset($body) && $body)
		$tplEngine->getCodeBuffer()->bufferBodyJS($src);
	else
		$tplEngine->getCodeBuffer()->bufferHeadJS($src);
}

// Include core JS libs
if(isset($core)) $tplEngine->getCodeBuffer()->requireCore();
