1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-22 14:13:03 +02:00

Issue #3103 Default custom-fields page example added to bootstrap3 install. Custom-fields class tweaked.

This commit is contained in:
Cameron
2018-08-14 17:06:02 -07:00
parent a7ab8a7a62
commit 5a31146fcc
4 changed files with 250 additions and 9 deletions

View File

@@ -680,6 +680,14 @@ class cpage_shortcodes extends e_shortcode
$chap = $this->var['page_chapter'];
$key = $parm['name'];
$arr = array('name'=>$parm['name']);
$value = $this->sc_cpagefield($arr);
if(empty($value) && !isset($parm['force']))
{
return null;
}
if(!empty($this->chapterData[$chap]['chapter_fields']) && is_string($this->chapterData[$chap]['chapter_fields']))
{
@@ -727,6 +735,23 @@ class cpage_shortcodes extends e_shortcode
{
$fieldData = e107::unserialize($this->var['page_fields']);
if(isset($parm['generate'])) // use to generate all fields for use in template file.
{
$text = '<pre>';
foreach($fieldData as $ok=>$v)
{
$text .= "&#123;CPAGEFIELDTITLE: name=".$ok."&#125;\n";
$text .= "&#123;CPAGEFIELD: name=".$ok."&#125;\n";
}
$text .= "</pre>";
return $text;
}
$text = '<table class="table table-bordered table-striped">
<tr><th>Name</th><th>Title<br /><small>&#123;CPAGEFIELDTITLE: name=x&#125;</small></th><th>Normal<br /><small>&#123;CPAGEFIELD: name=x&#125;</small></th><th>Raw<br /><small>&#123;CPAGEFIELD: name=x&mode=raw&#125;</small></th></tr>';