diff --git a/e107_core/shortcodes/batch/page_shortcodes.php b/e107_core/shortcodes/batch/page_shortcodes.php index 7b1e5dd3b..2251b3264 100644 --- a/e107_core/shortcodes/batch/page_shortcodes.php +++ b/e107_core/shortcodes/batch/page_shortcodes.php @@ -685,6 +685,10 @@ class cpage_shortcodes extends e_shortcode return ($raw) ? $value : $tp->toDate($value); break; + case "file": + return ($raw) ? $tp->toFile($value, array('raw'=>1)) : $tp->toFile($value); + break; + case "url": case "email": return ($raw) ? $value : $tp->toHtml($value); diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 407807530..3babb048f 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -3669,9 +3669,16 @@ class e_parser * @param $text * @return string */ - public function toFile($text) + public function toFile($text, $parm=array()) { + $link = e_HTTP."request.php?".str_replace('{e_MEDIA_FILE}', '',$text); + if(!empty($parm['raw'])) + { + return $link; + } + + return "-attachment-"; //TODO Add pref for this. } /**