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:
@@ -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 .= "{CPAGEFIELDTITLE: name=".$ok."}\n";
|
||||
$text .= "{CPAGEFIELD: name=".$ok."}\n";
|
||||
}
|
||||
|
||||
$text .= "</pre>";
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$text = '<table class="table table-bordered table-striped">
|
||||
<tr><th>Name</th><th>Title<br /><small>{CPAGEFIELDTITLE: name=x}</small></th><th>Normal<br /><small>{CPAGEFIELD: name=x}</small></th><th>Raw<br /><small>{CPAGEFIELD: name=x&mode=raw}</small></th></tr>';
|
||||
|
Reference in New Issue
Block a user