From e5dd9906d16d97aed7ba3511b7e1132bd4da3761 Mon Sep 17 00:00:00 2001 From: capo Date: Mon, 16 Dec 2013 00:12:26 +0100 Subject: Added feature to be able to use simplepie rss module in the groups --- actions/simplepie/group_module.php | 8 ++ languages/es.php | 16 +++ start.php | 7 ++ views/default/forms/simplepie/group_module.php | 35 +++++++ views/default/simplepie/group_module.php | 113 +++++++++++++++++++++ views/default/widgets/feed_reader/content.php.save | 81 +++++++++++++++ 6 files changed, 260 insertions(+) create mode 100644 actions/simplepie/group_module.php create mode 100644 languages/es.php create mode 100644 views/default/forms/simplepie/group_module.php create mode 100644 views/default/simplepie/group_module.php create mode 100644 views/default/widgets/feed_reader/content.php.save diff --git a/actions/simplepie/group_module.php b/actions/simplepie/group_module.php new file mode 100644 index 000000000..93fe353de --- /dev/null +++ b/actions/simplepie/group_module.php @@ -0,0 +1,8 @@ +canEdit()) { + $group->feed_url = $feed_url; +} diff --git a/languages/es.php b/languages/es.php new file mode 100644 index 000000000..51b53e9f2 --- /dev/null +++ b/languages/es.php @@ -0,0 +1,16 @@ + 'Enlace RSS', + 'simplepie:description' => 'Agregar un blog externo', + 'simplepie:notset' => 'Enlace RSS no configurado', + 'simplepie:notfind' => 'no se encontro el feed. Revisa el feed url.', + 'simplepie:feed_url' => 'Feed URL', + 'simplepie:num_items' => 'Numero de items', + 'simplepie:excerpt' => 'Incluir contenido', + 'simplepie:post_date' => 'Incluir fecha del post', + 'simplepie:postedon' => 'Posted on', +); + +add_translation("en", $english); + diff --git a/start.php b/start.php index 20adc7545..26c2e5017 100644 --- a/start.php +++ b/start.php @@ -20,4 +20,11 @@ function simplepie_init() { $lib = elgg_get_plugins_path() . 'simplepie/vendors/simplepie.inc'; elgg_register_library('simplepie', $lib); + + // Add group option + add_group_tool_option('rss', elgg_echo('simplepie:enablerss'), false); + elgg_extend_view('groups/tool_latest', 'simplepie/group_module'); + + elgg_register_action('simplepie/group_module', elgg_get_plugins_path() . 'simplepie/actions/simplepie/group_module.php'); } + diff --git a/views/default/forms/simplepie/group_module.php b/views/default/forms/simplepie/group_module.php new file mode 100644 index 000000000..a7c1f6858 --- /dev/null +++ b/views/default/forms/simplepie/group_module.php @@ -0,0 +1,35 @@ + 'feed_url', + 'value' => $vars['entity']->feed_url, +)); + +$group_field = elgg_view('input/hidden', array( + 'name' => 'group_guid', + 'value' => $vars['entity']->guid, +)); + +$save_button = elgg_view('input/submit', array( + 'value' => elgg_echo('save'), +)); + + + + +echo << + $url_label + $url_textbox + $group_field + +
+ $save_button +
+HTML; diff --git a/views/default/simplepie/group_module.php b/views/default/simplepie/group_module.php new file mode 100644 index 000000000..7d0a7bc2f --- /dev/null +++ b/views/default/simplepie/group_module.php @@ -0,0 +1,113 @@ +rss_enable != "yes") { + return true; +} + +elgg_push_context('widgets'); + +$allowed_tags = '