1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

Closes #638 - {BOOK_ID}, {CHAPTER_ID} and {BOOK_URL} shortcodes added to pages.

This commit is contained in:
Cameron
2014-06-16 15:05:45 -07:00
parent 150689482a
commit 4f264a8563

View File

@@ -328,9 +328,19 @@ class cpage_shortcodes extends e_shortcode
{
return vartrue($this->var['page_sef'],'page-no-sef');
}
// -------------------- Book - specific to the current page. -------------------------
function sc_book_id()
{
$frm = e107::getForm();
$row = $this->getBook();
return $row['chapter_id'];
}
function sc_book_name()
{
$tp = e107::getParser();
@@ -363,10 +373,25 @@ class cpage_shortcodes extends e_shortcode
return $tp->toHtml($row['chapter_meta_description'], true, 'BODY');
}
function sc_book_url()
{
$row = $this->getBook();
return e107::getUrl()->create('page/book/index', $row,'allow=chapter_id,chapter_sef,book_sef') ;
}
// -------------------- Chapter - specific to the current page. -------------------------
/**
* @example {CHAPTER_ID}
*/
function sc_chapter_id()
{
$row = $this->getChapter();
return $row['chapter_id'];
}
/**
* @example {CHAPTER_NAME}
*/