1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Downloads: Can finally have files in the root directory.

This commit is contained in:
Cameron 2017-04-19 18:58:34 -07:00
parent 6f348e1940
commit 07062e26e5
2 changed files with 39 additions and 4 deletions

View File

@ -82,23 +82,55 @@ class download_shortcodes extends e_shortcode
// Category ************************************************************************************
function sc_download_cat_main_name()
public function sc_download_cat_main_name()
{
$tp = e107::getParser();
if(!empty($this->var['d_count']))
{
$url = e107::url('download', 'category', $this->var);
return "<a href='".$url."'>".$tp->toHTML($this->var['download_category_name'], FALSE, 'TITLE')."</a>";
}
return $tp->toHTML($this->var['download_category_name'], FALSE, 'TITLE');
}
function sc_download_cat_main_description()
public function sc_download_cat_main_description()
{
$tp = e107::getParser();
return $tp->toHTML($this->var['download_category_description'], TRUE, 'DESCRIPTION');
}
function sc_download_cat_main_icon()
public function sc_download_cat_main_icon()
{
// Pass count as 1 to force non-empty icon
return $this->_sc_cat_icons($this->var['download_category_icon'], 1, $this->var['download_category_name']);
}
public function sc_download_cat_main_count()
{
if(!empty($this->var['d_count']))
{
return intval($this->var['d_count']);
}
}
public function sc_download_cat_main_size()
{
if(!empty($this->var['d_count']))
{
return eHelper::parseMemorySize($this->var['d_size']);
}
}
public function sc_download_cat_main_downloaded()
{
if(!empty($this->var['d_count']))
{
return intval($this->var['d_requests']);
}
}
// Sub-Category ********************************************************************************
function sc_download_cat_sub_name()

View File

@ -375,10 +375,13 @@ $DOWNLOAD_TEMPLATE['categories']['parent'] = "
<td>
{DOWNLOAD_CAT_MAIN_ICON}
</td>
<td colspan='4'>
<td>
{DOWNLOAD_CAT_MAIN_NAME}<br/>
<small class='muted text-muted'>{DOWNLOAD_CAT_MAIN_DESCRIPTION}</small>
</td>
<td>{DOWNLOAD_CAT_MAIN_COUNT} </td>
<td>{DOWNLOAD_CAT_MAIN_SIZE} </td>
<td>{DOWNLOAD_CAT_MAIN_DOWNLOADED} </td>
</tr>";
$DOWNLOAD_TEMPLATE['categories']['child'] = "