mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 13:17:24 +02:00
Fixes #466 Download Category Icons path.
This commit is contained in:
@@ -2696,14 +2696,35 @@ class e_parser
|
|||||||
* @param string $icon
|
* @param string $icon
|
||||||
* @example $tp->toIcon("{e_IMAGES}icons/something.png");
|
* @example $tp->toIcon("{e_IMAGES}icons/something.png");
|
||||||
*/
|
*/
|
||||||
public function toIcon($icon='')
|
public function toIcon($icon='',$legacyPath ='')
|
||||||
{
|
{
|
||||||
if(!vartrue($icon))
|
if(!vartrue($icon))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$path = $this->replaceConstants($icon,'full');
|
if(substr($icon,-6) == '.glyph') // Bootstrap or Font-Awesome.
|
||||||
|
{
|
||||||
|
return $this->toGlyph($icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($icon[0] == '{')
|
||||||
|
{
|
||||||
|
$path = $this->replaceConstants($icon,'full');
|
||||||
|
}
|
||||||
|
elseif($legacyPath)
|
||||||
|
{
|
||||||
|
if(is_readable($legacyPath.$icon))
|
||||||
|
{
|
||||||
|
$path = $legacyPath.$icon;
|
||||||
|
}
|
||||||
|
elseif(ADMIN)
|
||||||
|
{
|
||||||
|
return "Broken Image Path: ".$icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return "<img class='icon' src='".$path."' alt='".basename($path)."' />";
|
return "<img class='icon' src='".$path."' alt='".basename($path)."' />";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -63,7 +63,7 @@ class rater {
|
|||||||
|
|
||||||
$TEMPLATE['STATUS'] = " <span class='e-rate-status e-rate-status-{$table}' id='e-rate-{$table}-{$id}' style='display:none'>".$label."</span>";
|
$TEMPLATE['STATUS'] = " <span class='e-rate-status e-rate-status-{$table}' id='e-rate-{$table}-{$id}' style='display:none'>".$label."</span>";
|
||||||
$TEMPLATE['RATE'] = "<div class='e-rate e-rate-{$table}' id='{$table}-{$id}' data-hint=\"{$datahint}\" data-readonly='{$readonly}' data-score='{$score}' data-url='".e_BASE."rate.php' data-path='{$path}'></div>";
|
$TEMPLATE['RATE'] = "<div class='e-rate e-rate-{$table}' id='{$table}-{$id}' data-hint=\"{$datahint}\" data-readonly='{$readonly}' data-score='{$score}' data-url='".e_BASE."rate.php' data-path='{$path}'></div>";
|
||||||
$TEMPLATE['VOTES'] = "<div class='muted e-rate-votes e-rate-votes-{$table}' id='e-rate-votes-{$table}-{$id}'><smalll>".$this->renderVotes($votes,$score)."</small></div>";
|
$TEMPLATE['VOTES'] = "<div class='muted e-rate-votes e-rate-votes-{$table}' id='e-rate-votes-{$table}-{$id}'><small>".$this->renderVotes($votes,$score)."</small></div>";
|
||||||
|
|
||||||
$tmp = explode("|",$template);
|
$tmp = explode("|",$template);
|
||||||
|
|
||||||
|
@@ -884,9 +884,11 @@ class download_shortcodes extends e_shortcode
|
|||||||
function _sc_cat_icons($source, $count, $alt)
|
function _sc_cat_icons($source, $count, $alt)
|
||||||
{
|
{
|
||||||
if (!$source) return " ";
|
if (!$source) return " ";
|
||||||
list($ret[TRUE],$ret[FALSE]) = explode(chr(1), $source.chr(1));
|
// list($ret[TRUE],$ret[FALSE]) = explode(chr(1), $source.chr(1)); //XXX ???
|
||||||
if (!$ret[FALSE]) $ret[FALSE] = $ret[TRUE];
|
// if (!$ret[FALSE]) $ret[FALSE] = $ret[TRUE]; //XXX ???
|
||||||
return "<img src='".e_IMAGE."icons/{$ret[($count!=0)]}' alt='*'/>";
|
|
||||||
|
return e107::getParser()->toIcon($source, e_IMAGE."icons/");
|
||||||
|
//return "<img src='".e_IMAGE."icons/{$ret[($count!=0)]}' alt='*'/>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -120,7 +120,7 @@ class download_cat_ui extends e_admin_ui
|
|||||||
|
|
||||||
protected $fields = array(
|
protected $fields = array(
|
||||||
'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'),
|
'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'),
|
||||||
'download_category_icon' => array('title'=> LAN_ICON, 'type' => 'icon', 'width' => '5%', 'thclass' => 'center','class'=>'center' ),
|
'download_category_icon' => array('title'=> LAN_ICON, 'type' => 'icon', 'width' => '5%', 'thclass' => 'center','class'=>'center','writeParms'=>'glyphs=1' ),
|
||||||
'download_category_id' => array('title'=> LAN_ID, 'type' => 'number', 'width' =>'5%', 'forced'=> TRUE),
|
'download_category_id' => array('title'=> LAN_ID, 'type' => 'number', 'width' =>'5%', 'forced'=> TRUE),
|
||||||
'download_category_name' => array('title'=> LAN_TITLE, 'type' => 'text', 'inline' => true, 'width' => 'auto', 'thclass' => 'left'),
|
'download_category_name' => array('title'=> LAN_TITLE, 'type' => 'text', 'inline' => true, 'width' => 'auto', 'thclass' => 'left'),
|
||||||
'download_category_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'inline' => true, 'width' => 'auto', 'thclass' => 'left'),
|
'download_category_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'inline' => true, 'width' => 'auto', 'thclass' => 'left'),
|
||||||
|
Reference in New Issue
Block a user