Fix per funzionamento campi personalizzati

This commit is contained in:
loviuz 2023-12-05 18:04:50 +01:00
parent bff0ddf748
commit 7faaf50888
2 changed files with 9 additions and 1 deletions

View File

@ -168,6 +168,8 @@ class HTMLBuilder
$result = self::replace($result, $depth + 1); $result = self::replace($result, $depth + 1);
} }
$html = str_replace($value, !empty($result) ? $result : $value, $html); $html = str_replace($value, !empty($result) ? $result : $value, $html);
} }
@ -197,6 +199,8 @@ class HTMLBuilder
// Ricorsione // Ricorsione
$result = self::replace($result); $result = self::replace($result);
print_r($json);
return !empty($result) ? $result : json_encode($json); return !empty($result) ? $result : json_encode($json);
} }
@ -374,7 +378,7 @@ class HTMLBuilder
* *
* @return array * @return array
*/ */
protected static function decode($string, $type) public static function decode($string, $type)
{ {
$string = '{'.substr($string, strlen(self::$open[$type]), -strlen(self::$close[$type])).'}'; $string = '{'.substr($string, strlen(self::$open[$type]), -strlen(self::$close[$type])).'}';

View File

@ -101,6 +101,10 @@ class FieldManager implements ManagerInterface
$result .= ' $result .= '
</div>'; </div>';
} }
// Forzatura inizializzazione componente
$component = \HTMLBuilder\HTMLBuilder::decode($field['content'], 'manager');
$result .= '<script>$(document).ready( function(){ input("#'.$component['name'].'").init(); });</script>';
} }
if (($key + 1) % 3 != 0) { if (($key + 1) % 3 != 0) {