|
|
@@ -1426,6 +1426,30 @@ class BxDolTemplate extends BxDol implements iBxDolSingleton
|
|
|
* @return mixed string or an array with CSS file's Path and URL.
|
|
|
*/
|
|
|
function _lessCss($mixed)
|
|
|
+ {
|
|
|
+ require_once(BX_DIRECTORY_PATH_PLUGINS . 'less.php/Less.php');
|
|
|
+
|
|
|
+ if(is_array($mixed) && isset($mixed['url']) && isset($mixed['path'])) {
|
|
|
+ $sPathFile = realpath($mixed['path']);
|
|
|
+ $aInfoFile = pathinfo($sPathFile);
|
|
|
+ if (!isset($aInfoFile['extension']) || $aInfoFile['extension'] != 'less')
|
|
|
+ return $mixed;
|
|
|
+
|
|
|
+ require_once(BX_DIRECTORY_PATH_PLUGINS . 'less.php/Cache.php');
|
|
|
+ $aFiles = array($mixed['path'] => $mixed['url']);
|
|
|
+ $aOptions = array('cache_dir' => $this->_sCachePublicFolderPath);
|
|
|
+ $sFile = Less_Cache::Get($aFiles, $aOptions, $this->_oConfigTemplate->aLessConfig);
|
|
|
+
|
|
|
+ return array('url' => $this->_sCachePublicFolderUrl . $sFile, 'path' => $this->_sCachePublicFolderPath . $sFile);
|
|
|
+ }
|
|
|
+
|
|
|
+ $oLess = new Less_Parser();
|
|
|
+ $oLess->ModifyVars($this->_oConfigTemplate->aLessConfig);
|
|
|
+ $oLess->parse($mixed);
|
|
|
+ return $oLess->getCss();
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ function _lessCss($mixed)
|
|
|
{
|
|
|
require_once(BX_DIRECTORY_PATH_PLUGINS . 'lessphp/lessc.inc.php');
|
|
|
$oLess = new lessc();
|
|
|
@@ -1457,6 +1481,7 @@ class BxDolTemplate extends BxDol implements iBxDolSingleton
|
|
|
|
|
|
return $oLess->compile($mixed);
|
|
|
}
|
|
|
+ */
|
|
|
|
|
|
/**
|
|
|
* Minify CSS
|