mirror of
https://github.com/e107inc/e107.git
synced 2025-08-09 08:06:38 +02:00
Issue #2486 - Downloads templatea fix. Breadcrumb fix. Replacement e_url profile added.
This commit is contained in:
@@ -55,11 +55,11 @@ class download_shortcodes extends e_shortcode
|
||||
break;
|
||||
|
||||
case 'maincats':
|
||||
$breadcrumb[] = array('text' => LAN_PLUGIN_DOWNLOAD_NAME, 'url' => e107::url('download/index'));
|
||||
$breadcrumb[] = array('text' => LAN_PLUGIN_DOWNLOAD_NAME, 'url' => e107::url('download','index'));
|
||||
break;
|
||||
|
||||
default:
|
||||
$breadcrumb[] = array('text' => LAN_PLUGIN_DOWNLOAD_NAME, 'url' => e107::url('download/index'));
|
||||
$breadcrumb[] = array('text' => LAN_PLUGIN_DOWNLOAD_NAME, 'url' => e107::url('download','index'));
|
||||
|
||||
if(!empty($this->grandparent))
|
||||
{
|
||||
|
@@ -24,24 +24,81 @@ class download_url // plugin-folder + '_url'
|
||||
|
||||
public $alias = 'download';
|
||||
|
||||
/**
|
||||
* Support for different URL profiles (optional)
|
||||
* @return array
|
||||
*/
|
||||
public $profiles = array(
|
||||
'default' => array('label' => 'Friendly Default', 'examples' => array('{SITEURL}download/category/3/my-category-name')),
|
||||
'non-numeric' => array('label' => 'Friendly (experimental)', 'examples' => array('{SITEURL}download/my-category/my-sub-category/my-file-name')),
|
||||
);
|
||||
|
||||
|
||||
function config($profile=null)
|
||||
{
|
||||
|
||||
switch($profile)
|
||||
{
|
||||
case "non-numeric":
|
||||
$config = $this->profile2();
|
||||
break;
|
||||
|
||||
case "default":
|
||||
default:
|
||||
$config = $this->profile1();
|
||||
|
||||
}
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
|
||||
function profile1()
|
||||
|
||||
|
||||
private function profile2()
|
||||
{
|
||||
$config = $this->profile1();
|
||||
|
||||
$config['subcategory'] = array(
|
||||
'regex' => '^{alias}/([^\/]*)/([^\/]*)/?$',
|
||||
'redirect' => '{e_PLUGIN}vstore/vstore.php?catsef=$2',
|
||||
'sef' => '{alias}/{cat_sef}/{subcat_sef}'
|
||||
);
|
||||
|
||||
|
||||
$config['category'] = array(
|
||||
'regex' => '^{alias}/category/([\d]*)/(.*)$',
|
||||
'redirect' => '{e_PLUGIN}download/download.php?action=list&id=$1',
|
||||
'sef' => '{alias}/{download_category_sef}',
|
||||
);
|
||||
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
|
||||
private function profile1()
|
||||
{
|
||||
$config = array();
|
||||
|
||||
$config['category'] = array(
|
||||
/*
|
||||
|
||||
$config['subcategory'] = array(
|
||||
'regex' => '^{alias}/([^\/]*)/([^\/]*)/?$',
|
||||
'redirect' => '{e_PLUGIN}vstore/vstore.php?catsef=$2',
|
||||
'sef' => '{alias}/{cat_sef}/{subcat_sef}'
|
||||
);
|
||||
*/
|
||||
|
||||
$config['category'] = array(
|
||||
'regex' => '^{alias}/category/([\d]*)/(.*)$',
|
||||
'redirect' => '{e_PLUGIN}download/download.php?action=list&id=$1',
|
||||
'sef' => '{alias}/category/{download_category_id}/{download_category_sef}/',
|
||||
);
|
||||
|
||||
$config['item'] = array(
|
||||
'regex' => '^{alias}/([\d]*)/(.*)$',
|
||||
'redirect' => '{e_PLUGIN}download/download.php?action=view&id=$1',
|
||||
'sef' => '{alias}/{download_id}/{download_sef}'
|
||||
);
|
||||
|
||||
@@ -53,8 +110,7 @@ class download_url // plugin-folder + '_url'
|
||||
|
||||
|
||||
$config['index'] = array(
|
||||
// 'regex' => '^download/?$',
|
||||
'alias' => 'download',
|
||||
'regex' => '{alias}/?$',
|
||||
'sef' => '{alias}',
|
||||
'redirect' => '{e_PLUGIN}download/download.php',
|
||||
);
|
||||
|
@@ -412,6 +412,15 @@ class download
|
||||
}
|
||||
|
||||
$dlrow = $sql->fetch();
|
||||
|
||||
$sc->parent = $this->getParent($dlrow['download_category_id']);
|
||||
|
||||
if(!empty( $sc->parent['download_category_parent']))
|
||||
{
|
||||
$sc->grandparent = $this->getParent( $sc->parent['download_category_id']);
|
||||
}
|
||||
|
||||
|
||||
$sc->setVars($dlrow);
|
||||
$this->setMeta($dlrow);
|
||||
|
||||
|
@@ -401,7 +401,7 @@ $DOWNLOAD_TEMPLATE['categories']['subchild'] = "
|
||||
{DOWNLOAD_CAT_SUBSUB_ICON}
|
||||
</td>
|
||||
<td >
|
||||
<div class='offset1'>
|
||||
<div class='col-md-offset-1'>
|
||||
{DOWNLOAD_CAT_SUBSUB_NEW_ICON} {DOWNLOAD_CAT_SUBSUB_NAME}<br/>
|
||||
<small class='muted text-muted'>
|
||||
{DOWNLOAD_CAT_SUBSUB_DESCRIPTION}
|
||||
|
Reference in New Issue
Block a user