'int']; $cleanTokens = []; foreach ($tokens as $token) { $tL = strtolower($token); if (in_array($tL, ['int', 'float1', 'float2', 'float3', 'float4', 'finance', 'percent'])) { $config['format'] = $tL; } else { $cleanTokens[] = $token; } } $jsonConfig = json_encode($config); $jsonTokens = json_encode($cleanTokens); $uniqueId = 'tblc_' . uniqid(); $js = " "; return keep($js); } function RunTblCalcInputJS($m) { $raw = preg_replace('/\\s*:?\\)$/', '', trim($m[1])); $raw = str_replace(chr(194).chr(160), ' ', $raw); $args = []; preg_match_all('/(\w+)=("[^"]*"|\'[^\']*\'|\S+)/', $raw, $matches, PREG_SET_ORDER); foreach ($matches as $match) { $key = strtolower($match[1]); $val = trim($match[2], " \"'"); $args[$key] = $val; } $name = $args['name'] ?? 'NONE'; if (strpos($name, 'tblcalc_') !== 0) { return keep("tblcalc input name must start with 'tblcalc_' - the current name is '$name'."); } $type = strtolower($args['type'] ?? 'finance'); $default = str_replace(['$', ',', '%'], '', ($args['default'] ?? '0')); $caption = $args['caption'] ?? 'Input'; $totalWidth = $args['width'] ?? '320px'; $totalHeight = $args['height'] ?? 'auto'; $inputWidth = $args['inputwidth'] ?? '140px'; $inputHeight = $args['inputheight'] ?? 'auto'; $id = 'tinp_' . uniqid(); $js = "