1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-12 09:34:54 +02:00

Download breadcrumb fix.

This commit is contained in:
Cameron
2017-03-27 09:43:21 -07:00
parent 0846180664
commit c581b89aa1
4 changed files with 164 additions and 62 deletions

View File

@@ -25,6 +25,9 @@ class download_shortcodes extends e_shortcode
public $dlsubrow;
public $dlsubsubrow;
public $mirror;
public $parent;
public $grandparent;
/**
* download_shortcodes constructor
@@ -43,6 +46,7 @@ class download_shortcodes extends e_shortcode
$breadcrumb = array();
switch ($this->qry['action'])
{
case 'mirror':
@@ -58,6 +62,17 @@ class download_shortcodes extends e_shortcode
default:
$breadcrumb[] = array('text' => LAN_PLUGIN_DOWNLOAD_NAME, 'url' => $url->create('download/index'));
if(!empty($this->grandparent))
{
$breadcrumb[] = array('text' => $this->grandparent['download_category_name'], 'url' => ($this->grandparent['download_category_id']) ? $url->create('download/list/category', array('id'=>$this->grandparent['download_category_id'],'name'=>$this->grandparent['download_category_sef'])) : null);
}
if(!empty($this->parent))
{
$breadcrumb[] = array('text' => $this->parent['download_category_name'], 'url' => ($this->parent['download_category_id']) ? $url->create('download/list/category', array('id'=>$this->parent['download_category_id'],'name'=>$this->parent['download_category_sef'])) : null);
}
$breadcrumb[] = array('text' => $this->var['download_category_name'], 'url' => ($this->var['download_category_id']) ? $url->create('download/list/category', array('id'=>$this->var['download_category_id'],'name'=>$this->var['download_category_sef'])) : null);
$breadcrumb[] = array('text' => $this->var['download_name'], 'url' => null);
break;
@@ -154,7 +169,9 @@ class download_shortcodes extends e_shortcode
$tp = e107::getParser();
if ($this->dlsubsubrow['d_count'])
{
return "<a class='".$class."' href='".e_PLUGIN_ABS."download/download.php?action=list&id=".$this->dlsubsubrow['download_category_id']."'>".$tp->toHTML($this->dlsubsubrow['download_category_name'], FALSE, 'TITLE')."</a>";
$url = e107::getUrl()->create('download/list/category', array('id'=>$this->dlsubsubrow['download_category_id'], 'name'=> vartrue($this->dlsubsubrow['download_category_sef'],'--sef-not-set--')));
// e_PLUGIN_ABS."download/download.php?action=list&id=".$this->dlsubsubrow['download_category_id']
return "<a class='".$class."' href='".$url."'>".$tp->toHTML($this->dlsubsubrow['download_category_name'], FALSE, 'TITLE')."</a>";
}
else
{
@@ -944,7 +961,18 @@ class download_shortcodes extends e_shortcode
function sc_download_back_to_category_list()
{
return "<a class='btn btn-default btn-xs btn-mini' href='".e_SELF."'>".LAN_dl_9."</a>";
$url = e107::getUrl();
if(!empty($this->parent))
{
$link = $url->create('download/list/category', array('id'=>$this->parent['download_category_id'],'name'=>$this->parent['download_category_sef']));
}
else
{
$link = ($this->var['download_category_id']) ? $url->create('download/list/category', array('id'=>$this->var['download_category_id'],'name'=>$this->var['download_category_sef'])) : null;
}
return "<a class='btn btn-default btn-xs btn-mini' href='".$link."'>".LAN_dl_9."</a>";
}