Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Commit

Permalink
fix(discovery): improve public profile display
Browse files Browse the repository at this point in the history
  • Loading branch information
hypeJunction committed Apr 21, 2017
1 parent 1ca5355 commit 8b459c4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions views/default/framework/discovery/icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
$size = $og_sizes[$size];
}

if (!$entity->hasIcon($size, 'open_graph_image')) {
return;
}

$img_params = array(
'src' => $entity->getIconURL([
'size' => $size,
Expand Down
16 changes: 14 additions & 2 deletions views/default/framework/discovery/public.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,20 @@
return;
}

$type = $entity->getType();
$subtype = $entity->getSubtype() ? : 'default';

if (elgg_view_exists("framework/discovery/public/$type/$subtype")) {
echo elgg_view("framework/discovery/public/$type/$subtype", $vars);
}

$title = get_discovery_title($entity);

$owner_icon = '';
$subtitle = '';

$owner = $entity->getOwnerEntity();
if (is_discoverable($owner)) {
if (is_discoverable($owner) && !$owner instanceof ElggSite) {
$owner_name = get_discovery_title($owner);
$owner_url = get_entity_permalink($owner);
$owner_link = elgg_view('output/url', [
Expand Down Expand Up @@ -66,9 +73,14 @@

$more = elgg_format_element('p', [], elgg_echo('discovery:login_for_more', [$login_url, $register_url]));

$content .= elgg_format_element('div', [
'class' => 'elgg-output',
], $image . $more);


echo elgg_view('object/elements/full', [
'entity' => $entity,
'icon' => $owner_icon,
'summary' => $summary,
'body' => $content . $image . $more,
'body' => $content,
]);

0 comments on commit 8b459c4

Please sign in to comment.