1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-20 05:11:42 +02:00

Custom page template for bootstrap3 to demonstrate custom-field usage.

This commit is contained in:
Cameron
2018-08-14 17:53:27 -07:00
parent 3120e00270
commit 5cbe8df761
2 changed files with 244 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ class cpage_shortcodes extends e_shortcode
{
// var $var; // parsed DB values
private $chapterData = array();
private $cpageFieldName = null;
// Grab all book/chapter data.
function __construct()
@@ -602,7 +603,7 @@ class cpage_shortcodes extends e_shortcode
if(empty($brow['chapter_sef']))
{
return;
return null;
}
$row['book_sef'] = vartrue($brow['chapter_sef'],"no-sef-found"); //$this->getBook();
@@ -672,6 +673,8 @@ class cpage_shortcodes extends e_shortcode
function sc_cpagefieldtitle($parm=null)
{
$this->cpageFieldName = null;
if(empty($parm['name']) || empty($this->var['page_fields']))
{
return null;
@@ -680,6 +683,8 @@ class cpage_shortcodes extends e_shortcode
$chap = $this->var['page_chapter'];
$key = $parm['name'];
$this->cpageFieldName = $key;
$arr = array('name'=>$parm['name']);
$value = $this->sc_cpagefield($arr);
@@ -712,11 +717,15 @@ class cpage_shortcodes extends e_shortcode
*/
function sc_cpagefield($parm=null)
{
$this->cpageFieldName = null;
if(empty($parm['name']) || empty($this->var['page_fields']))
{
return null;
}
$this->cpageFieldName = $parm['name'];
$chap = $this->var['page_chapter'];
$fields = $this->chapterData[$chap]['chapter_fields'];
@@ -725,6 +734,15 @@ class cpage_shortcodes extends e_shortcode
}
/**
* Return the last custom-page field name used.
* @return string|null
*/
function sc_cpagefieldname()
{
return $this->cpageFieldName;
}
/**
* @experimental - subject to change without notice. Use at own risk.