mirror of
https://github.com/e107inc/e107.git
synced 2025-04-20 04:32:01 +02:00
Use static URLs in compressed CSS when enabled.
This commit is contained in:
parent
8799ccab75
commit
d0d4bcc1cd
@ -1997,7 +1997,7 @@ class e107
|
||||
$admin = (bool) defset('e_ADMIN_AREA', false);
|
||||
|
||||
// Try to detect and load CDN version.
|
||||
if(!$admin && $cdn && substr($library, 0, 4) != 'cdn.')
|
||||
if(!$admin && $cdn && strpos($library, 'cdn.') !== 0)
|
||||
{
|
||||
$lib = $libraryHandler->detect('cdn.' . $library);
|
||||
|
||||
@ -2180,7 +2180,8 @@ class e107
|
||||
*/
|
||||
public static function css($type, $data, $dep = null, $media = 'all', $preComment = '', $postComment = '', $dependence = null)
|
||||
{
|
||||
if((strstr($data,'bootstrap.css') || strstr($data,'bootstrap.min.css')) && !defined("BOOTSTRAP")) // detect bootstrap is enabled. - used in nextprev.sc and forum currently.
|
||||
|
||||
if((strpos($data,'bootstrap.css')!==false || strpos($data,'bootstrap.min.css')!==false) && !defined("BOOTSTRAP")) // detect bootstrap is enabled. - used in nextprev.sc and forum currently.
|
||||
{
|
||||
define("BOOTSTRAP", true);
|
||||
}
|
||||
|
@ -2623,15 +2623,23 @@ class e_parse extends e_parser
|
||||
|
||||
|
||||
/**
|
||||
* @todo Move to e107_class ?
|
||||
* @param string $path - absolute path
|
||||
* @return string - static path.
|
||||
*/
|
||||
public function staticUrl($path=null)
|
||||
public function staticUrl($path=null, $opts=array())
|
||||
{
|
||||
if(!defined('e_HTTP_STATIC') || deftrue('e_ADMIN_AREA'))
|
||||
{
|
||||
// e107::getDebug()->log("e_HTTP_STATIC not defined");
|
||||
return ($path === null) ? e_HTTP : $path;
|
||||
if($path === null)
|
||||
{
|
||||
return !empty($opts['full']) ? SITEURL : e_HTTP;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -2040,7 +2040,7 @@ class e_form
|
||||
|
||||
case 'large':
|
||||
default:
|
||||
$rows = '15';
|
||||
$rows = '20';
|
||||
$size = 'large input-block-level';
|
||||
// $height = "style='height:500px;width:1025px'"; // inline required for wysiwyg
|
||||
break;
|
||||
|
@ -1606,6 +1606,8 @@ class e_jsmanager
|
||||
|
||||
$basePath = dirname($path)."/";
|
||||
|
||||
$tp = e107::getParser();
|
||||
|
||||
foreach($match[1] as $k=>$v)
|
||||
{
|
||||
if(strpos($v,'data:') === 0 || strpos($v,'http') === 0)
|
||||
@ -1614,10 +1616,9 @@ class e_jsmanager
|
||||
continue;
|
||||
}
|
||||
|
||||
$http = $tp->staticUrl(null, array('full'=>1)); // returns SITEURL or Static URL if enabled.
|
||||
$path = $this->normalizePath($basePath.$v);
|
||||
$dir = "url(".SITEURL.$path.")"; // relative to e_WEB_ABS."cache/";
|
||||
|
||||
// print_a($dir);
|
||||
$dir = "url(".$http.$path.")";
|
||||
|
||||
$newpath[$k] = $dir;
|
||||
}
|
||||
|
@ -237,4 +237,3 @@ define("LAN_NEWS_108", "The SEF URL is unlike the title of your news item.");
|
||||
define("LAN_NEWS_109", "Trigger an email notification when you submit this form.");
|
||||
define("LAN_NEWS_110", "News Cache Timeout");
|
||||
define("LAN_NEWS_111", "Time in minutes. Applies only when system cache is enabled.");
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user