mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-22 22:37:37 +01:00
Miglioramento del sistema di conversione automatica
Miglioramento del sistema di conversione automatica dei formati dell'input. Aggiunta condizione di fallback per i tag personalizzati, per cui se il contenuto non viene renderizzato viene mostrato il codice responsabile del "malfunzionamento" (per rendere più semplice l'individuazione del problema).
This commit is contained in:
parent
88d3e6d645
commit
48cff7f7fd
@ -26,7 +26,7 @@ switch (post('op')) {
|
||||
$avere = $post['avere'][$i];
|
||||
|
||||
if (!empty($dare) || !empty($avere)) {
|
||||
if (is_float($avere)) {
|
||||
if (!empty($avere)) {
|
||||
$totale = -$avere;
|
||||
} else {
|
||||
$totale = $dare;
|
||||
|
@ -94,14 +94,18 @@ class HTMLBuilder
|
||||
$json = self::decode($value, 'manager');
|
||||
$class = self::getManager($json['name']);
|
||||
|
||||
$html = str_replace($value, !empty($class) ? $class->manage($json) : '', $html);
|
||||
$result = !empty($class) ? $class->manage($json) : '';
|
||||
|
||||
$html = str_replace($value, !empty($result) ? $result : $value, $html);
|
||||
}
|
||||
|
||||
preg_match_all('/'.preg_quote(self::$open['handler']).'(.+?)'.preg_quote(self::$close['handler']).'/is', $html, $handlers);
|
||||
|
||||
foreach ($handlers[0] as $value) {
|
||||
$json = self::decode($value, 'handler');
|
||||
$html = str_replace($value, self::generate($json), $html);
|
||||
$result = self::generate($json);
|
||||
|
||||
$html = str_replace($value, !empty($result) ? $result : $value, $html);
|
||||
}
|
||||
|
||||
return $html;
|
||||
@ -396,15 +400,3 @@ class HTMLBuilder
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Predispone un testo per l'inserimento all'interno di un attributo HTML.
|
||||
*
|
||||
* @param string $string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function prepareToField($string)
|
||||
{
|
||||
return str_replace('"', '"', $string);
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ class Formatter
|
||||
{
|
||||
$result = $this->formatNumber($value);
|
||||
|
||||
return !empty($result);
|
||||
return !is_bool($result);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -192,7 +192,7 @@ class Formatter
|
||||
{
|
||||
$result = $this->parseNumber($value);
|
||||
|
||||
return !empty($result);
|
||||
return !is_bool($result);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -343,7 +343,7 @@ class Formatter
|
||||
{
|
||||
$result = $this->formatTimestamp($value);
|
||||
|
||||
return !empty($result);
|
||||
return !is_bool($result);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -357,7 +357,7 @@ class Formatter
|
||||
{
|
||||
$result = $this->parseTimestamp($value);
|
||||
|
||||
return !empty($result);
|
||||
return !is_bool($result);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -427,7 +427,7 @@ class Formatter
|
||||
{
|
||||
$result = $this->formatDate($value);
|
||||
|
||||
return !empty($result);
|
||||
return !is_bool($result);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -441,7 +441,7 @@ class Formatter
|
||||
{
|
||||
$result = $this->parseDate($value);
|
||||
|
||||
return !empty($result);
|
||||
return !is_bool($result);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -511,7 +511,7 @@ class Formatter
|
||||
{
|
||||
$result = $this->formatTime($value);
|
||||
|
||||
return !empty($result);
|
||||
return !is_bool($result);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -525,7 +525,7 @@ class Formatter
|
||||
{
|
||||
$result = $this->parseTime($value);
|
||||
|
||||
return !empty($result);
|
||||
return !is_bool($result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user