mirror of
https://github.com/e107inc/e107.git
synced 2025-08-07 23:26:41 +02:00
Fixed URL on {CHAPTER_BUTTON}
This commit is contained in:
@@ -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
|
class cpage_shortcodes extends e_shortcode
|
||||||
{
|
{
|
||||||
// var $var; // parsed DB values
|
// var $var; // parsed DB values
|
||||||
@@ -369,18 +367,22 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
// -------------------- Chapter - specific to the current page. -------------------------
|
// -------------------- Chapter - specific to the current page. -------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @example {CHAPTER_NAME}
|
||||||
|
*/
|
||||||
function sc_chapter_name()
|
function sc_chapter_name()
|
||||||
{
|
{
|
||||||
|
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$row = $this->getChapter();
|
$row = $this->getChapter();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return $tp->toHtml($row['chapter_name'], false, 'TITLE');
|
return $tp->toHtml($row['chapter_name'], false, 'TITLE');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @example {CHAPTER_ANCHOR}
|
||||||
|
*/
|
||||||
function sc_chapter_anchor()
|
function sc_chapter_anchor()
|
||||||
{
|
{
|
||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
@@ -389,6 +391,9 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
return $frm->name2id($row['chapter_name']);
|
return $frm->name2id($row['chapter_name']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @example {CHAPTER_ICON}
|
||||||
|
*/
|
||||||
function sc_chapter_icon()
|
function sc_chapter_icon()
|
||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
@@ -397,6 +402,9 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
return $tp->toIcon($row['chapter_icon']);
|
return $tp->toIcon($row['chapter_icon']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @example {CHAPTER_DESCRIPTION}
|
||||||
|
*/
|
||||||
function sc_chapter_description()
|
function sc_chapter_description()
|
||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
@@ -405,6 +413,9 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
return $tp->toHtml($row['chapter_meta_description'], true, 'BODY');
|
return $tp->toHtml($row['chapter_meta_description'], true, 'BODY');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @example {CHAPTER_URL}
|
||||||
|
*/
|
||||||
function sc_chapter_url()
|
function sc_chapter_url()
|
||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
$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)
|
function sc_chapter_button($options)
|
||||||
{
|
{
|
||||||
$text = vartrue($options['text'], LAN_READ_MORE);
|
$text = vartrue($options['text'], LAN_READ_MORE);
|
||||||
$size = vartrue($options['size'], "");
|
$size = vartrue($options['size'], "");
|
||||||
$inc = ($size) ? " btn-".$size : "";
|
$inc = ($size) ? " btn-".$size : "";
|
||||||
|
$url = $this->sc_chapter_url();
|
||||||
|
|
||||||
return '<a class="cpage btn btn-primary btn-chapter'.$inc.'" href="'.$url.'">'.$text.'</a>';
|
return '<a class="cpage btn btn-primary btn-chapter'.$inc.'" href="'.$url.'">'.$text.'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @example {CPAGERELATED: types=news}
|
||||||
|
*/
|
||||||
function sc_cpagerelated($array=array())
|
function sc_cpagerelated($array=array())
|
||||||
{
|
{
|
||||||
if(!varset($array['types']))
|
if(!varset($array['types']))
|
||||||
|
Reference in New Issue
Block a user