aboutsummaryrefslogtreecommitdiff
path: root/mod/opendd/actions
diff options
context:
space:
mode:
Diffstat (limited to 'mod/opendd/actions')
-rw-r--r--mod/opendd/actions/opendd/feed/delete.php42
-rw-r--r--mod/opendd/actions/opendd/feed/subscribe.php58
2 files changed, 100 insertions, 0 deletions
diff --git a/mod/opendd/actions/opendd/feed/delete.php b/mod/opendd/actions/opendd/feed/delete.php
new file mode 100644
index 000000000..2826174bf
--- /dev/null
+++ b/mod/opendd/actions/opendd/feed/delete.php
@@ -0,0 +1,42 @@
+<?php
+ /**
+ * Elgg OpenDD aggregator
+ *
+ * @package ElggOpenDD
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ // Load configuration
+ global $CONFIG;
+
+ gatekeeper();
+
+ $returnurl = $_SERVER['HTTP_REFERER'];
+
+ $feed_guid = get_input('feed_guid');
+ $feed = NULL;
+ if ($feed_guid)
+ $feed = get_entity($feed_guid);
+
+ if (($feed) || (!($feed instanceof ElggObject)))
+ {
+ if ($feed->delete()) {
+ system_message(elgg_echo("opendd:deleted"));
+ $returnurl = $CONFIG->url . "mod/opendd/";
+ }
+ else
+ system_message(elgg_echo("opendd:notdeleted"));
+
+ }
+ else
+ system_message(elgg_echo("opendd:notobject"));
+
+
+
+ $returnurl = $CONFIG->url . "mod/opendd/";
+ forward($returnurl);
+ exit;
+?> \ No newline at end of file
diff --git a/mod/opendd/actions/opendd/feed/subscribe.php b/mod/opendd/actions/opendd/feed/subscribe.php
new file mode 100644
index 000000000..654e6aef3
--- /dev/null
+++ b/mod/opendd/actions/opendd/feed/subscribe.php
@@ -0,0 +1,58 @@
+<?php
+ /**
+ * Elgg OpenDD aggregator
+ *
+ * @package ElggOpenDD
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ // Load configuration
+ global $CONFIG;
+
+ gatekeeper();
+
+ $input = array();
+ foreach($CONFIG->opendd as $shortname => $valuetype) {
+ $input[$shortname] = get_input($shortname);
+ if ($valuetype == 'tags')
+ $input[$shortname] = string_to_tag_array($input[$shortname]);
+ }
+
+ $feed_guid = get_input('feed_guid');
+ $feed = NULL;
+ if ($feed_guid)
+ $feed = get_entity($feed_guid);
+ else
+ {
+ $feed = new ElggObject();
+ $feed->subtype = 'oddfeed';
+ }
+
+ if (!($feed instanceof ElggObject))
+ {
+ system_message(elgg_echo("opendd:notobject"));
+
+ forward($_SERVER['HTTP_REFERER']);
+ exit;
+ }
+
+ // Assume we can edit or this is a new group
+ if (sizeof($input) > 0)
+ {
+ foreach($input as $shortname => $value) {
+ $feed->$shortname = $value;
+ }
+ }
+
+
+ if ($feed->save())
+ system_message(elgg_echo("opendd:feedok"));
+ else
+ system_message(elgg_echo("opendd:feednotok"));
+
+ forward($_SERVER['HTTP_REFERER']);
+ exit;
+?> \ No newline at end of file