1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +02:00

Fix for Icon paths.

This commit is contained in:
Cameron
2014-01-15 04:02:05 -08:00
parent c567fd265b
commit e323418ab2
4 changed files with 45 additions and 26 deletions

View File

@@ -50,8 +50,11 @@ function loadJSAddons()
// e107::js('core', 'bootstrap/js/bootstrap-modal.js', 'jquery', 2); // Special Version see: https://github.com/twitter/bootstrap/pull/4224
e107::css('core', 'bootstrap-editable/css/bootstrap-editable.css', 'jquery');
e107::js('core', 'bootstrap-editable/js/bootstrap-editable.min.js', 'jquery', 2);
// e107::css('core', 'bootstrap-editable/css/bootstrap-editable.css', 'jquery');
//e107::js('core', 'bootstrap-editable/js/bootstrap-editable.min.js', 'jquery', 2);
e107::css('url', "//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap-editable/css/bootstrap-editable.css");
e107::js('url', "//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap-editable/js/bootstrap-editable.min.js");
e107::css('core', 'bootstrap-select/bootstrap-select.min.css', 'jquery');
e107::js('core', 'bootstrap-select/bootstrap-select.min.js', 'jquery', 2);

View File

@@ -2451,23 +2451,7 @@ class e_parse extends e_parser
}
return $text;
}
/**
* Display a Date in the browser.
* Includes support for 'livestamp' (http://mattbradley.github.io/livestampjs/)
* @param integer $datestamp - unix timestamp
* @param string $format - short | long | relative
* @return HTML with converted date.
*/
public function toDate($datestamp = null, $format='short')
{
if(!is_numeric($datestamp)){ return; }
return '<span data-livestamp="'.$datestamp.'">'.e107::getDate()->convert($datestamp, $format).'</span>';
}
@@ -2541,6 +2525,7 @@ class e_parse extends e_parser
/**
* New v2 Parser
* Start Fresh and Build on it over time to become eventual replacement to e_parse.
* Cameron's DOM-based parser.
*/
@@ -2749,15 +2734,19 @@ class e_parser
// return $text;
}
/**
* Display an icon.
* @param string $icon
* @example $tp->toIcon("{e_IMAGES}icons/something.png");
*/
public function toIcon($icon='',$legacyPath ='')
public function toIcon($icon='',$parm = array())
{
if(!vartrue($icon))
{
return;
@@ -2776,11 +2765,11 @@ class e_parser
{
$path = $this->replaceConstants($icon,'full');
}
elseif($legacyPath)
elseif(vartrue($parm['legacy']))
{
if(is_readable($legacyPath.$icon))
if(is_readable($parm['legacy'].$icon))
{
$path = $legacyPath.$icon;
$path = $parm['legacy'].$icon;
}
elseif(ADMIN)
{
@@ -2788,11 +2777,19 @@ class e_parser
}
}
else
{
$path = $icon;
}
return "<img class='icon' src='".$path."' alt='".basename($path)."' />";
}
/**
* Display a Video file.
* @param string $file - format: id.type eg. x123dkax.youtube
* @param boolean $thumbnail - set to 'tag' to return an image thumbnail and 'src' to return the src url or 'video' for a small video thumbnail.
*/
@@ -2844,6 +2841,22 @@ class e_parser
/**
* Display a Date in the browser.
* Includes support for 'livestamp' (http://mattbradley.github.io/livestampjs/)
* @param integer $datestamp - unix timestamp
* @param string $format - short | long | relative
* @return HTML with converted date.
*/
public function toDate($datestamp = null, $format='short')
{
if(!is_numeric($datestamp)){ return; }
return '<span data-livestamp="'.$datestamp.'">'.e107::getDate()->convert($datestamp, $format).'</span>';
}

View File

@@ -2682,12 +2682,15 @@ class e_form
if($glyph = $tp->toGlyph($value))
{
$value = $glyph;
// $value = $glyph;
}
else
{
$value = '<img src="'.$tp->replaceConstants(vartrue($parms['pre']).$value, 'abs').'" alt="'.basename($value).'" class="icon'.(vartrue($parms['class']) ? ' '.$parms['class'] : '').'" />';
// $value = '<img src="'.$tp->replaceConstants(vartrue($parms['pre']).$value, 'abs').'" alt="'.basename($value).'" class="icon'.(vartrue($parms['class']) ? ' '.$parms['class'] : '').'" />';
}
$value = $tp->toIcon($value);
break;
case 'file':

View File

@@ -904,8 +904,8 @@ class download_shortcodes extends e_shortcode
if (!$source) return "&nbsp;";
// list($ret[TRUE],$ret[FALSE]) = explode(chr(1), $source.chr(1)); //XXX ???
// if (!$ret[FALSE]) $ret[FALSE] = $ret[TRUE]; //XXX ???
return e107::getParser()->toIcon($source, e_IMAGE."icons/");
$parms = array('legacy'=> e_IMAGE."icons/");
return e107::getParser()->toIcon($source, $parms);
//return "<img src='".e_IMAGE."icons/{$ret[($count!=0)]}' alt='*'/>";
}