From 9c729df9c7d56022949d0cb6719fe77a09ae7c0d Mon Sep 17 00:00:00 2001 From: Jimako Date: Sat, 1 Apr 2017 21:51:31 +0200 Subject: [PATCH] possibility to format page button shortcode --- e107_core/shortcodes/batch/page_shortcodes.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/e107_core/shortcodes/batch/page_shortcodes.php b/e107_core/shortcodes/batch/page_shortcodes.php index 4d61f86b6..fd093e1bd 100644 --- a/e107_core/shortcodes/batch/page_shortcodes.php +++ b/e107_core/shortcodes/batch/page_shortcodes.php @@ -249,6 +249,12 @@ class cpage_shortcodes extends e_shortcode return ''.$this->sc_cpagetitle().''; } + /** + * @param null $parm + * @example {CPAGEBUTTON} + * @example {CPAGEBUTTON: class=btn large default mb&target=blank} + * @return string + */ function sc_cpagebutton($parm) { $tp = e107::getParser(); @@ -290,7 +296,10 @@ class cpage_shortcodes extends e_shortcode $inc = ($size) ? " btn-".$size : ""; - return ''.$text.''; + $class = (!empty($options['class'])) ? $options['class'] : 'cpage btn btn-primary btn-cpage'; + $buttonTarget = (!empty($options['target'])) ? ' target="'.$options['target'].'" ' : $buttonTarget; + + return ''.$text.''; }