aboutsummaryrefslogtreecommitdiff
path: root/views/ical
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-06-19 14:36:30 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-06-19 14:36:30 +0000
commitf81bbaa623dc62e1c4ae01c5b1e90006dd476a6a (patch)
tree34eb1b9614e15815cdf09fca1bf7d67ac22a1b6e /views/ical
parent720b81320ee4c7b759ef6358e6f4a0b7893c1386 (diff)
downloadelgg-f81bbaa623dc62e1c4ae01c5b1e90006dd476a6a.tar.gz
elgg-f81bbaa623dc62e1c4ae01c5b1e90006dd476a6a.tar.bz2
Closes #581: First draft ICAL export views for Notable calendar events.
git-svn-id: https://code.elgg.org/elgg/trunk@3347 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/ical')
-rw-r--r--views/ical/canvas/default.php20
-rw-r--r--views/ical/export/entity.php35
-rw-r--r--views/ical/object/default.php16
-rw-r--r--views/ical/pageshells/pageshell.php23
-rw-r--r--views/ical/search/entity_list.php20
5 files changed, 114 insertions, 0 deletions
diff --git a/views/ical/canvas/default.php b/views/ical/canvas/default.php
new file mode 100644
index 000000000..bda23f11f
--- /dev/null
+++ b/views/ical/canvas/default.php
@@ -0,0 +1,20 @@
+<?php
+ /**
+ * Elgg ICAL output
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2009
+ * @link http://elgg.org/
+ *
+ */
+
+ for ($i = 1; $i < 8; $i++) {
+
+ if (isset($vars["area{$i}"]))
+ echo $vars["area{$i}"];
+
+ }
+?> \ No newline at end of file
diff --git a/views/ical/export/entity.php b/views/ical/export/entity.php
new file mode 100644
index 000000000..0413cd56a
--- /dev/null
+++ b/views/ical/export/entity.php
@@ -0,0 +1,35 @@
+<?php
+ /**
+ * Elgg ICAL output of default object.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2009
+ * @link http://elgg.org/
+ *
+ */
+
+ $entity = $vars['entity'];
+
+ if (
+ ($entity instanceof Notable) &&
+ ($entity->getCalendarStartTime()) &&
+ ($entity->getCalendarEndTime())
+ )
+ {
+?>
+BEGIN:VEVENT
+DTSTAMP:<?php echo date("Ymd\THis\Z", $entity->getTimeCreated()); ?>
+DTSTART:<?php echo date("Ymd\THis\Z", $entity->getCalendarStartTime()); ?>
+DTEND:<?php echo date("Ymd\THis\Z", $entity->getCalendarEndTime()); ?>
+SUMMARY:<?php echo $event->title; ?>
+LAST-MODIFIED:<?php echo date("Ymd\THis\Z", $entity->getTimeUpdated()); ?>
+END:VEVENT
+<?php
+ }
+?>
+ if (
+
+ ) \ No newline at end of file
diff --git a/views/ical/object/default.php b/views/ical/object/default.php
new file mode 100644
index 000000000..4b9b075f6
--- /dev/null
+++ b/views/ical/object/default.php
@@ -0,0 +1,16 @@
+<?php
+ /**
+ * Elgg ICAL output of default object.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2009
+ * @link http://elgg.org/
+ *
+ */
+
+ elgg_view('export/entity', $vars);
+
+?> \ No newline at end of file
diff --git a/views/ical/pageshells/pageshell.php b/views/ical/pageshells/pageshell.php
new file mode 100644
index 000000000..29894cdad
--- /dev/null
+++ b/views/ical/pageshells/pageshell.php
@@ -0,0 +1,23 @@
+<?php
+
+ /**
+ * Elgg ICAL output pageshell
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2009
+ * @link http://elgg.org/
+ *
+ */
+
+ header("Content-Type: text/calendar");
+
+ echo $vars['body'];
+?>
+BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//Curverider Ltd//NONSGML Elgg <?php echo get_version(true); ?>//EN
+<?php echo $vars['body']; ?>
+END:VCALENDAR
diff --git a/views/ical/search/entity_list.php b/views/ical/search/entity_list.php
new file mode 100644
index 000000000..8712f7134
--- /dev/null
+++ b/views/ical/search/entity_list.php
@@ -0,0 +1,20 @@
+<?php
+
+ /**
+ * Elgg default layout
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2009
+ * @link http://elgg.org/
+ */
+
+ $entities = $vars['entities'];
+ if (is_array($entities) && sizeof($entities) > 0) {
+ foreach($entities as $entity)
+ echo elgg_view_entity($entity);
+ }
+
+?> \ No newline at end of file