mirror of
https://github.com/e107inc/e107.git
synced 2025-05-10 06:06:21 +02:00
Fixes #466 Download Category Icons path.
This commit is contained in:
parent
d34623a043
commit
470b043739
e107_handlers
e107_plugins/download
@ -2696,14 +2696,35 @@ class e_parser
|
||||
* @param string $icon
|
||||
* @example $tp->toIcon("{e_IMAGES}icons/something.png");
|
||||
*/
|
||||
public function toIcon($icon='')
|
||||
public function toIcon($icon='',$legacyPath ='')
|
||||
{
|
||||
if(!vartrue($icon))
|
||||
{
|
||||
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)."' />";
|
||||
}
|
||||
|
||||
|
@ -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['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);
|
||||
|
||||
|
@ -884,9 +884,11 @@ class download_shortcodes extends e_shortcode
|
||||
function _sc_cat_icons($source, $count, $alt)
|
||||
{
|
||||
if (!$source) return " ";
|
||||
list($ret[TRUE],$ret[FALSE]) = explode(chr(1), $source.chr(1));
|
||||
if (!$ret[FALSE]) $ret[FALSE] = $ret[TRUE];
|
||||
return "<img src='".e_IMAGE."icons/{$ret[($count!=0)]}' alt='*'/>";
|
||||
// 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/");
|
||||
//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(
|
||||
'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_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'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user