From 86bf8de5bfd5bfdc3bc5708e611f58f3fe7bbcad Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 13 Jun 2014 04:19:09 -0700 Subject: [PATCH] Fixed URL on {CHAPTER_BUTTON} --- .../shortcodes/batch/page_shortcodes.php | 37 ++++++++++++++----- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/e107_core/shortcodes/batch/page_shortcodes.php b/e107_core/shortcodes/batch/page_shortcodes.php index e1c3b85a3..5feb2d43d 100644 --- a/e107_core/shortcodes/batch/page_shortcodes.php +++ b/e107_core/shortcodes/batch/page_shortcodes.php @@ -17,8 +17,6 @@ if (!defined('e107_INIT')) { exit; } */ -// XXX FIXME All shortcodes should return a value from $this->var. - class cpage_shortcodes extends e_shortcode { // var $var; // parsed DB values @@ -369,18 +367,22 @@ class cpage_shortcodes extends e_shortcode // -------------------- Chapter - specific to the current page. ------------------------- - + /** + * @example {CHAPTER_NAME} + */ function sc_chapter_name() { $tp = e107::getParser(); $row = $this->getChapter(); - - return $tp->toHtml($row['chapter_name'], false, 'TITLE'); } - + + + /** + * @example {CHAPTER_ANCHOR} + */ function sc_chapter_anchor() { $frm = e107::getForm(); @@ -388,7 +390,10 @@ class cpage_shortcodes extends e_shortcode return $frm->name2id($row['chapter_name']); } - + + /** + * @example {CHAPTER_ICON} + */ function sc_chapter_icon() { $tp = e107::getParser(); @@ -396,7 +401,10 @@ class cpage_shortcodes extends e_shortcode return $tp->toIcon($row['chapter_icon']); } - + + /** + * @example {CHAPTER_DESCRIPTION} + */ function sc_chapter_description() { $tp = e107::getParser(); @@ -404,7 +412,10 @@ class cpage_shortcodes extends e_shortcode return $tp->toHtml($row['chapter_meta_description'], true, 'BODY'); } - + + /** + * @example {CHAPTER_URL} + */ function sc_chapter_url() { $tp = e107::getParser(); @@ -417,16 +428,22 @@ class cpage_shortcodes extends e_shortcode } + /** + * @example {CHAPTER_BUTTON: text=More&size=sm} + */ function sc_chapter_button($options) { $text = vartrue($options['text'], LAN_READ_MORE); $size = vartrue($options['size'], ""); $inc = ($size) ? " btn-".$size : ""; + $url = $this->sc_chapter_url(); return ''.$text.''; } - + /** + * @example {CPAGERELATED: types=news} + */ function sc_cpagerelated($array=array()) { if(!varset($array['types']))