diff --git a/bl-kernel/admin/views/settings.php b/bl-kernel/admin/views/settings.php
index a9a02f22..0f2d6022 100644
--- a/bl-kernel/admin/views/settings.php
+++ b/bl-kernel/admin/views/settings.php
@@ -19,7 +19,7 @@
p('General') ?>
p('Advanced') ?>
p('SEO') ?>
- p('Social Networks') >; ?>
+ p('Social Networks') ?>
p('Images') ?>
p('Language') ?>
p('Logo') ?>
@@ -400,6 +400,25 @@ echo Bootstrap::formInputHidden(array(
?>
+
+ g('Social Networks'));
+
+ foreach ($GLOBALS['SOCIAL_NETWORKS'] as $key => $value) {
+ echo Bootstrap::formInputText(array(
+ 'name' => Text::cleanUrl($value),
+ 'label' => $value,
+ 'value' => $site->getSocialNetwork($value),
+ 'class' => '',
+ 'placeholder' => '',
+ 'tip' => ''
+ ));
+ }
+
+ echo Bootstrap::cardEnd();
+ ?>
+
+
setCustomFields($args['customFields']);
}
+ foreach ($GLOBALS['SOCIAL_NETWORKS'] as $key => $social) {
+ $socialKey = Text::cleanUrl($social);
+ if (isset($args[$socialKey])) {
+ $site->setSocialNetwork($socialKey, $args[$socialKey]);
+ }
+ }
+
if ($site->set($args)) {
// Check current order-by if changed it reorder the content
if ($site->orderBy() != ORDER_BY) {
diff --git a/bl-kernel/site.class.php b/bl-kernel/site.class.php
index 495031ac..d340895b 100644
--- a/bl-kernel/site.class.php
+++ b/bl-kernel/site.class.php
@@ -58,7 +58,8 @@ class Site extends dbJSON
'avatarQuality' => 100,
'logo' => '',
'markdownParser' => true,
- 'customFields' => '{}'
+ 'customFields' => '{}',
+ 'socials' => array()
);
function __construct()
@@ -479,4 +480,16 @@ class Site extends dbJSON
$customFields = Sanitize::htmlDecode($this->getField('customFields'));
return json_decode($customFields, true);
}
+
+ public function setSocialNetwork($social, $url) {
+ $key = Text::cleanUrl($social);
+ if ($this->getField('socials') == NULL) {
+ $this->db['socials'] = array();
+ }
+ $this->db['socials'][$key] = $url;
+ }
+
+ public function getSocialNetwork($social) {
+ return $this->getField('socials')[Text::cleanUrl($social)];
+ }
}