X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FTemporal.php;h=44b9601164fadd92bb194ddc04759c7b87800291;hb=5a3991d4f7bc929c1087d9275716fc1c8cc299a6;hp=bc7639b3b740f102b2f6b32e162413c1e961f7ca;hpb=ebc97ba8fe80442ca817bfe8f79b32588c2573ef;p=friendica.git diff --git a/src/Util/Temporal.php b/src/Util/Temporal.php index bc7639b3b7..44b9601164 100644 --- a/src/Util/Temporal.php +++ b/src/Util/Temporal.php @@ -11,6 +11,7 @@ use DateTimeZone; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; +use Friendica\Core\Renderer; use Friendica\Database\DBA; require_once 'boot.php'; @@ -114,8 +115,8 @@ class Temporal $options = str_replace('', '', $options); - $tpl = get_markup_template('field_select_raw.tpl'); - return replace_macros($tpl, [ + $tpl = Renderer::getMarkupTemplate('field_select_raw.tpl'); + return Renderer::replaceMacros($tpl, [ '$field' => [$name, $label, $current, $help, $options], ]); } @@ -140,8 +141,8 @@ class Temporal $age = (intval($value) ? self::getAgeByTimezone($value, $a->user["timezone"], $a->user["timezone"]) : ""); - $tpl = get_markup_template("field_input.tpl"); - $o = replace_macros($tpl, + $tpl = Renderer::getMarkupTemplate("field_input.tpl"); + $o = Renderer::replaceMacros($tpl, [ '$field' => [ 'dob', @@ -246,8 +247,8 @@ class Temporal $readable_format = str_replace(['Y', 'm', 'd', 'H', 'i'], ['yyyy', 'mm', 'dd', 'HH', 'MM'], $dateformat); - $tpl = get_markup_template('field_datetime.tpl'); - $o .= replace_macros($tpl, [ + $tpl = Renderer::getMarkupTemplate('field_datetime.tpl'); + $o .= Renderer::replaceMacros($tpl, [ '$field' => [ $id, $label, @@ -462,11 +463,11 @@ class Temporal $tddate = intval(DateTimeFormat::localNow('j')); } - $str_month = day_translate($mtab[$m]); + $str_month = L10n::getDay($mtab[$m]); $o = ''; $o .= ""; for ($a = 0; $a < 7; $a ++) { - $o .= ''; + $o .= ''; } $o .= ''; @@ -480,7 +481,7 @@ class Temporal $o .= "
$str_month $y
' . mb_substr(day_translate($dn[$a]), 0, 3, 'UTF-8') . '' . mb_substr(L10n::getDay($dn[$a]), 0, 3, 'UTF-8') . '
"; $day = str_replace(' ', ' ', sprintf('%2.2d', $d)); if ($started) { - if (x($links, $d) !== false) { + if (isset($links[$d])) { $o .= "$day"; } else { $o .= $day;