From c96053cbbab99b07464b1ce58b3fe7ffae77e2ab Mon Sep 17 00:00:00 2001 From: Tijn Kuyper Date: Thu, 31 Oct 2019 12:14:07 +0100 Subject: [PATCH] Closes #3864 - Added raw option for {DOWNLOAD_CAT_SUB_NAME} and {DOWNLOAD_CAT_SUBSUB_NAME} --- e107_plugins/download/download_shortcodes.php | 71 +++++++++++-------- 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/e107_plugins/download/download_shortcodes.php b/e107_plugins/download/download_shortcodes.php index eb0bd3408..58f4b6cef 100644 --- a/e107_plugins/download/download_shortcodes.php +++ b/e107_plugins/download/download_shortcodes.php @@ -142,26 +142,31 @@ class download_shortcodes extends e_shortcode } // Sub-Category ******************************************************************************** - function sc_download_cat_sub_name() - { - $tp = e107::getParser(); + function sc_download_cat_sub_name($parm = '') + { + $tp = e107::getParser(); - $class = 'category-name'; - $class .= $this->isNewDownload($this->dlsubrow['d_last']) ? ' new' : ''; + $class = 'category-name'; + $class .= $this->isNewDownload($this->dlsubrow['d_last']) ? ' new' : ''; + + if($parm == 'raw') + { + return $tp->toHTML($this->dlsubrow['download_category_name'], FALSE, 'TITLE'); + } - if ($this->dlsubrow['d_count']) - { + if ($this->dlsubrow['d_count']) + { - $url = e107::url('download', 'category', $this->dlsubrow); - return "".$tp->toHTML($this->dlsubrow['download_category_name'], FALSE, 'TITLE').""; + $url = e107::url('download', 'category', $this->dlsubrow); + return "".$tp->toHTML($this->dlsubrow['download_category_name'], FALSE, 'TITLE').""; - // return "".$tp->toHTML($this->dlsubrow['download_category_name'], FALSE, 'TITLE').""; - } - else - { - return $tp->toHTML($this->dlsubrow['download_category_name'], FALSE, 'TITLE'); - } - } + // return "".$tp->toHTML($this->dlsubrow['download_category_name'], FALSE, 'TITLE').""; + } + else + { + return $tp->toHTML($this->dlsubrow['download_category_name'], FALSE, 'TITLE'); + } + } function sc_download_cat_sub_description() { @@ -198,24 +203,30 @@ class download_shortcodes extends e_shortcode // Sub-Sub-Category **************************************************************************** - function sc_download_cat_subsub_name() - { - - // isNewDownload + function sc_download_cat_subsub_name($parm = '') + { + $tp = e107::getParser(); + + // isNewDownload $class = 'category-name'; $class .= $this->isNewDownload($this->dlsubsubrow['d_last']) ? ' new' : ''; - $tp = e107::getParser(); - if ($this->dlsubsubrow['d_count']) - { - $url = e107::url('download', 'category', $this->dlsubsubrow); // /list/category', array('id'=>$this->dlsubsubrow['download_category_id'], 'name'=> vartrue($this->dlsubsubrow['download_category_sef'],'--sef-not-set--'))); + if($parm == 'raw') + { + return $tp->toHTML($this->dlsubsubrow['download_category_name'], FALSE, 'TITLE'); + } + + if ($this->dlsubsubrow['d_count']) + { + $url = e107::url('download', 'category', $this->dlsubsubrow); + // /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 "".$tp->toHTML($this->dlsubsubrow['download_category_name'], FALSE, 'TITLE').""; - } - else - { - return $tp->toHTML($this->dlsubsubrow['download_category_name'], FALSE, 'TITLE'); - } + return "".$tp->toHTML($this->dlsubsubrow['download_category_name'], FALSE, 'TITLE').""; + } + else + { + return $tp->toHTML($this->dlsubsubrow['download_category_name'], FALSE, 'TITLE'); + } } function sc_download_cat_subsub_description()