/aamenu/code/trunk/administrator/components/com_aamenu/libraries/jxtended.php
PHP | 68 lines | 39 code | 7 blank | 22 comment | 8 complexity | 83d6c5d6a26e5455955c9267ff5fffb5 MD5 | raw file
- <?php
- /**
- * @version $Id: jxtended.php 255 2010-08-20 09:43:07Z eddieajau $
- * @package JXtended.Libraries
- * @subpackage plgSystemJXtended
- * @copyright Copyright (C) 2008 - 2009 JXtended, LLC. All rights reserved.
- * @license GNU General Public License <http://www.gnu.org/copyleft/gpl.html>
- * @link http://jxtended.com
- */
- defined('JPATH_BASE') or die;
- if (!defined('JX_LIBRARIES')) {
- define('JX_LIBRARIES', '1.0.9');
- }
- /**
- * JXtended intelligent file importer.
- *
- * @param string $path A dot syntax path.
- *
- * @return boolean True on success
- * @since 1.0.0
- */
- function jximport($path)
- {
- static $base;
- if (!$base) {
- $base = realpath(dirname(__FILE__));
- }
- if (strpos($path, 'jxtended') === 0) {
- return JLoader::import($path, $base, '');
- } else {
- return JLoader::import($path, null, 'libraries.');
- }
- }
- /**
- * JXtended JavaScript language string support function.
- *
- * @return void
- * @since 1.0.5
- */
- function jxjslanginject()
- {
- $app = JFactory::getApplication();
- $doc = JFactory::getDocument();
- if ($doc->getType() == 'html') {
- $lang = $app->get('jx.jslang', array());
- if (!empty($lang)) {
- $txt = '{';
- foreach ($lang as $k => $v)
- {
- $txt .= $k.':"'.$v.'",';
- }
- if (strlen($txt) > 1) {
- $txt = substr($txt, 0, strlen($txt) - 1);
- }
- $txt .= '}';
- $doc->addScriptDeclaration(' JXLang='.$txt.';');
- }
- }
- }
- $dispatcher = JDispatcher::getInstance();
- $dispatcher->register('onAfterDispatch', 'jxjslanginject');