diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/default/river/ElggRelationship/create.php | 15 | ||||
-rw-r--r-- | views/default/river/wrapper.php | 74 | ||||
-rw-r--r-- | views/json/messages/exceptions/exception.php | 20 | ||||
-rw-r--r-- | views/php/messages/exceptions/exception.php | 17 | ||||
-rw-r--r-- | views/xml/messages/exceptions/exception.php | 31 |
5 files changed, 115 insertions, 42 deletions
diff --git a/views/default/river/ElggRelationship/create.php b/views/default/river/ElggRelationship/create.php index 27c0a8e9e..9033ee0da 100644 --- a/views/default/river/ElggRelationship/create.php +++ b/views/default/river/ElggRelationship/create.php @@ -10,21 +10,22 @@ * @link http://elgg.com/ */ - $performed_by = $vars['performed_by']; - $log_entry = $vars['log_entry']; - $object = $vars['entity']; + $statement = $vars['statement']; - // Find out what type of relationship we're dealing with (will only display a few) - if ($object instanceof ElggRelationship) + $performed_by = $statement->getSubject(); + $event = $statement->getEvent(); + $object = $statement->getObject(); + + if (is_array($object)) { - switch ($object->relationship) + switch ($object['relationship']) { // Friending case 'friend' : case 'friends' : // 'friends' shouldn't be used, but just incase :) // Get second object - $userb = get_entity($object->guid_two); + $userb = $object['object']; // Only users can be friends if (($performed_by instanceof ElggUser) && ($userb instanceof ElggUser)) diff --git a/views/default/river/wrapper.php b/views/default/river/wrapper.php index 0a38b1ac0..fe5c961d5 100644 --- a/views/default/river/wrapper.php +++ b/views/default/river/wrapper.php @@ -10,38 +10,42 @@ * @copyright Curverider Ltd 2008
* @link http://elgg.com/
*/
-
- if (isset($vars['entity']) && $vars['entity'] instanceof ElggEntity) {
-
- $subtype = $vars['entity']->getSubtype();
- if (empty($subtype)) $subtype = $vars['entity']->type;
- if (empty($subtype)) $subtype = "general";
-
- } else if ($vars['log']->object_class == "ElggRelationship") {
- $subtype = "relationship_" . $vars['entity']->relationship;
- }
-
-?>
-
-<div class="river_item">
-
- <div class="river_<?php echo $subtype; ?>">
- <div class="river_<?php echo $vars['log']->event; ?>">
- <p class="river_<?php echo $subtype; ?>_<?php echo $vars['log']->event; ?>">
- <?php
-
- echo $vars['entry'];
-
- ?>
- <span class="river_item_time">
- (<?php
-
- echo friendly_time($vars['log']->time_created);
-
- ?>)
- </span>
- </p>
- </div>
- </div>
-
-</div>
\ No newline at end of file + + $statement = $vars['statement']; + $time = $vars['time']; + $event = $vars['event']; + $entry = $vars['entry']; + + if ($statement->getObject() instanceof ElggEntity) { + + $obj = $statement->getObject(); + $subtype = $obj->getSubtype(); + if (empty($subtype)) $subtype = $obj->type; + if (empty($subtype)) $subtype = "general"; + } else if (is_array($statement->getObject())) { + $obj = $statement->getObject(); + $subtype = "relationship_" . $obj['relationship']; + } +?> +<div class="river_item"> + + <div class="river_<?php echo $subtype; ?>"> + <div class="river_<?php echo $event; ?>"> + <p class="river_<?php echo $subtype; ?>_<?php echo $event; ?>"> + <?php + + echo $vars['entry']; + + ?> + <span class="river_item_time"> + (<?php + + echo friendly_time($time); + + ?>) + </span> + </p> + </div> + </div> + +</div> diff --git a/views/json/messages/exceptions/exception.php b/views/json/messages/exceptions/exception.php new file mode 100644 index 000000000..a11bd7f7b --- /dev/null +++ b/views/json/messages/exceptions/exception.php @@ -0,0 +1,20 @@ +<?php + /** + * Elgg exception + * Displays a single exception + * + * @package Elgg + * @subpackage Core + * @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.org/ + * + * @uses $vars['object'] An exception + */ + + $export = $vars['object']; + + + echo json_encode("$export"); +?>
\ No newline at end of file diff --git a/views/php/messages/exceptions/exception.php b/views/php/messages/exceptions/exception.php new file mode 100644 index 000000000..5bb1bafd4 --- /dev/null +++ b/views/php/messages/exceptions/exception.php @@ -0,0 +1,17 @@ +<?php + /** + * Elgg exception + * Displays a single exception + * + * @package Elgg + * @subpackage Core + * @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.org/ + * + * @uses $vars['object'] An exception + */ + + echo serialize($vars['object']); +?>
\ No newline at end of file diff --git a/views/xml/messages/exceptions/exception.php b/views/xml/messages/exceptions/exception.php new file mode 100644 index 000000000..86b5bba48 --- /dev/null +++ b/views/xml/messages/exceptions/exception.php @@ -0,0 +1,31 @@ +<?php
+
+ /**
+ * Elgg exception
+ * Displays a single exception
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @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.org/
+ *
+ * @uses $vars['object'] An exception
+ */
+ + global $CONFIG;
+?>
+<!--
+<?php echo get_class($vars['object']); ?>: <?php echo nl2br($vars['object']->getMessage()); ?> + + +<?php if ($CONFIG->debug) { ?> +<?php + + echo print_r($vars['object'], true); + + ?> +<?php } ?> + +-->
\ No newline at end of file |