1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

Magic Shortcode added for current breadcrumb. {---BREADCRUMB---} e107::breadcrumb() method added for plugins to set/get values.

This commit is contained in:
Cameron
2019-06-14 14:32:58 -07:00
parent 5d2076a344
commit 1d311ff543
4 changed files with 71 additions and 16 deletions

View File

@@ -137,7 +137,7 @@ if (varset($e107_popup) != 1)
}
if (isset($pref['displaycacheinfo']) && $pref['displaycacheinfo'])
{
$rinfo .= $cachestring.".";
// $rinfo .= $cachestring.".";
}
if ($pref['log_page_accesses'])
@@ -409,6 +409,9 @@ if (!empty($pref['e_output_list']) && is_array($pref['e_output_list']))
$search = array_keys($magicSC);
$replace = array_values($magicSC);
$bread = e107::breadcrumb();
$search[] = '{---BREADCRUMB---}';
$replace[] = e107::getForm()->breadcrumb($bread);
// New - see class2.php
$ehd = new e_http_header;

View File

@@ -143,6 +143,11 @@ class e107
*/
protected static $_js_enabled = true;
protected static $_breadcrumb = array();
/**
* Core handlers array
* For new/missing handler add
@@ -3347,6 +3352,24 @@ class e107
}
/**
* Set or Get the current breadcrumb array.
* @param array $array
* @return array|null
*/
public static function breadcrumb($array = array())
{
if(empty($array))
{
return self::$_breadcrumb;
}
self::$_breadcrumb = $array;
return null;
}
/**
* Static (easy) sef-url creation method (works with e_url.php @see /index.php)
*

View File

@@ -37,14 +37,11 @@ class download_shortcodes extends e_shortcode
}
function sc_download_breadcrumb($parm='')
public function breadcrumb()
{
$tp = e107::getParser();
$frm = e107::getForm();
$breadcrumb = array();
switch ($this->qry['action'])
{
case 'mirror':
@@ -76,6 +73,18 @@ class download_shortcodes extends e_shortcode
break;
}
e107::breadcrumb($breadcrumb);
}
function sc_download_breadcrumb($parm='')
{
$tp = e107::getParser();
$frm = e107::getForm();
$breadcrumb = e107::breadcrumb();
return $frm->breadcrumb($breadcrumb);
}

View File

@@ -59,8 +59,8 @@ class download
foreach($data as $row)
{
$id = $row['download_category_parent'];
$sub= $row['download_category_id'];
$id = (int) $row['download_category_parent'];
$sub= (int) $row['download_category_id'];
$this->subCategories[$id][$sub] = $row;
if(check_class($row['download_category_class']))
@@ -70,6 +70,7 @@ class download
}
return $this;
}
@@ -162,6 +163,8 @@ class download
$pref = e107::getPref();
if($this->qry['action'] == 'maincats')
{
//
@@ -298,8 +301,10 @@ class download
}
}
/** @var download_shortcodes $sc */
$sc = e107::getScBatch('download',true);
$sc->wrapper('download/categories');
$sc->breadcrumb();
$sc->qry = $this->qry;
@@ -311,6 +316,7 @@ class download
if ($dlcat->down_count == 0)
{
return $ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, "<div class='alert alert-warning' style='text-align:center'>".LAN_NO_RECORDS_FOUND."</div>",'download-categories',true);
}
@@ -498,8 +504,10 @@ class download
$sql = e107::getDb();
$gen = new convert;
/** @var download_shortcodes $sc */
$sc = e107::getScBatch('download',true);
$sc->wrapper('download/view');
$sc->breadcrumb();
$sc->qry = $this->qry;
$highlight_search = FALSE;
@@ -539,6 +547,8 @@ class download
$sc->setVars($dlrow);
$this->setMeta($dlrow);
$this->sc = $sc;
$this->rows = $dlrow;
@@ -561,7 +571,9 @@ class download
$tp = e107::getParser();
$ns = e107::getRender();
/** @var download_shortcodes $sc */
$sc = $this->sc;
$sc->breadcrumb();
// @see: #3056 fixes fatal error in case $sc is empty (what happens, if no record was found)
$count = empty($sc) ? 0 : $sc->getVars();
@@ -660,9 +672,11 @@ class download
$ns = e107::getRender();
$pref = e107::getPref();
// $sc = new download_shortcodes;
/** @var download_shortcodes $sc */
$sc = e107::getScBatch('download',true);
$sc->wrapper('download/list');
$sc->qry = $this->qry;
@@ -686,6 +700,8 @@ class download
$sc->grandparent = $this->getParent( $sc->parent['download_category_id']);
}
$sc->breadcrumb();
// $type = $dlrow['download_category_name'];
@@ -900,6 +916,8 @@ class download
$breadcrumb[] = array('text' => $dlrow['download_name'], 'url' => e107::url('download','item', $dlrow)); //e_SELF."?action=view&id=".$dlrow['download_id']);
$breadcrumb[] = array('text' => LAN_dl_45, 'url' => null);
e107::breadcrumb($breadcrumb);
if (isset($_POST['report_download']))
{
$report_add = $tp->toDB($_POST['report_add']);
@@ -995,8 +1013,10 @@ class download
}
/** @var download_shortcodes $sc */
$sc = e107::getScBatch('download',true);
$sc->wrapper('download/mirror');
$sc->breadcrumb();
$sc->qry = $this->qry;
// $load_template = 'download_template';