/** * * @param type $sPath */ public static function path2Url($sPath) { $oUri = clone JchPlatformUri::getInstance(); $sBaseFolder = JchOptimizeHelper::getBaseFolder(); $abspath = str_replace(DIRECTORY_SEPARATOR, '/', ABSPATH); $sPath = str_replace(DIRECTORY_SEPARATOR, '/', $sPath); $sUriPath = $oUri->toString(array('scheme', 'user', 'pass', 'host', 'port')) . $sBaseFolder . str_replace($abspath, '', $sPath); return $sUriPath; }
/** * * @param type $function */ public static function ajaxUrl($function) { $url = JUri::getInstance()->toString(array('scheme', 'user', 'pass', 'host', 'port')); $url .= JchOptimizeHelper::getBaseFolder(); if (version_compare(JVERSION, '3.0', '<')) { $url .= 'plugins/system/jch_optimize/ajax.php?action=' . $function; } else { $url .= 'index.php?option=com_ajax&plugin=' . $function . '&format=raw'; } return $url; }
/** * */ public static function imageFolder() { return JchOptimizeHelper::getBaseFolder() . 'media/plg_jchoptimize/images/'; }