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

possibility to format page button shortcode

This commit is contained in:
Jimako
2017-04-01 21:51:31 +02:00
committed by GitHub
parent 68127bd72f
commit 9c729df9c7

View File

@@ -249,6 +249,12 @@ class cpage_shortcodes extends e_shortcode
return '<a class="cpage" href="'.$url.'">'.$this->sc_cpagetitle().'</a>';
}
/**
* @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 '<a class="cpage btn btn-primary btn-cpage'.$inc.'" href="'.$buttonUrl.'" '.$buttonTarget.'>'.$text.'</a>';
$class = (!empty($options['class'])) ? $options['class'] : 'cpage btn btn-primary btn-cpage';
$buttonTarget = (!empty($options['target'])) ? ' target="'.$options['target'].'" ' : $buttonTarget;
return '<a class="'.$class.' '.$inc.'" href="'.$buttonUrl.'" '.$buttonTarget.'>'.$text.'</a>';
}