Skip to content

Commit 053bf29

Browse files
committed
[K6.4] Add template part for displaying socials
1 parent e7784d2 commit 053bf29

File tree

6 files changed

+48
-5
lines changed

6 files changed

+48
-5
lines changed

src/libraries/kunena/src/User/KunenaUser.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2142,4 +2142,16 @@ public function checkUserAllowedLinksImages()
21422142

21432143
return true;
21442144
}
2145+
2146+
/**
2147+
* Get user socials info for the userprofile
2148+
*
2149+
* @throws Exception
2150+
* @since Kunena 6.4.0
2151+
*/
2152+
public function getSocialInfoUserProfile() {
2153+
$socials = KunenaUserSocials::getInstance();
2154+
2155+
return $socials;
2156+
}
21452157
}

src/site/src/Controller/User/Item/UserItemDisplay.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ class UserItemDisplay extends KunenaControllerDisplay
8989
public $avatar;
9090

9191
public $banInfo;
92+
93+
public $socials;
9294

9395
/**
9496
* Load user profile.
@@ -128,6 +130,7 @@ protected function before()
128130
$this->points = $activityIntegration->getUserPoints($this->profile->userid);
129131
$this->medals = $activityIntegration->getUserMedals($this->profile->userid);
130132
$this->private = KunenaFactory::getPrivateMessaging();
133+
$this->socials = $this->profile->getSocialInfoUserProfile();
131134

132135
$this->avatar = $this->profile->getAvatarImage(KunenaFactory::getTemplate()->params->get('avatarType'), 'post');
133136
$this->banInfo = $this->config->showBannedReason

src/site/src/Layout/User/Item/UserItemSocial.php renamed to src/site/src/Layout/User/Item/UserItemSocials.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@
2020
/**
2121
* KunenaLayoutUserItem
2222
*
23-
* @since Kunena 6.1
23+
* @since Kunena 6.4
2424
*/
25-
class UserItemSocial extends KunenaLayout
25+
class UserItemSocials extends KunenaLayout
2626
{
27-
public $profile;
28-
2927
public $socials;
3028
}

src/site/template/aurelia/layouts/user/item/default.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
->set('points', $this->points)
5656
->set('medals', $this->medals)
5757
->set('avatar', $this->avatar)
58-
->set('banInfo', $this->banInfo);
58+
->set('banInfo', $this->banInfo)
59+
->set('socials', $this->socials);
5960
?>
6061

6162
<?php echo $this->subLayout('Widget/Module')->set('position', 'kunena_summary'); ?>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
/**
4+
* Kunena Component
5+
*
6+
* @package Kunena.Template.Aurelia
7+
* @subpackage Layout.User
8+
*
9+
* @copyright Copyright (C) 2008 - @currentyear@ Kunena Team. All rights reserved.
10+
* @license https://www.gnu.org/copyleft/gpl.html GNU/GPL
11+
* @link https://www.kunena.org
12+
**/
13+
14+
namespace Kunena\Forum\Site;
15+
16+
\defined('_JEXEC') or die();
17+
18+
$showAll = isset($this->showAll) ? $this->showAll : false;
19+
?>
20+
<div class="inline float-end">
21+
<?php /*foreach ($this->socials as $key => $social) {
22+
23+
}*/
24+
?>
25+
</div>

src/site/template/aurelia/layouts/user/item/summary/default.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@
209209
<?php endif; ?>
210210
</div>
211211
</div>
212+
213+
<div class="col-md-9">
214+
<?php echo $this->subLayout('User/Item/Socials')->set('socials', $this->socials); ?>
215+
</div>
212216
</div>
213217

214218
<br/>

0 commit comments

Comments
 (0)