1
0
Fork 0

Code style

This commit is contained in:
Michael 2021-09-24 04:35:27 +00:00
parent f696fce824
commit 64d181c1cc
2 changed files with 31 additions and 33 deletions

View file

@ -287,15 +287,15 @@ class Conversation
$this->profiler->startRecording('rendering'); $this->profiler->startRecording('rendering');
$o = ''; $o = '';
$x['allow_location'] = $x['allow_location'] ?? $user['allow_location']; $x['allow_location'] = $x['allow_location'] ?? $user['allow_location'];
$x['default_location'] = $x['default_location'] ?? $user['default-location']; $x['default_location'] = $x['default_location'] ?? $user['default-location'];
$x['nickname'] = $x['nickname'] ?? $user['nickname']; $x['nickname'] = $x['nickname'] ?? $user['nickname'];
$x['lockstate'] = $x['lockstate'] ?? ACL::getLockstateForUserId($user['uid']) ? 'lock' : 'unlock'; $x['lockstate'] = $x['lockstate'] ?? ACL::getLockstateForUserId($user['uid']) ? 'lock' : 'unlock';
$x['acl'] = $x['acl'] ?? ACL::getFullSelectorHTML($this->page, $user['uid'], true); $x['acl'] = $x['acl'] ?? ACL::getFullSelectorHTML($this->page, $user['uid'], true);
$x['bang'] = $x['bang'] ?? ''; $x['bang'] = $x['bang'] ?? '';
$x['visitor'] = $x['visitor'] ?? 'block'; $x['visitor'] = $x['visitor'] ?? 'block';
$x['is_owner'] = $x['is_owner'] ?? true; $x['is_owner'] = $x['is_owner'] ?? true;
$x['profile_uid'] = $x['profile_uid'] ?? local_user(); $x['profile_uid'] = $x['profile_uid'] ?? local_user();
$geotag = !empty($x['allow_location']) ? Renderer::replaceMacros(Renderer::getMarkupTemplate('jot_geotag.tpl'), []) : ''; $geotag = !empty($x['allow_location']) ? Renderer::replaceMacros(Renderer::getMarkupTemplate('jot_geotag.tpl'), []) : '';
@ -376,7 +376,7 @@ class Conversation
'$rand_num' => Crypto::randomDigits(12), '$rand_num' => Crypto::randomDigits(12),
// ACL permissions box // ACL permissions box
'$acl' => $x['acl'], '$acl' => $x['acl'],
//jot nav tab (used in some themes) //jot nav tab (used in some themes)
'$message' => $this->l10n->t('Message'), '$message' => $this->l10n->t('Message'),
@ -442,16 +442,16 @@ class Conversation
. "; var netargs = '" . substr($this->args->getCommand(), 8) . "; var netargs = '" . substr($this->args->getCommand(), 8)
. '?f=' . '?f='
. (!empty($_GET['contactid']) ? '&contactid=' . rawurlencode($_GET['contactid']) : '') . (!empty($_GET['contactid']) ? '&contactid=' . rawurlencode($_GET['contactid']) : '')
. (!empty($_GET['search']) ? '&search=' . rawurlencode($_GET['search']) : '') . (!empty($_GET['search']) ? '&search=' . rawurlencode($_GET['search']) : '')
. (!empty($_GET['star']) ? '&star=' . rawurlencode($_GET['star']) : '') . (!empty($_GET['star']) ? '&star=' . rawurlencode($_GET['star']) : '')
. (!empty($_GET['order']) ? '&order=' . rawurlencode($_GET['order']) : '') . (!empty($_GET['order']) ? '&order=' . rawurlencode($_GET['order']) : '')
. (!empty($_GET['bmark']) ? '&bmark=' . rawurlencode($_GET['bmark']) : '') . (!empty($_GET['bmark']) ? '&bmark=' . rawurlencode($_GET['bmark']) : '')
. (!empty($_GET['liked']) ? '&liked=' . rawurlencode($_GET['liked']) : '') . (!empty($_GET['liked']) ? '&liked=' . rawurlencode($_GET['liked']) : '')
. (!empty($_GET['conv']) ? '&conv=' . rawurlencode($_GET['conv']) : '') . (!empty($_GET['conv']) ? '&conv=' . rawurlencode($_GET['conv']) : '')
. (!empty($_GET['nets']) ? '&nets=' . rawurlencode($_GET['nets']) : '') . (!empty($_GET['nets']) ? '&nets=' . rawurlencode($_GET['nets']) : '')
. (!empty($_GET['cmin']) ? '&cmin=' . rawurlencode($_GET['cmin']) : '') . (!empty($_GET['cmin']) ? '&cmin=' . rawurlencode($_GET['cmin']) : '')
. (!empty($_GET['cmax']) ? '&cmax=' . rawurlencode($_GET['cmax']) : '') . (!empty($_GET['cmax']) ? '&cmax=' . rawurlencode($_GET['cmax']) : '')
. (!empty($_GET['file']) ? '&file=' . rawurlencode($_GET['file']) : '') . (!empty($_GET['file']) ? '&file=' . rawurlencode($_GET['file']) : '')
. "'; </script>\r\n"; . "'; </script>\r\n";
} }
@ -535,10 +535,10 @@ class Conversation
} }
// array with html for each thread (parent+comments) // array with html for each thread (parent+comments)
$threads = []; $threads = [];
$threadsid = -1; $threadsid = -1;
$page_template = Renderer::getMarkupTemplate("conversation.tpl"); $page_template = Renderer::getMarkupTemplate("conversation.tpl");
$formSecurityToken = BaseModule::getFormSecurityToken('contact_action'); $formSecurityToken = BaseModule::getFormSecurityToken('contact_action');
if (!empty($items)) { if (!empty($items)) {
@ -592,8 +592,7 @@ class Conversation
$tags = Tag::populateFromItem($item); $tags = Tag::populateFromItem($item);
$author = ['uid' => 0, 'id' => $item['author-id'], $author = ['uid' => 0, 'id' => $item['author-id'], 'network' => $item['author-network'], 'url' => $item['author-link']];
'network' => $item['author-network'], 'url' => $item['author-link']];
$profile_link = Contact::magicLinkByContact($author); $profile_link = Contact::magicLinkByContact($author);
$sparkle = ''; $sparkle = '';
@ -615,8 +614,8 @@ class Conversation
$drop = [ $drop = [
'dropping' => $dropping, 'dropping' => $dropping,
'pagedrop' => $page_dropping, 'pagedrop' => $page_dropping,
'select' => $this->l10n->t('Select'), 'select' => $this->l10n->t('Select'),
'delete' => $this->l10n->t('Delete'), 'delete' => $this->l10n->t('Delete'),
]; ];
$likebuttons = [ $likebuttons = [
@ -750,14 +749,14 @@ class Conversation
} }
$o = Renderer::replaceMacros($page_template, [ $o = Renderer::replaceMacros($page_template, [
'$baseurl' => $this->baseURL->get($ssl_state), '$baseurl' => $this->baseURL->get($ssl_state),
'$return_path' => $this->args->getQueryString(), '$return_path' => $this->args->getQueryString(),
'$live_update' => $live_update_div, '$live_update' => $live_update_div,
'$remove' => $this->l10n->t('remove'), '$remove' => $this->l10n->t('remove'),
'$mode' => $mode, '$mode' => $mode,
'$update' => $update, '$update' => $update,
'$threads' => $threads, '$threads' => $threads,
'$dropping' => ($page_dropping ? $this->l10n->t('Delete Selected Items') : False), '$dropping' => ($page_dropping ? $this->l10n->t('Delete Selected Items') : False),
]); ]);
$this->profiler->stopRecording(); $this->profiler->stopRecording();
@ -902,7 +901,7 @@ class Conversation
$commentcounter = []; $commentcounter = [];
$activitycounter = []; $activitycounter = [];
foreach ($parents AS $parent) { foreach ($parents as $parent) {
if (!empty($parent['thr-parent-id']) && !empty($parent['gravity']) && ($parent['gravity'] == GRAVITY_ACTIVITY)) { if (!empty($parent['thr-parent-id']) && !empty($parent['gravity']) && ($parent['gravity'] == GRAVITY_ACTIVITY)) {
$uriid = $parent['thr-parent-id']; $uriid = $parent['thr-parent-id'];
if (!empty($parent['author-id'])) { if (!empty($parent['author-id'])) {

View file

@ -138,7 +138,6 @@ class Community extends BaseModule
return $o; return $o;
} }
// $o .= conversation(DI::app(), $items, 'community', false, false, 'commented', local_user());
$o .= DI::conversation()->create($items, 'community', false, false, 'commented', local_user()); $o .= DI::conversation()->create($items, 'community', false, false, 'commented', local_user());
$pager = new BoundariesPager( $pager = new BoundariesPager(