Spade

Mini Shell

Directory:~$ /home/lmsyaran/public_html/joomla4/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ /home/lmsyaran/public_html/joomla4/template.tar

clean-cont.php000064400000004021151160230110007263 0ustar00<?php
/**
 * mod_vertical_menu - Vertical Menu
 *
 * @author    Balint Polgarfi
 * @copyright 2014-2019 Offlajn.com All Rights Reserved
 * @license   https://gnu.org/licenses/gpl-2.0.html
 * @link      https://offlajn.com
 */

 defined('_JEXEC') or die('Restricted access'); ?>
<nav id="<?php echo $module->instanceid ?>"
class="<?php echo $module->instanceid ?> sm-menu <?php
echo $params->get('moduleclass_sfx', '');
?>">
  <?php if (preg_match('~\.(jpe?g|png|gif|bmp|svg)$~i',
$params->get('logo'))): ?>
  <div class="sm-logo"
style="position:relative">
    <img src="<?php echo rtrim(JURI::root(true),
'/').preg_replace('~^.*?(/images/)~', '$1',
$params->get('logo')) ?>" alt="logo" />
	</div>
  <?php endif ?>
  <?php if ($params->get('show_modulepos')): ?>
    <div class="sm-modpos <?php echo
$params->get('top_module') ?>"
style="position:relative">
      <div class="sm-postag">module-position</div>
      <div class="sm-posname"><?php echo
$params->get('top_module') ?></div>
    </div>
  <?php endif ?>
  <?php if (count($modules =
JModuleHelper::getModules($params->get('top_module')))): //
TOP MODULEPOS ?>
    <div class="<?php echo
$params->get('top_module') ?>"
style="position:relative">
    <?php foreach ($modules as $m): ?>
      <?php echo JModuleHelper::renderModule($m) ?>
    <?php endforeach ?>
    </div>
  <?php endif ?>
  <?php if ($module->showtitle): ?>
  <h3 class="sm-head">
    <span class="sm-back sm-arrow" title="<?php echo
JText::_('JPREV') ?>"></span>
    <span class="sm-title"><?php echo $module->title
?></span><?php if ($params->get('forcestyle', 1))
$module->title='' ?>
  </h3>
  <?php endif; ?>
  <?php if ($filter[0] &&
strpos($params->get('position'), 'overlay') ===
false): ?>
  <div class="sm-filter-cont">
    <input class="sm-filter" type="text"
placeholder="<?php echo JText::_($filter[3] ? $filter[3] :
'JSEARCH_FILTER_LABEL') ?>" />
		<div class="sm-reset"></div>
  </div>
  <?php endif; ?>
  <div class="sm-levels">
    <?php $menu->render($tmpl) ?>
  </div>
</nav>clean.php000064400000006257151160230110006337 0ustar00<?php
/**
 * mod_vertical_menu - Vertical Menu
 *
 * @author    Balint Polgarfi
 * @copyright 2014-2019 Offlajn.com All Rights Reserved
 * @license   https://gnu.org/licenses/gpl-2.0.html
 * @link      https://offlajn.com
 */

defined('_JEXEC') or die('Restricted access');

if($item->fib){
  $this->stack[] = $item->parent;
  $this->level = count($this->stack);
}
if($this->up){
  while($this->level > $item->level){ ?>
    </dl></div></dd><?php
    array_pop($this->stack);
    $this->level = count($this->stack);
  }
  $this->up = false;
}

$classes = array('level'.$this->level,
'off-nav-'.$item->id, $item->p ? "parent" :
"notparent");
if($item->opened) $classes[] = 'opened';
if($item->active) $classes[] = 'active';
if(isset($this->openedlevels[$this->level]) && $item->p)
$classes[] = 'opened forceopened';
if($item->fib) $classes[] = 'first';
if($item->lib) $classes[] = 'last';
$classes = implode(' ', $classes);

if($item->fib): ?>
<div class="sm-level level<?php echo $this->level
?>"><dl class="level<?php echo $this->level
?>">
<?php endif; ?>
<?php if (isset($item->modpos)): ?>
  <?php $parId = !empty($item->parent_id) ? $item->parent_id :
$item->parent->id; ?>
  <?php $modpos = $item->level == 1 ?
$this->_params->get('bottom_module') :
$this->_params->get('custom_module',
'sm-').$parId ?>
  <?php if ($this->_params->get('show_modulepos')):
?>
    <dt class="sm-modpos <?php echo $modpos ?>">
      <div class="sm-postag">module-position</div>
      <div class="sm-posname"><?php echo $modpos
?></div>
    </dt><dd></dd>
  <?php endif ?>
  <?php if (count($modules = JModuleHelper::getModules($modpos))): //
custom MODULEPOS ?>
    <dt class="sm-mod <?php echo $modpos ?>">
    <?php foreach ($modules as $m): ?>
      <?php echo JModuleHelper::renderModule($m) ?>
    <?php endforeach ?>
    </dt><dd></dd>
  <?php endif ?>
<?php else: ?>
  <dt class="<?php echo $classes ?>">
    <?php if (!empty($item->image)): ?>
    <div class="sm-icon">
      <?php $resize =
OfflajnParser::parse($this->_params->get('resizeicon'))
?>
      <?php if ($resize[0]): ?>
        <?php $imgpath =
JPATH_SITE.'/'.str_replace(JURI::root(), '',
$item->image); ?>
        <img src="<?php echo
$this->imageCache->generateImage($imgpath, $resize[2][0],
$resize[3][0], $resize[4]) ?>" alt=""
ondragstart="return false" />
      <?php else: ?>
        <img src="<?php echo $item->image ?>"
alt="" ondragstart="return false" />
      <?php endif ?>
    </div>
    <?php endif ?>
    <div class="inner">
      <div class="link"><a data-text="<?php echo
$item->title ?>" <?php empty($item->anchorAttr) or print
$item->anchorAttr ?>><?php echo
$item->title.(!empty($item->badge) ? $item->badge : '')
?></a><?php empty($item->number) or print $item->number
?></div>
      <?php if (!empty($item->description)): ?>
      <p class="desc"><?php echo $item->description
?></p>
      <?php endif ?>
    </div>
  </dt>
  <dd class="<?php echo $classes ?>">
    <?php if($item->p): $this->renderItem(); else: ?>
  </dd>
  <?php endif; ?>
<?php endif; ?>
<?php
if($item->lib):
  $this->up = true; ?>
  <?php if($item->level == 1): ?>
</dl></div>
  <?php endif; ?>
<?php endif; ?>default-cont.php000064400000003754151160230110007641
0ustar00<?php
/**
 * mod_vertical_menu - Vertical Menu
 *
 * @author    Balint Polgarfi
 * @copyright 2014-2019 Offlajn.com All Rights Reserved
 * @license   https://gnu.org/licenses/gpl-2.0.html
 * @link      https://offlajn.com
 */

 defined('_JEXEC') or die('Restricted access'); ?>
<nav id="<?php echo $module->instanceid ?>"
class="<?php echo $module->instanceid ?> sm-menu <?php
echo $params->get('moduleclass_sfx', '');
?>">
  <?php if (preg_match('~\.(jpe?g|png|gif|bmp|svg)$~i',
$params->get('logo'))): ?>
  <div class="sm-logo">
    <img src="<?php echo rtrim(JURI::root(true),
'/').preg_replace('~^.*?(/images/)~', '$1',
$params->get('logo')) ?>" alt="logo" />
  </div>
  <?php endif ?>
  <?php if ($params->get('show_modulepos')): ?>
    <div class="sm-modpos <?php echo
$params->get('top_module') ?>">
      <div class="sm-postag">module-position</div>
      <div class="sm-posname"><?php echo
$params->get('top_module') ?></div>
    </div>
  <?php endif ?>
  <?php if (count($modules =
JModuleHelper::getModules($params->get('top_module')))): //
TOP MODULEPOS ?>
    <div class="<?php echo
$params->get('top_module') ?>">
    <?php foreach ($modules as $m): ?>
      <?php echo JModuleHelper::renderModule($m) ?>
    <?php endforeach ?>
    </div>
  <?php endif ?>
  <?php if ($module->showtitle): ?>
  <h3 class="sm-head">
    <span class="sm-title"><?php echo $module->title
?></span><?php if ($params->get('forcestyle', 1))
$module->title='' ?>
  </h3>
  <?php endif ?>
  <?php if ($filter[0] &&
strpos($params->get('position'), 'overlay') ===
false): ?>
	<div class="sm-filter-cont">
		<input id="sm-filter-<?php echo $module->id ?>"
class="sm-filter" type="text"
placeholder="<?php echo JText::_($filter[3] ? $filter[3] :
'JSEARCH_FILTER_LABEL') ?>" value="" />
		<label for="sm-filter-<?php echo $module->id ?>"
class="sm-search"></label>
		<div class="sm-reset"></div>
	</div>
  <?php endif; ?>
  <div class="sm-levels">
    <?php $menu->render($tmpl) ?>
  </div>
</nav>flat.php000064400000006262151160230110006177 0ustar00<?php
/**
 * mod_vertical_menu - Vertical Menu
 *
 * @author    Balint Polgarfi
 * @copyright 2014-2019 Offlajn.com All Rights Reserved
 * @license   https://gnu.org/licenses/gpl-2.0.html
 * @link      https://offlajn.com
 */

defined('_JEXEC') or die('Restricted access');

if($item->fib){
  $this->stack[] = $item->parent;
  $this->level = count($this->stack);
}
if($this->up){
  while($this->level > $item->level){ ?>
    </dl></div></dd><?php
    array_pop($this->stack);
    $this->level = count($this->stack);
  }
  $this->up = false;
}

$classes = array('level'.$this->level,
'off-nav-'.$item->id, $item->p ? "parent" :
"notparent");
if($item->opened) $classes[] = 'opened';
if($item->active) $classes[] = 'active';
if(isset($this->openedlevels[$this->level]) && $item->p)
$classes[] = 'opened forceopened';
if($item->fib) $classes[] = 'first';
if($item->lib) $classes[] = 'last';
$classes = implode(' ', $classes);

if($item->fib): ?>
<div class="sm-level level<?php echo $this->level
?>"><dl class="level<?php echo $this->level
?>">
<?php endif; ?>
<?php if (isset($item->modpos)): ?>
 <?php $parId = !empty($item->parent_id) ? $item->parent_id :
$item->parent->id; ?>
  <?php $modpos = $item->level == 1 ?
$this->_params->get('bottom_module') :
$this->_params->get('custom_module',
'sm-').$parId ?>
  <?php if ($this->_params->get('show_modulepos')):
?>
    <dt class="sm-modpos <?php echo $modpos ?>">
      <div class="sm-postag">module-position</div>
      <div class="sm-posname"><?php echo $modpos
?></div>
    </dt><dd></dd>
  <?php endif ?>
  <?php if (count($modules = JModuleHelper::getModules($modpos))): //
custom MODULEPOS ?>
    <dt class="sm-mod <?php echo $modpos ?>">
    <?php foreach ($modules as $m): ?>
      <?php echo JModuleHelper::renderModule($m) ?>
    <?php endforeach ?>
    </dt><dd></dd>
  <?php endif ?>
<?php else: ?>
  <dt class="<?php echo $classes ?>">
    <?php if (!empty($item->image)): ?>
    <div class="sm-icon">
      <?php $resize =
OfflajnParser::parse($this->_params->get('resizeicon'))
?>
      <?php if ($resize[0]): ?>
        <?php $imgpath =
JPATH_SITE.'/'.str_replace(JURI::root(), '',
$item->image); ?>
        <img src="<?php echo
$this->imageCache->generateImage($imgpath, $resize[2][0],
$resize[3][0], $resize[4]) ?>" alt=""
ondragstart="return false" />
      <?php else: ?>
        <img src="<?php echo $item->image ?>"
alt="" ondragstart="return false" />
      <?php endif ?>
    </div>
    <?php endif ?>
    <div class="inner">
      <div class="link"><a data-text="<?php echo
$item->title ?>" <?php empty($item->anchorAttr) or print
$item->anchorAttr ?>><?php echo
$item->title.(!empty($item->badge) ? $item->badge : '')
?></a><?php empty($item->number) or print $item->number
?></div>
      <?php if (!empty($item->description)): ?>
      <p class="desc"><?php echo $item->description
?></p>
      <?php endif ?>
    </div>
  </dt>
  <dd class="<?php echo $classes ?>">
    <?php if($item->p): $this->renderItem();
    else: ?>
  </dd>
  <?php endif; ?>
<?php endif ?>
<?php
if($item->lib):
  $this->up = true; ?>
  <?php if($item->level == 1): ?>
</dl></div>
  <?php endif; ?>
<?php endif; ?>index.html000064400000000054151160230110006526
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>rounded-cont.php000064400000007314151160230110007651
0ustar00<?php
/**
 * mod_vertical_menu - Vertical Menu
 *
 * @author    Balint Polgarfi
 * @copyright 2014-2019 Offlajn.com All Rights Reserved
 * @license   https://gnu.org/licenses/gpl-2.0.html
 * @link      https://offlajn.com
 */

 defined('_JEXEC') or die('Restricted access');

if (!isset($GLOBALS['sm-sym'])) $GLOBALS['sm-sym'] =
array();
$lvl = 0;
$sym = array();
while ($plus =
$params->get('level'.(++$lvl).'plus')) {
  $svg =
__DIR__.'/../themes/rounded/images/arrows/'.basename(OfflajnParser::parse($plus)[0]);
  if (file_exists($svg) &&
empty($GLOBALS['sm-sym'][$svg])) {
    $GLOBALS['sm-sym'][$svg] = true;
    $xml = JFactory::getXML($svg)->asFormattedXML(true);
    $sym[$svg] = '<symbol id="sym-'.basename($svg,
'.svg').'"' . substr($xml, 4, -4) .
'symbol>';
  }
}
empty($sym) or JFactory::getDocument()->addCustomTag('<svg
height="0"
style="position:absolute">'.implode('',
$sym).'</svg>');
?>
<nav id="<?php echo $module->instanceid ?>"
class="<?php echo $module->instanceid ?> sm-menu <?php
echo $params->get('moduleclass_sfx', '');
?>">
  <?php if (preg_match('~\.(jpe?g|png|gif|bmp|svg)$~i',
$params->get('logo'))): ?>
  <div class="sm-logo"
style="position:relative">
    <img src="<?php echo rtrim(JURI::root(true),
'/').preg_replace('~^.*?(/images/)~', '$1',
$params->get('logo')) ?>" alt="logo" />
  </div>
  <?php endif ?>
  <?php if ($params->get('show_modulepos')): ?>
    <div class="sm-modpos <?php echo
$params->get('top_module') ?>"
style="position:relative">
      <div class="sm-postag">module-position</div>
      <div class="sm-posname"><?php echo
$params->get('top_module') ?></div>
    </div>
  <?php endif ?>
  <?php if (count($modules =
JModuleHelper::getModules($params->get('top_module')))): //
TOP MODULEPOS ?>
    <div class="<?php echo
$params->get('top_module') ?>"
style="position:relative">
    <?php foreach ($modules as $m): ?>
      <?php echo JModuleHelper::renderModule($m) ?>
    <?php endforeach ?>
    </div>
  <?php endif ?>
  <?php $x = OfflajnParser::parse($params->get('xicon'),
'0|*|#666666|*|right') ?>
  <?php if ($x[0]): ?>
    <div class="sm-x" style="color:<?php echo $x[1]
?>; <?php echo $x[2] ?>:10px;"></div>
  <?php endif ?>
  <?php if ($module->showtitle): ?>
  <h3 class="sm-head">
    <?php
      $icon =
__DIR__.'/../themes/rounded/images/back/'.basename($params->get('backicon',
'go-back.svg'));
      if (file_exists($icon)) {
        $svg = JFactory::getXML($icon);
        $svg->addAttribute('class', 'sm-back
sm-arrow');
        $svg->addAttribute('title',
JText::_('JPREV'));
        echo $svg->asFormattedXML(true);
      }
    ?>
    <span class="sm-title"><?php echo $module->title
?></span><?php if ($params->get('forcestyle', 1))
$module->title='' ?>
  </h3>
  <?php endif; ?>
  <?php if ($filter[0] &&
strpos($params->get('position'), 'overlay') ===
false): ?>
  <div class="sm-filter-cont">
    <?php
      $icon =
__DIR__.'/../themes/rounded/images/filter/'.basename($params->get('filtericon',
'search.svg'));
      if (file_exists($icon)) {
        $svg = JFactory::getXML($icon);
        $svg->addAttribute('class',
'sm-filter-icon');
        echo $svg->asFormattedXML(true);
      }
    ?>
    <input class="sm-filter" type="text"
placeholder="<?php echo JText::_($filter[3] ? $filter[3] :
'JSEARCH_FILTER_LABEL') ?>" />
    <?php
      $icon =
__DIR__.'/../themes/rounded/images/reset/'.basename($params->get('reseticon',
'close.svg'));
      if (file_exists($icon)) {
        $svg = JFactory::getXML($icon);
        $svg->addAttribute('class', 'sm-reset');
        echo $svg->asFormattedXML(true);
      }
    ?>
  </div>
  <?php endif; ?>
  <div class="sm-levels">
    <?php $menu->render($tmpl) ?>
  </div>
</nav>rounded.php000064400000007621151160230110006711
0ustar00<?php
/**
 * mod_vertical_menu - Vertical Menu
 *
 * @author    Balint Polgarfi
 * @copyright 2014-2019 Offlajn.com All Rights Reserved
 * @license   https://gnu.org/licenses/gpl-2.0.html
 * @link      https://offlajn.com
 */

defined('_JEXEC') or die('Restricted access');

if($item->fib){
  $this->stack[] = $item->parent;
  $this->level = count($this->stack);
}
if($this->up){
  while($this->level > $item->level){ ?>
    </dl></div></dd><?php
    array_pop($this->stack);
    $this->level = count($this->stack);
  }
  $this->up = false;
}

$classes = array('level'.$this->level,
'off-nav-'.$item->id, $item->p ? "parent" :
"notparent");
if($item->opened) $classes[] = 'opened';
if($item->active) $classes[] = 'active';
if(isset($this->openedlevels[$this->level]) && $item->p)
$classes[] = 'opened forceopened';
if($item->fib) $classes[] = 'first';
if($item->lib) $classes[] = 'last';
$classes = implode(' ', $classes);

if($item->fib): ?>
<div class="sm-level level<?php echo $this->level
?>"><dl class="level<?php echo $this->level
?>">
<?php endif; ?>
<?php if (isset($item->modpos)): ?>
  <?php $parId = !empty($item->parent_id) ? $item->parent_id :
$item->parent->id; ?>
  <?php $modpos = $item->level == 1 ?
$this->_params->get('bottom_module') :
$this->_params->get('custom_module',
'sm-').$parId ?>
  <?php if ($this->_params->get('show_modulepos')):
?>
    <dt class="sm-modpos <?php echo $modpos ?>">
      <div class="sm-postag">module-position</div>
      <div class="sm-posname"><?php echo $modpos
?></div>
    </dt><dd></dd>
  <?php endif ?>
  <?php if (count($modules = JModuleHelper::getModules($modpos))): //
custom MODULEPOS ?>
    <dt class="sm-mod <?php echo $modpos ?>">
    <?php foreach ($modules as $m): ?>
      <?php echo JModuleHelper::renderModule($m) ?>
    <?php endforeach ?>
    </dt><dd></dd>
  <?php endif ?>
<?php else: ?>
  <dt class="<?php echo $classes ?>">
    <?php $arrow =
OfflajnParser::parse($this->_params->get('level'.$this->level.'plus',
'/modules/mod_vertical_menu/themes/rounded/images/arrows/default_right.png|*|right|*|20||px|*|#4e7676|*|#4e7676|*|#4e7676'))
?>
    <?php if ($arrow[1] == 'left') : ?>
    <div class="sm-arrow">
      <?php if ($item->p && substr($arrow[0], -1) !=
'/') : ?><svg><use xlink:href="#sym-<?php
echo substr(basename($arrow[0]), 0, -4)
?>"/></svg><?php endif ?>
    </div>
    <?php endif ?>
    <?php if (!empty($item->image)): ?>
    <div class="sm-icon">
      <?php $resize =
OfflajnParser::parse($this->_params->get('resizeicon'))
?>
      <?php if ($resize[0]): ?>
        <?php $imgpath =
JPATH_SITE.'/'.str_replace(JURI::root(), '',
$item->image); ?>
        <img src="<?php echo
$this->imageCache->generateImage($imgpath, $resize[2][0],
$resize[3][0], $resize[4]) ?>" alt=""
ondragstart="return false" />
      <?php else: ?>
        <img src="<?php echo $item->image ?>"
alt="" ondragstart="return false" />
      <?php endif ?>
    </div>
    <?php endif ?>
    <div class="inner">
      <div class="link"><a data-text="<?php echo
$item->title ?>" <?php empty($item->anchorAttr) or print
$item->anchorAttr ?>><?php echo
$item->title.(!empty($item->badge) ? $item->badge : '')
?></a><?php empty($item->number) or print $item->number
?></div>
      <?php if (!empty($item->description)): ?>
      <p class="desc"><?php echo $item->description
?></p>
      <?php endif ?>
    </div>
    <?php if ($arrow[1] == 'right') : ?>
    <div class="sm-arrow">
      <?php if ($item->p && substr($arrow[0], -1) !=
'/') : ?><svg><use xlink:href="#sym-<?php
echo basename($arrow[0], '.svg')
?>"/></svg><?php endif ?>
    </div>
    <?php endif ?>
  </dt>
  <dd class="<?php echo $classes ?>">
    <?php if($item->p): $this->renderItem(); else: ?>
  </dd>
  <?php endif; ?>
<?php endif; ?>
<?php
if($item->lib):
  $this->up = true; ?>
  <?php if($item->level == 1): ?>
</dl></div>
  <?php endif; ?>
<?php endif; ?>utils.php000064400000034465151160472610006434
0ustar00<?php
/**
 * @package     FrameworkOnFramework
 * @subpackage  template
 * @copyright   Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba
Ltd. All rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 * @note        This file has been modified by the Joomla! Project and no
longer reflects the original work of its author.
 */

// Protect from unauthorized access
defined('FOF_INCLUDED') or die;

/**
 * A utility class to load view templates, media files and modules.
 *
 * @package  FrameworkOnFramework
 * @since    1.0
 */
class FOFTemplateUtils
{
	/**
	 * Add a CSS file to the page generated by the CMS
	 *
	 * @param   string  $path  A fancy path definition understood by parsePath
	 *
	 * @see FOFTemplateUtils::parsePath
	 *
	 * @return  void
	 */
	public static function addCSS($path)
	{
		$document = FOFPlatform::getInstance()->getDocument();

		if ($document instanceof JDocument)
		{
			if (method_exists($document, 'addStyleSheet'))
			{
				$url = self::parsePath($path);
				$document->addStyleSheet($url);
			}
		}
	}

	/**
	 * Add a JS script file to the page generated by the CMS.
	 *
	 * There are three combinations of defer and async (see
http://www.w3schools.com/tags/att_script_defer.asp):
	 * * $defer false, $async true: The script is executed asynchronously with
the rest of the page
	 *   (the script will be executed while the page continues the parsing)
	 * * $defer true, $async false: The script is executed when the page has
finished parsing.
	 * * $defer false, $async false. (default) The script is loaded and
executed immediately. When it finishes
	 *   loading the browser continues parsing the rest of the page.
	 *
	 * When you are using $defer = true there is no guarantee about the load
order of the scripts. Whichever
	 * script loads first will be executed first. The order they appear on the
page is completely irrelevant.
	 *
	 * @param   string   $path   A fancy path definition understood by
parsePath
	 * @param   boolean  $defer  Adds the defer attribute, meaning that your
script
	 *                           will only load after the page has finished
parsing.
	 * @param   boolean  $async  Adds the async attribute, meaning that your
script
	 *                           will be executed while the rest of the page
	 *                           continues parsing.
	 *
	 * @see FOFTemplateUtils::parsePath
	 *
	 * @return  void
	 */
	public static function addJS($path, $defer = false, $async = false)
	{
		$document = FOFPlatform::getInstance()->getDocument();

		if ($document instanceof JDocument)
		{
			if (method_exists($document, 'addScript'))
			{
				$url = self::parsePath($path);
				$document->addScript($url, "text/javascript", $defer,
$async);
			}
		}
	}

	/**
	 * Compile a LESS file into CSS and add it to the page generated by the
CMS.
	 * This method has integrated cache support. The compiled LESS files will
be
	 * written to the media/lib_fof/compiled directory of your site. If the
file
	 * cannot be written we will use the $altPath, if specified
	 *
	 * @param   string   $path        A fancy path definition understood by
parsePath pointing to the source LESS file
	 * @param   string   $altPath     A fancy path definition understood by
parsePath pointing to a precompiled CSS file,
	 *                                used when we can't write the
generated file to the output directory
	 * @param   boolean  $returnPath  Return the URL of the generated CSS file
but do not include it. If it can't be
	 *                                generated, false is returned and the alt
files are not included
	 *
	 * @see FOFTemplateUtils::parsePath
	 *
	 * @since 2.0
	 *
	 * @return  mixed  True = successfully included generated CSS, False = the
alternate CSS file was used, null = the source file does not exist
	 */
	public static function addLESS($path, $altPath = null, $returnPath =
false)
	{
		// Does the cache directory exists and is writeable
		static $sanityCheck = null;

		// Get the local LESS file
		$localFile = self::parsePath($path, true);

		$filesystem   =
FOFPlatform::getInstance()->getIntegrationObject('filesystem');
        $platformDirs =
FOFPlatform::getInstance()->getPlatformBaseDirs();

		if (is_null($sanityCheck))
		{
			// Make sure the cache directory exists
			if (!is_dir($platformDirs['public'] .
'/media/lib_fof/compiled/'))
			{
				$sanityCheck =
$filesystem->folderCreate($platformDirs['public'] .
'/media/lib_fof/compiled/');
			}
			else
			{
				$sanityCheck = true;
			}
		}

		// No point continuing if the source file is not there or we can't
write to the cache

		if (!$sanityCheck || !is_file($localFile))
		{
			if (!$returnPath)
			{
				if (is_string($altPath))
				{
					self::addCSS($altPath);
				}
				elseif (is_array($altPath))
				{
					foreach ($altPath as $anAltPath)
					{
						self::addCSS($anAltPath);
					}
				}
			}

			return false;
		}

		// Get the source file's unique ID
		$id = md5(filemtime($localFile) . filectime($localFile) . $localFile);

		// Get the cached file path
		$cachedPath = $platformDirs['public'] .
'/media/lib_fof/compiled/' . $id . '.css';

		// Get the LESS compiler
		$lessCompiler = new FOFLess;
		$lessCompiler->formatterName = 'compressed';

		// Should I add an alternative import path?
		$altFiles = self::getAltPaths($path);

		if (isset($altFiles['alternate']))
		{
			$currentLocation = realpath(dirname($localFile));
			$normalLocation = realpath(dirname($altFiles['normal']));
			$alternateLocation =
realpath(dirname($altFiles['alternate']));

			if ($currentLocation == $normalLocation)
			{
				$lessCompiler->importDir = array($alternateLocation,
$currentLocation);
			}
			else
			{
				$lessCompiler->importDir = array($currentLocation, $normalLocation);
			}
		}

		// Compile the LESS file
		$lessCompiler->checkedCompile($localFile, $cachedPath);

		// Add the compiled CSS to the page
		$base_url = rtrim(FOFPlatform::getInstance()->URIbase(),
'/');

		if (substr($base_url, -14) == '/administrator')
		{
			$base_url = substr($base_url, 0, -14);
		}

		$url = $base_url . '/media/lib_fof/compiled/' . $id .
'.css';

		if ($returnPath)
		{
			return $url;
		}
		else
		{
			$document = FOFPlatform::getInstance()->getDocument();

			if ($document instanceof JDocument)
			{
				if (method_exists($document, 'addStyleSheet'))
				{
					$document->addStyleSheet($url);
				}
			}
			return true;
		}
	}

	/**
	 * Creates a SEF compatible sort header. Standard Joomla function will add
a href="#" tag, so with SEF
	 * enabled, the browser will follow the fake link instead of processing
the onSubmit event; so we
	 * need a fix.
	 *
	 * @param   string          $text   Header text
	 * @param   string          $field  Field used for sorting
	 * @param   FOFUtilsObject  $list   Object holding the direction and the
ordering field
	 *
	 * @return  string  HTML code for sorting
	 */
	public static function sefSort($text, $field, $list)
	{
		$sort = JHTML::_('grid.sort', JText::_(strtoupper($text)) .
'&nbsp;', $field, $list->order_Dir, $list->order);

		return str_replace('href="#"',
'href="javascript:void(0);"', $sort);
	}

	/**
	 * Parse a fancy path definition into a path relative to the site's
root,
	 * respecting template overrides, suitable for inclusion of media files.
	 * For example, media://com_foobar/css/test.css is parsed into
	 * media/com_foobar/css/test.css if no override is found, or
	 * templates/mytemplate/media/com_foobar/css/test.css if the current
	 * template is called mytemplate and there's a media override for it.
	 *
	 * The valid protocols are:
	 * media://		The media directory or a media override
	 * admin://		Path relative to administrator directory (no overrides)
	 * site://		Path relative to site's root (no overrides)
	 *
	 * @param   string   $path       Fancy path
	 * @param   boolean  $localFile  When true, it returns the local path, not
the URL
	 *
	 * @return  string  Parsed path
	 */
	public static function parsePath($path, $localFile = false)
	{
        $platformDirs =
FOFPlatform::getInstance()->getPlatformBaseDirs();

		if ($localFile)
		{
			$url = rtrim($platformDirs['root'], DIRECTORY_SEPARATOR) .
'/';
		}
		else
		{
			$url = FOFPlatform::getInstance()->URIroot();
		}

		$altPaths = self::getAltPaths($path);
		$filePath = $altPaths['normal'];

		// If JDEBUG is enabled, prefer that path, else prefer an alternate path
if present
		if (defined('JDEBUG') && JDEBUG &&
isset($altPaths['debug']))
		{
			if (file_exists($platformDirs['public'] . '/' .
$altPaths['debug']))
			{
				$filePath = $altPaths['debug'];
			}
		}
		elseif (isset($altPaths['alternate']))
		{
			if (file_exists($platformDirs['public'] . '/' .
$altPaths['alternate']))
			{
				$filePath = $altPaths['alternate'];
			}
		}

		$url .= $filePath;

		return $url;
	}

	/**
	 * Parse a fancy path definition into a path relative to the site's
root.
	 * It returns both the normal and alternative (template media override)
path.
	 * For example, media://com_foobar/css/test.css is parsed into
	 * array(
	 *   'normal' => 'media/com_foobar/css/test.css',
	 *   'alternate' =>
'templates/mytemplate/media/com_foobar/css//test.css'
	 * );
	 *
	 * The valid protocols are:
	 * media://		The media directory or a media override
	 * admin://		Path relative to administrator directory (no alternate)
	 * site://		Path relative to site's root (no alternate)
	 *
	 * @param   string  $path  Fancy path
	 *
	 * @return  array  Array of normal and alternate parsed path
	 */
	public static function getAltPaths($path)
	{
		$protoAndPath = explode('://', $path, 2);

		if (count($protoAndPath) < 2)
		{
			$protocol = 'media';
		}
		else
		{
			$protocol = $protoAndPath[0];
			$path = $protoAndPath[1];
		}

		$path = ltrim($path, '/' . DIRECTORY_SEPARATOR);

		switch ($protocol)
		{
			case 'media':
				// Do we have a media override in the template?
				$pathAndParams = explode('?', $path, 2);

				$ret = array(
					'normal'	 => 'media/' . $pathAndParams[0],
					'alternate'	 =>
FOFPlatform::getInstance()->getTemplateOverridePath('media:/'
. $pathAndParams[0], false),
				);
				break;

			case 'admin':
				$ret = array(
					'normal' => 'administrator/' . $path
				);
				break;

			default:
			case 'site':
				$ret = array(
					'normal' => $path
				);
				break;
		}

		// For CSS and JS files, add a debug path if the supplied file is
compressed
		$filesystem =
FOFPlatform::getInstance()->getIntegrationObject('filesystem');
		$ext        = $filesystem->getExt($ret['normal']);

		if (in_array($ext, array('css', 'js')))
		{
			$file = basename($filesystem->stripExt($ret['normal']));

			/*
			 * Detect if we received a file in the format name.min.ext
			 * If so, strip the .min part out, otherwise append -uncompressed
			 */

			if (strlen($file) > 4 && strrpos($file, '.min',
'-4'))
			{
				$position = strrpos($file, '.min', '-4');
				$filename = str_replace('.min', '.', $file,
$position) . $ext;
			}
			else
			{
				$filename = $file . '-uncompressed.' . $ext;
			}

			// Clone the $ret array so we can manipulate the 'normal' path
a bit
			$t1 = (object) $ret;
			$temp = clone $t1;
			unset($t1);
			$temp = (array)$temp;
			$normalPath = explode('/', $temp['normal']);
			array_pop($normalPath);
			$normalPath[] = $filename;
			$ret['debug'] = implode('/', $normalPath);
		}

		return $ret;
	}

	/**
	 * Returns the contents of a module position
	 *
	 * @param   string  $position  The position name, e.g.
"position-1"
	 * @param   int     $style     Rendering style; please refer to
Joomla!'s code for more information
	 *
	 * @return  string  The contents of the module position
	 */
	public static function loadPosition($position, $style = -2)
	{
		$document = FOFPlatform::getInstance()->getDocument();

		if (!($document instanceof JDocument))
		{
			return '';
		}

		if (!method_exists($document, 'loadRenderer'))
		{
			return '';
		}

		try
		{
			$renderer = $document->loadRenderer('module');
		}
		catch (Exception $exc)
		{
			return '';
		}

		$params = array('style' => $style);

		$contents = '';

		foreach (JModuleHelper::getModules($position) as $mod)
		{
			$contents .= $renderer->render($mod, $params);
		}

		return $contents;
	}

	/**
	 * Merges the current url with new or changed parameters.
	 *
	 * This method merges the route string with the url parameters defined
	 * in current url. The parameters defined in current url, but not given
	 * in route string, will automatically reused in the resulting url.
	 * But only these following parameters will be reused:
	 *
	 * option, view, layout, format
	 *
	 * Example:
	 *
	 * Assuming that current url is:
	 * http://fobar.com/index.php?option=com_foo&view=cpanel
	 *
	 * <code>
	 * <?php echo
FOFTemplateutils::route('view=categories&layout=tree'); ?>
	 * </code>
	 *
	 * Result:
	 *
http://fobar.com/index.php?option=com_foo&view=categories&layout=tree
	 *
	 * @param   string  $route  The parameters string
	 *
	 * @return  string  The human readable, complete url
	 */
	public static function route($route = '')
	{
		$route = trim($route);

		// Special cases

		if ($route == 'index.php' || $route == 'index.php?')
		{
			$result = $route;
		}
		elseif (substr($route, 0, 1) == '&')
		{
			$url = JURI::getInstance();
			$vars = array();
			parse_str($route, $vars);

			$url->setQuery(array_merge($url->getQuery(true), $vars));

			$result = 'index.php?' . $url->getQuery();
		}
		else
		{
			$url = JURI::getInstance();
			$props = $url->getQuery(true);

			// Strip 'index.php?'
			if (substr($route, 0, 10) == 'index.php?')
			{
				$route = substr($route, 10);
			}

			// Parse route
			$parts = array();
			parse_str($route, $parts);
			$result = array();

			// Check to see if there is component information in the route if not
add it

			if (!isset($parts['option']) &&
isset($props['option']))
			{
				$result[] = 'option=' . $props['option'];
			}

			// Add the layout information to the route only if it's not
'default'

			if (!isset($parts['view']) &&
isset($props['view']))
			{
				$result[] = 'view=' . $props['view'];

				if (!isset($parts['layout']) &&
isset($props['layout']))
				{
					$result[] = 'layout=' . $props['layout'];
				}
			}

			// Add the format information to the URL only if it's not
'html'

			if (!isset($parts['format']) &&
isset($props['format']) && $props['format'] !=
'html')
			{
				$result[] = 'format=' . $props['format'];
			}

			// Reconstruct the route

			if (!empty($route))
			{
				$result[] = $route;
			}

			$result = 'index.php?' . implode('&', $result);
		}

		return JRoute::_($result);
	}
}