use Friendica\Content\ContactSelector;
use Friendica\Content\Feature;
use Friendica\Core\Addon;
+use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
+use Friendica\Util\DateTimeFormat;
use Friendica\Util\Temporal;
use dba;
}
// Prepare the children
- if (count($data['children'])) {
+ if (!empty($data['children'])) {
foreach ($data['children'] as $item) {
// Only add will be displayed
if ($item['network'] === NETWORK_MAIL && local_user() != $item['uid']) {
if (strtotime($item['edited']) - strtotime($item['created']) > 1) {
$edited = [
'label' => L10n::t('This entry was edited'),
- 'date' => Temporal::local($item['edited'], 'r'),
- 'relative' => relative_date($item['edited'])
+ 'date' => DateTimeFormat::local($item['edited'], 'r'),
+ 'relative' => Temporal::getRelativeDate($item['edited'])
];
}
$commentww = '';
$comment = $this->getCommentBox($indent);
- if (strcmp(Temporal::utc($item['created']), Temporal::utc('now - 12 hours')) > 0) {
+ if (strcmp(DateTimeFormat::utc($item['created']), DateTimeFormat::utc('now - 12 hours')) > 0) {
$shiny = 'shiny';
}
$body_e = $body;
$text_e = strip_tags($body);
$name_e = $profile_name;
- $title_e = $item['title'];
+
+ if (!empty($item['content-warning']) && PConfig::get(local_user(), 'system', 'disable_cw', false)) {
+ $title_e = ucfirst($item['content-warning']);
+ } else {
+ $title_e = $item['title'];
+ }
+
$location_e = $location;
$owner_name_e = $this->getOwnerName();
$tmp_item = [
'template' => $this->getTemplate(),
'type' => implode("", array_slice(explode("/", $item['verb']), -1)),
+ 'suppress_tags' => Config::get('system', 'suppress_tags'),
'tags' => $item['tags'],
'hashtags' => $item['hashtags'],
'mentions' => $item['mentions'],
'osparkle' => $osparkle,
'sparkle' => $sparkle,
'title' => $title_e,
- 'localtime' => Temporal::local($item['created'], 'r'),
- 'ago' => $item['app'] ? L10n::t('%s from %s', relative_date($item['created']), $item['app']) : relative_date($item['created']),
+ 'localtime' => DateTimeFormat::local($item['created'], 'r'),
+ 'ago' => $item['app'] ? L10n::t('%s from %s', Temporal::getRelativeDate($item['created']), $item['app']) : Temporal::getRelativeDate($item['created']),
'app' => $item['app'],
- 'created' => relative_date($item['created']),
+ 'created' => Temporal::getRelativeDate($item['created']),
'lock' => $lock,
'location' => $location_e,
'indent' => $indent,