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

Form Handler: renderElement() and renderValue() now support json values. (used by Pages/Menus custom fields)

This commit is contained in:
Cameron
2017-01-22 13:31:03 -08:00
parent 3e9624be81
commit 2c2b9d4091
4 changed files with 148 additions and 22 deletions

View File

@@ -652,6 +652,9 @@ class cpage_shortcodes extends e_shortcode
$fieldType = $fields[$key]['type'];
// print_a($fields);
// @todo Move this part to form_handler or e_parse somewhere.
if(isset($fieldData[$key]))
@@ -660,6 +663,12 @@ class cpage_shortcodes extends e_shortcode
switch($fieldType)
{
case "dropdown":
case "checkboxes":
case "radio":
return ($raw) ? $value : e107::getForm()->renderValue($key,$value,$fields[$key]);
break;
case "image":
return ($raw) ? $tp->thumbUrl($value) : $tp->toImage($value);
break;
@@ -728,6 +737,7 @@ class cpage_shortcodes extends e_shortcode
{
$fieldData = e107::unserialize($this->var['page_fields']);
$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>';