diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index 6cf7d3051f3..e0c263572cb 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -864,21 +864,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (isModEnabled('socialnetworks')) {
- foreach ($socialnetworks as $key => $value) {
- if ($value['active']) {
- print '
';
- print ' | ';
- print '';
- if (!empty($value['icon'])) {
- print '';
- }
- print '';
- print ' | ';
- print '
';
- } elseif (!empty($object->socialnetworks[$key])) {
- print '';
- }
- }
+ showSocialNetwork();
}
// Visibility
@@ -1151,21 +1137,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
if (isModEnabled('socialnetworks')) {
- foreach ($socialnetworks as $key => $value) {
- if ($value['active']) {
- print '';
- print ' | ';
- print '';
- if (!empty($value['icon'])) {
- print '';
- }
- print '';
- print ' | ';
- print '
';
- } elseif (!empty($object->socialnetworks[$key])) {
- print '';
- }
- }
+ showSocialNetwork();
}
// Visibility
@@ -1620,6 +1592,49 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
}
+function showSocialNetwork() {
+ global $socialnetworks, $object, $form, $object, $langs;
+ echo '';
+
+ print '| | |
';
+ foreach ($socialnetworks as $key => $value) {
+ if ($value['active']) {
+ print '';
+ print ' | ';
+ print '';
+ if (!empty($value['icon'])) {
+ print '';
+ }
+ print '';
+ print ' | ';
+ print '
';
+ } elseif (!empty($object->socialnetworks[$key])) {
+ print '';
+ }
+ }
+
+ print '';
+}
+
llxFooter();
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 8b5dcd251d2..2d6356394dd 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -1663,21 +1663,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Social networks
if (isModEnabled('socialnetworks')) {
- foreach ($socialnetworks as $key => $value) {
- if ($value['active']) {
- print '';
- print ' | ';
- print '';
- if (!empty($value['icon'])) {
- print '';
- }
- print '';
- print ' | ';
- print '
';
- } elseif (!empty($object->socialnetworks[$key])) {
- print '';
- }
- }
+ showSocialNetwork();
}
// Prof ids
@@ -2395,21 +2381,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Social network
if (isModEnabled('socialnetworks')) {
- foreach ($socialnetworks as $key => $value) {
- if ($value['active']) {
- print '';
- print ' | ';
- print '';
- if (!empty($value['icon'])) {
- print '';
- }
- print '';
- print ' | ';
- print '
';
- } elseif (!empty($object->socialnetworks[$key])) {
- print '';
- }
- }
+ showSocialNetwork();
}
// Prof ids
@@ -3326,6 +3298,50 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
}
}
+
+function showSocialNetwork() {
+ global $socialnetworks, $object, $form, $object, $langs;
+ echo '';
+
+ print '| | |
';
+ foreach ($socialnetworks as $key => $value) {
+ if ($value['active']) {
+ print '';
+ print ' | ';
+ print '';
+ if (!empty($value['icon'])) {
+ print '';
+ }
+ print '';
+ print ' | ';
+ print '
';
+ } elseif (!empty($object->socialnetworks[$key])) {
+ print '';
+ }
+ }
+
+ print '';
+}
+
// End of page
llxFooter();
$db->close();