/**
* @file mod/network.php
*/
+
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Content\ForumManager;
use Friendica\Content\Widget;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Group;
use Friendica\Model\Profile;
use Friendica\Module\Login;
+use Friendica\Util\DateTimeFormat;
require_once 'include/conversation.php';
require_once 'include/items.php';
function network_init(App $a)
{
if (!local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
'id' => $rr['id'],
'term' => $rr['term'],
'encodedterm' => urlencode($rr['term']),
- 'delete' => t('Remove term'),
+ 'delete' => L10n::t('Remove term'),
'selected' => ($search == $rr['term']),
];
}
$tpl = get_markup_template('saved_searches_aside.tpl');
$o = replace_macros($tpl, [
- '$title' => t('Saved Searches'),
- '$add' => t('add'),
+ '$title' => L10n::t('Saved Searches'),
+ '$add' => L10n::t('add'),
'$searchbox' => search($search, 'netsearch-box', $srchurl, true),
'$saved' => $saved,
]);
if ($gid) {
if (($t = Contact::getOStatusCountByGroupId($gid)) && !PConfig::get(local_user(), 'system', 'nowarn_insecure')) {
- notice(tt("Warning: This group contains %s member from a network that doesn't allow non public messages.",
- "Warning: This group contains %s members from a network that doesn't allow non public messages.", $t) . EOL);
- notice(t("Messages in this group won't be send to these receivers.") . EOL);
+ notice(L10n::tt("Warning: This group contains %s member from a network that doesn't allow non public messages.",
+ "Warning: This group contains %s members from a network that doesn't allow non public messages.",
+ $t) . EOL);
+ notice(L10n::t("Messages in this group won't be send to these receivers.").EOL);
}
}
if ($update) {
killme();
}
- notice(t('No such group') . EOL);
+ notice(L10n::t('No such group') . EOL);
goaway('network/0');
// NOTREACHED
}
$sql_extra3 .= " OR (`thread`.`contact-id` = '$contact_str_self' AND `temp1`.`allow_gid` LIKE '" . protect_sprintf('%<' . intval($gid) . '>%') . "' AND `temp1`.`private`))";
} else {
$sql_extra3 .= " AND false ";
- info(t('Group is empty'));
+ info(L10n::t('Group is empty'));
}
$o = replace_macros(get_markup_template('section_title.tpl'), [
- '$title' => t('Group: %s', $group['name'])
+ '$title' => L10n::t('Group: %s', $group['name'])
]) . $o;
} elseif ($cid) {
$fields = ['id', 'name', 'network', 'writable', 'nurl',
'id' => 'network',
]) . $o;
- if ($contact['network'] === NETWORK_OSTATUS && $contact['writable'] && !PConfig::get(local_user(), 'system',
- 'nowarn_insecure')) {
- notice(t('Private messages to this person are at risk of public disclosure.') . EOL);
+ if ($contact['network'] === NETWORK_OSTATUS && $contact['writable'] && !PConfig::get(local_user(),'system','nowarn_insecure')) {
+ notice(L10n::t('Private messages to this person are at risk of public disclosure.') . EOL);
}
} else {
- notice(t('Invalid contact.') . EOL);
+ notice(L10n::t('Invalid contact.') . EOL);
goaway('network');
// NOTREACHED
}
if ($datequery) {
$sql_extra3 .= protect_sprintf(sprintf(" AND $sql_table.created <= '%s' ",
- dbesc(datetime_convert(date_default_timezone_get(), '', $datequery))));
+ dbesc(DateTimeFormat::convert($datequery, 'UTC', date_default_timezone_get()))));
}
if ($datequery2) {
$sql_extra3 .= protect_sprintf(sprintf(" AND $sql_table.created >= '%s' ",
- dbesc(datetime_convert(date_default_timezone_get(), '', $datequery2))));
+ dbesc(DateTimeFormat::convert($datequery2, 'UTC', date_default_timezone_get()))));
}
$sql_order = '';
}
// Only show it when unfiltered (no groups, no networks, ...)
- if (Config::get('system', 'comment_public') && in_array($nets, ['', NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS]) && (strlen($sql_extra . $sql_extra2 . $sql_extra3) == 0)) {
+ if (in_array($nets, ['', NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS]) && (strlen($sql_extra . $sql_extra2 . $sql_extra3) == 0)) {
if (DBM::is_result($r)) {
$top_limit = current($r)['order_date'];
$bottom_limit = end($r)['order_date'];
} else {
- $top_limit = datetime_convert();
- $bottom_limit = datetime_convert();
+ $top_limit = DateTimeFormat::utcNow();
+ $bottom_limit = DateTimeFormat::utcNow();
}
// When checking for updates we need to fetch from the newest date to the newest date before
$top_limit = $last_date;
} elseif ($a->pager['page'] == 1) {
// Highest possible top limit when we are on the first page
- $top_limit = datetime_convert();
+ $top_limit = DateTimeFormat::utcNow();
}
$items = dba::p("SELECT `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`uid` AS `contact_uid` FROM `item`
// tabs
$tabs = [
[
- 'label' => t('Commented Order'),
+ 'label' => L10n::t('Commented Order'),
'url' => str_replace('/new', '', $cmd) . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
'sel' => $all_active,
- 'title' => t('Sort by Comment Date'),
+ 'title' => L10n::t('Sort by Comment Date'),
'id' => 'commented-order-tab',
'accesskey' => 'e',
],
[
- 'label' => t('Posted Order'),
+ 'label' => L10n::t('Posted Order'),
'url' => str_replace('/new', '', $cmd) . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
'sel' => $postord_active,
- 'title' => t('Sort by Post Date'),
+ 'title' => L10n::t('Sort by Post Date'),
'id' => 'posted-order-tab',
'accesskey' => 't',
],
if (Feature::isEnabled(local_user(), 'personal_tab')) {
$tabs[] = [
- 'label' => t('Personal'),
+ 'label' => L10n::t('Personal'),
'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&conv=1',
'sel' => $conv_active,
- 'title' => t('Posts that mention or involve you'),
+ 'title' => L10n::t('Posts that mention or involve you'),
'id' => 'personal-tab',
'accesskey' => 'r',
];
if (Feature::isEnabled(local_user(), 'new_tab')) {
$tabs[] = [
- 'label' => t('New'),
+ 'label' => L10n::t('New'),
'url' => 'network/new' . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : ''),
'sel' => $new_active,
- 'title' => t('Activity Stream - by date'),
+ 'title' => L10n::t('Activity Stream - by date'),
'id' => 'activitiy-by-date-tab',
'accesskey' => 'w',
];
if (Feature::isEnabled(local_user(), 'link_tab')) {
$tabs[] = [
- 'label' => t('Shared Links'),
+ 'label' => L10n::t('Shared Links'),
'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&bmark=1',
'sel' => $bookmarked_active,
- 'title' => t('Interesting Links'),
+ 'title' => L10n::t('Interesting Links'),
'id' => 'shared-links-tab',
'accesskey' => 'b',
];
if (Feature::isEnabled(local_user(), 'star_posts')) {
$tabs[] = [
- 'label' => t('Starred'),
+ 'label' => L10n::t('Starred'),
'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&star=1',
'sel' => $starred_active,
- 'title' => t('Favourite Posts'),
+ 'title' => L10n::t('Favourite Posts'),
'id' => 'starred-posts-tab',
'accesskey' => 'm',
];