From 62a726e2747fd1967cd6fdf9067406a271795037 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 20 Jan 2017 13:43:20 -0800 Subject: [PATCH] {LINK_TARGET} added for use by scrollspy. --- e107_handlers/sitelinks_class.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/e107_handlers/sitelinks_class.php b/e107_handlers/sitelinks_class.php index c5449c7a5..f657a5138 100644 --- a/e107_handlers/sitelinks_class.php +++ b/e107_handlers/sitelinks_class.php @@ -1781,6 +1781,26 @@ class navigation_shortcodes extends e_shortcode return $url; } + + + /** + * Returns only the anchor target in the URL if one is found. + * @param null $parm + * @return null|string + */ + function sc_link_target($parm=null) + { + if(strpos($this->var['link_url'],'#')!==false) + { + list($tmp,$segment) = explode('#',$this->var['link_url'],2); + return '#'.$segment; + + } + + return '#'; + } + + function sc_link_open($parm = '') {