mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
JS-Manager: Fix for CDN URLs containing the '|' character. Minor theme fixes.
This commit is contained in:
@@ -217,6 +217,9 @@ class e_jsmanager
|
|||||||
|
|
||||||
protected $_cache_enabled = false;
|
protected $_cache_enabled = false;
|
||||||
|
|
||||||
|
|
||||||
|
protected $_sep = '#|#';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@@ -949,25 +952,25 @@ class e_jsmanager
|
|||||||
{
|
{
|
||||||
case 'core':
|
case 'core':
|
||||||
// added direct CDN support
|
// added direct CDN support
|
||||||
$file_path = (strpos($file_path, 'http') !== 0 && strpos($file_path, '//') !== 0 ? '{e_WEB_JS}'.trim($file_path, '/') : $file_path)."|{$pre}|{$post}";
|
$file_path = (strpos($file_path, 'http') !== 0 && strpos($file_path, '//') !== 0 ? '{e_WEB_JS}'.trim($file_path, '/') : $file_path).$this->_sep.$pre.$this->_sep.$post;
|
||||||
$registry = &$this->_e_jslib_core;
|
$registry = &$this->_e_jslib_core;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'plugin':
|
case 'plugin':
|
||||||
$file_path = explode(':', $file_path);
|
$file_path = explode(':', $file_path);
|
||||||
$file_path = '{e_PLUGIN}'.$file_path[0].'/'.trim($file_path[1], '/')."|{$pre}|{$post}";
|
$file_path = '{e_PLUGIN}'.$file_path[0].'/'.trim($file_path[1], '/').$this->_sep.$pre.$this->_sep.$post;
|
||||||
$registry = &$this->_e_jslib_plugin;
|
$registry = &$this->_e_jslib_plugin;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'theme':
|
case 'theme':
|
||||||
$file_path = '{e_THEME}'.$this->getCurrentTheme().'/'.trim($file_path, '/')."|{$pre}|{$post}";
|
$file_path = '{e_THEME}'.$this->getCurrentTheme().'/'.trim($file_path, '/').$this->_sep.$pre.$this->_sep.$post;
|
||||||
//echo "file-Path = ".$file_path;
|
//echo "file-Path = ".$file_path;
|
||||||
$registry = &$this->_e_jslib_theme;
|
$registry = &$this->_e_jslib_theme;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'core_css': //FIXME - core CSS should point to new e_WEB/css; add one more case - js_css -> e_WEB/jslib/
|
case 'core_css': //FIXME - core CSS should point to new e_WEB/css; add one more case - js_css -> e_WEB/jslib/
|
||||||
// added direct CDN support
|
// added direct CDN support
|
||||||
$file_path = $runtime_location.'|'.(strpos($file_path, 'http') !== 0 && strpos($file_path, '//') !== 0 ? '{e_WEB_JS}'.trim($file_path, '/') : $file_path)."|{$pre}|{$post}";
|
$file_path = $runtime_location.$this->_sep.(strpos($file_path, 'http') !== 0 && strpos($file_path, '//') !== 0 ? '{e_WEB_JS}'.trim($file_path, '/') : $file_path).$this->_sep.$pre.$this->_sep.$post;
|
||||||
if(!isset($this->_e_css['core'])) $this->_e_css['core'] = array();
|
if(!isset($this->_e_css['core'])) $this->_e_css['core'] = array();
|
||||||
$registry = &$this->_e_css['core'];
|
$registry = &$this->_e_css['core'];
|
||||||
$runtime = true;
|
$runtime = true;
|
||||||
@@ -975,21 +978,21 @@ class e_jsmanager
|
|||||||
|
|
||||||
case 'plugin_css':
|
case 'plugin_css':
|
||||||
$file_path = explode(':', $file_path);
|
$file_path = explode(':', $file_path);
|
||||||
$file_path = $runtime_location.'|{e_PLUGIN}'.$file_path[0].'/'.trim($file_path[1], '/')."|{$pre}|{$post}";
|
$file_path = $runtime_location.$this->_sep.'{e_PLUGIN}'.$file_path[0].'/'.trim($file_path[1], '/').$this->_sep.$pre.$this->_sep.$post;
|
||||||
if(!isset($this->_e_css['plugin'])) $this->_e_css['plugin'] = array();
|
if(!isset($this->_e_css['plugin'])) $this->_e_css['plugin'] = array();
|
||||||
$registry = &$this->_e_css['plugin'];
|
$registry = &$this->_e_css['plugin'];
|
||||||
$runtime = true;
|
$runtime = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'theme_css':
|
case 'theme_css':
|
||||||
$file_path = $runtime_location.'|{e_THEME}'.$this->getCurrentTheme().'/'.trim($file_path, '/')."|{$pre}|{$post}";
|
$file_path = $runtime_location.$this->_sep.'{e_THEME}'.$this->getCurrentTheme().'/'.trim($file_path, '/').$this->_sep.$pre.$this->_sep.$post;
|
||||||
if(!isset($this->_e_css['theme'])) $this->_e_css['theme'] = array();
|
if(!isset($this->_e_css['theme'])) $this->_e_css['theme'] = array();
|
||||||
$registry = &$this->_e_css['theme'];
|
$registry = &$this->_e_css['theme'];
|
||||||
$runtime = true;
|
$runtime = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'other_css':
|
case 'other_css':
|
||||||
$file_path = $runtime_location.'|'.$tp->createConstants($file_path, 'mix')."|{$pre}|{$post}";
|
$file_path = $runtime_location.$this->_sep.$tp->createConstants($file_path, 'mix').$this->_sep.$pre.$this->_sep.$post;
|
||||||
if(!isset($this->_e_css['other'])) $this->_e_css['other'] = array();
|
if(!isset($this->_e_css['other'])) $this->_e_css['other'] = array();
|
||||||
$registry = &$this->_e_css['other'];
|
$registry = &$this->_e_css['other'];
|
||||||
$runtime = true;
|
$runtime = true;
|
||||||
@@ -1003,7 +1006,7 @@ class e_jsmanager
|
|||||||
|
|
||||||
|
|
||||||
case 'header':
|
case 'header':
|
||||||
$file_path = $tp->createConstants($file_path, 'mix')."|{$pre}|{$post}";
|
$file_path = $tp->createConstants($file_path, 'mix').$this->_sep.$pre.$this->_sep.$post;
|
||||||
$zone = intval($runtime_location);
|
$zone = intval($runtime_location);
|
||||||
if($zone > 5 || $zone < 1)
|
if($zone > 5 || $zone < 1)
|
||||||
{
|
{
|
||||||
@@ -1018,7 +1021,7 @@ class e_jsmanager
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'footer':
|
case 'footer':
|
||||||
$file_path = $tp->createConstants($file_path, 'mix')."|{$pre}|{$post}";
|
$file_path = $tp->createConstants($file_path, 'mix').$this->_sep.$pre.$this->_sep.$post;
|
||||||
$zone = intval($runtime_location);
|
$zone = intval($runtime_location);
|
||||||
if($zone > 5 || $zone < 1)
|
if($zone > 5 || $zone < 1)
|
||||||
{
|
{
|
||||||
@@ -1277,7 +1280,7 @@ class e_jsmanager
|
|||||||
{
|
{
|
||||||
if('css' === $external)
|
if('css' === $external)
|
||||||
{
|
{
|
||||||
$path = explode('|', $path, 4);
|
$path = explode($this->_sep, $path, 4);
|
||||||
$media = $path[0] ? $path[0] : 'all';
|
$media = $path[0] ? $path[0] : 'all';
|
||||||
// support of IE checks
|
// support of IE checks
|
||||||
$pre = varset($path[2]) ? $path[2]."\n" : '';
|
$pre = varset($path[2]) ? $path[2]."\n" : '';
|
||||||
@@ -1297,7 +1300,7 @@ class e_jsmanager
|
|||||||
{
|
{
|
||||||
if(strpos($path, 'http') === 0 || strpos($path, '//') === 0) continue; // not allowed
|
if(strpos($path, 'http') === 0 || strpos($path, '//') === 0) continue; // not allowed
|
||||||
|
|
||||||
$path = explode('|', $path, 3);
|
$path = explode($this->_sep, $path, 3);
|
||||||
$pre = varset($path[1], '');
|
$pre = varset($path[1], '');
|
||||||
if($pre) $pre .= "\n";
|
if($pre) $pre .= "\n";
|
||||||
$post = varset($path[2], '');
|
$post = varset($path[2], '');
|
||||||
@@ -1327,7 +1330,7 @@ class e_jsmanager
|
|||||||
|
|
||||||
if('css' === $external)
|
if('css' === $external)
|
||||||
{
|
{
|
||||||
$path = explode('|', $path, 4);
|
$path = explode($this->_sep, $path, 4);
|
||||||
$media = $path[0];
|
$media = $path[0];
|
||||||
// support of IE checks
|
// support of IE checks
|
||||||
$pre = varset($path[2]) ? $path[2]."\n" : '';
|
$pre = varset($path[2]) ? $path[2]."\n" : '';
|
||||||
@@ -1348,7 +1351,7 @@ class e_jsmanager
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$path = explode('|', $path, 4);
|
$path = explode($this->_sep, $path, 4);
|
||||||
$pre = varset($path[1], '');
|
$pre = varset($path[1], '');
|
||||||
if($pre) $pre .= "\n";
|
if($pre) $pre .= "\n";
|
||||||
$post = varset($path[2], '');
|
$post = varset($path[2], '');
|
||||||
|
@@ -82,7 +82,8 @@ $NEWS_TEMPLATE['default']['item'] = '
|
|||||||
|
|
||||||
$NEWS_TEMPLATE['default']['item'] = '
|
$NEWS_TEMPLATE['default']['item'] = '
|
||||||
{SETIMAGE: w=900&h=300}
|
{SETIMAGE: w=900&h=300}
|
||||||
<h2>{NEWSTITLELINK}</h2>
|
<div class="default-item">
|
||||||
|
<h2 class="news-title">{NEWSTITLELINK}</h2>
|
||||||
<p class="lead">{GLYPH=user} {NEWSAUTHOR}</p>
|
<p class="lead">{GLYPH=user} {NEWSAUTHOR}</p>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -102,7 +103,7 @@ $NEWS_TEMPLATE['default']['item'] = '
|
|||||||
<div class="options">
|
<div class="options">
|
||||||
<div class="btn-group hidden-print">{NEWSCOMMENTLINK: glyph=comments&class=btn btn-default}{PRINTICON: class=btn btn-default}{PDFICON}{SOCIALSHARE}{ADMINOPTIONS: class=btn btn-default}</div>
|
<div class="btn-group hidden-print">{NEWSCOMMENTLINK: glyph=comments&class=btn btn-default}{PRINTICON: class=btn btn-default}{PDFICON}{SOCIALSHARE}{ADMINOPTIONS: class=btn btn-default}</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
';
|
';
|
||||||
|
|
||||||
|
|
||||||
|
@@ -83,10 +83,7 @@ class social_shortcodes extends e_shortcode
|
|||||||
if($data['href'] != '')
|
if($data['href'] != '')
|
||||||
{
|
{
|
||||||
|
|
||||||
$text .= '<a rel="external" href="'.$data['href'].'" class="e-tip social-icon social-'.$id.'" title="'.$data['title'].'">
|
$text .= '<a rel="external" href="'.$data['href'].'" class="e-tip social-icon social-'.$id.'" title="'.$data['title'].'"><span class="fa fa-'.$id.' '.$class.'"></span></a>';
|
||||||
<span class="fa fa-'.$id.' '.$class.'"></span>
|
|
||||||
</a>';
|
|
||||||
|
|
||||||
$text .= "\n";
|
$text .= "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -272,13 +269,15 @@ class social_shortcodes extends e_shortcode
|
|||||||
if(vartrue($parm['dropdown']))
|
if(vartrue($parm['dropdown']))
|
||||||
{
|
{
|
||||||
$dir = ($parm['dropdown'] == 'right') ? 'pull-right' : '';
|
$dir = ($parm['dropdown'] == 'right') ? 'pull-right' : '';
|
||||||
|
$class = varset($parm['class'],'btn-group');
|
||||||
|
|
||||||
|
|
||||||
$text = '<div class="btn-group hidden-print '.$dir.'">
|
$text = '<div class="btn-group hidden-print '.$dir.'">
|
||||||
<a class="e-tip btn btn-dropdown btn-default btn-'.$size.' dropdown-toggle" data-toggle="dropdown" href="#" title="Share">'.$label.'</a>
|
<a class="e-tip btn btn-dropdown btn-default btn-'.$size.' dropdown-toggle" data-toggle="dropdown" href="#" title="Share">'.$label.'</a>
|
||||||
|
|
||||||
<ul class="dropdown-menu" role="menu" style="min-width:435px">
|
<ul class="dropdown-menu" role="menu" style="min-width:435px">
|
||||||
|
|
||||||
<li><div class="btn-group" style="padding-left: 7px;">'.implode("\n",$opt).'</div></li>
|
<li><div class="'.$class.'" style="padding-left: 7px;">'.implode("\n",$opt).'</div></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
@@ -287,10 +286,9 @@ class social_shortcodes extends e_shortcode
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$class = varset($parm['class'],'btn-group');
|
||||||
|
|
||||||
|
return '<div class="'.$class.' text-center hidden-print">'.implode("\n",$opt)."</div>";
|
||||||
|
|
||||||
return '<div class="btn-group text-center hidden-print">'.implode("\n",$opt)."</div>";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user