Changeset

8979:6897b2e18bdf

mod_pubsub: Support configurable title and description fields
author Kim Alvefur <zash@zash.se>
date Fri, 06 Jul 2018 16:04:53 +0200
parents 8978:9d6c0c11e383
children 8980:4d2738b99b07
files plugins/mod_pubsub/pubsub.lib.lua
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_pubsub/pubsub.lib.lua	Fri Jul 06 16:04:26 2018 +0200
+++ b/plugins/mod_pubsub/pubsub.lib.lua	Fri Jul 06 16:04:53 2018 +0200
@@ -46,6 +46,16 @@
 	};
 	{
 		type = "text-single";
+		name = "pubsub#title";
+		label = "Title";
+	};
+	{
+		type = "text-single";
+		name = "pubsub#description";
+		label = "Description";
+	};
+	{
+		type = "text-single";
 		name = "pubsub#max_items";
 		label = "Max # of items to persist";
 	};
@@ -399,6 +409,8 @@
 
 	local node_config = node_obj.config;
 	local pubsub_form_data = {
+		["pubsub#title"] = node_config["title"];
+		["pubsub#description"] = node_config["description"];
 		["pubsub#max_items"] = tostring(node_config["max_items"]);
 		["pubsub#persist_items"] = node_config["persist_items"];
 		["pubsub#notification_type"] = node_config["notification_type"];
@@ -433,6 +445,8 @@
 		return true;
 	end
 	local new_config = {
+		["title"] = form_data["pubsub#title"];
+		["description"] = form_data["pubsub#description"];
 		["max_items"] = tonumber(form_data["pubsub#max_items"]);
 		["persist_items"] = form_data["pubsub#persist_items"];
 		["notification_type"] = form_data["pubsub#notification_type"];