Commit 95aada8c authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Bug 1745042: set link and icon attribute for socialprofiles"

parents 1e3df11c 7f65b938
......@@ -312,22 +312,28 @@ class ElasticsearchType_artefact extends ElasticsearchType {
$record->link = 'artefact/plans/plan.php?id=' . $record->parent;
}
break;
case 'socialprofile' :
safe_require ( 'artefact', 'internal' );
$record->note = str_replace ( array (
}
}
// The socialprofile link is for external sites so we can display it for all users.
if ($record->artefacttype == 'socialprofile') {
safe_require ( 'artefact', 'internal' );
$record->note = str_replace ( array (
"\r\n",
"\n",
"\r"
), ' ', strip_tags ( $record->note ) );
$socialprofile = new ArtefactTypeSocialprofile ( $record->id );
$icons = $socialprofile->get_profile_icons ( array (
), ' ', strip_tags ( $record->note ) );
$socialprofile = new ArtefactTypeSocialprofile ( $record->id );
$icons = $socialprofile->get_profile_icons ( array (
$record
) );
if (! empty ( $icons )) {
$record->link = $icons [0]->link;
$record->icon = $icons [0]->icon;
}
break;
) );
if (! empty ( $icons )) {
$record->link = $icons [0]->link;
$record->icon = $icons [0]->icon;
}
else {
// Instantiate the attribute used by the template.
$record->icon = '';
}
}
......
......@@ -15,7 +15,7 @@
<img src="{$record->icon}" alt="{$record->note}">
<h3 class="title list-group-item-heading text-inline">
{if $record->link}
<a href="{$WWWROOT}{$record->link}">
<a href="{$record->link}">
{$record->title|str_shorten_html:50:true|safe}
</a>
{else}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment