From 51e4a8336a0e3034b1e1d4d36eb49044f93c90cd Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Sat, 12 May 2018 23:59:03 -0600 Subject: [PATCH] Add site footer links (close #15) --- action.php | 3 +++ lang/en_us.php | 3 ++- lib/themefunctions.php | 11 +++++++++++ pages/sitesettings.php | 41 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 1 deletion(-) diff --git a/action.php b/action.php index f122f66..39ea597 100644 --- a/action.php +++ b/action.php @@ -168,6 +168,9 @@ switch ($VARS['action']) { } foreach ($VARS['settings'] as $key => $value) { + if (is_array($value)) { + $value = json_encode($value); + } if ($database->has('settings', ["AND" => ["siteid" => $siteid, "key" => $key]])) { if ($value == "") { //echo "deleting $key => $value\n"; diff --git a/lang/en_us.php b/lang/en_us.php index feb9548..4bd8cc0 100644 --- a/lang/en_us.php +++ b/lang/en_us.php @@ -126,5 +126,6 @@ define("STRINGS", [ "in navbar" => "Add page to menu", "navbar title" => "Page title for menu", "navbar position" => "Menu position (drag to change position):", - "remove image" => "Remove image" + "remove image" => "Remove image", + "site footer links" => "Site Footer Links" ]); \ No newline at end of file diff --git a/lib/themefunctions.php b/lib/themefunctions.php index e5790e5..79ea35e 100644 --- a/lib/themefunctions.php +++ b/lib/themefunctions.php @@ -485,6 +485,17 @@ function get_fontawesome_css($echo = true) { } } +/** + * Return an array [[title, url], [title, url]] of links for the page footer + */ +function get_footer_urls() { + $links = json_decode(get_setting("footerlinks", false), true); + if (is_array($links)) { + return $links; + } + return []; +} + /** * Returns an array of social media URLs, with FontAwesome icon classes and labels. * @return array [["icon", "name", "url"]] diff --git a/pages/sitesettings.php b/pages/sitesettings.php index c18856f..36f772d 100644 --- a/pages/sitesettings.php +++ b/pages/sitesettings.php @@ -164,6 +164,7 @@ if (!is_empty($VARS['siteid'])) {
+
@@ -198,6 +199,7 @@ if (!is_empty($VARS['siteid'])) {
+
@@ -216,6 +218,7 @@ if (!is_empty($VARS['siteid'])) {
+
@@ -224,6 +227,7 @@ if (!is_empty($VARS['siteid'])) {
+
@@ -310,6 +314,43 @@ if (!is_empty($VARS['siteid'])) {
+ +
+
+
+
+ +
+
+