diff options
author | Sem <sembrestels@riseup.net> | 2012-04-25 19:09:22 +0200 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2012-04-25 19:09:22 +0200 |
commit | 9fe063022e08a4b6fa5f5935f8f185d5d95814a4 (patch) | |
tree | 87377f7b889efc639935508556beb9baf010e821 /engine/lib/views.php | |
parent | 24690ed95198c093e6fbb91a94b5d0544c740f89 (diff) | |
download | elgg-9fe063022e08a4b6fa5f5935f8f185d5d95814a4.tar.gz elgg-9fe063022e08a4b6fa5f5935f8f185d5d95814a4.tar.bz2 |
Upgraded to Elgg 1.8.4.
Diffstat (limited to 'engine/lib/views.php')
-rw-r--r-- | engine/lib/views.php | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/engine/lib/views.php b/engine/lib/views.php index e59edac96..ca0ce7196 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -560,7 +560,7 @@ function elgg_view($view, $vars = array(), $bypass = false, $debug = false, $vie * * @return void * @since 1.7.0 - * @link http://docs.elgg.org/Views/Ejxtend + * @link http://docs.elgg.org/Views/Extend * @example views/extend.php */ function elgg_extend_view($view, $view_extension, $priority = 501, $viewtype = '') { @@ -969,12 +969,7 @@ function elgg_view_annotation(ElggAnnotation $annotation, array $vars = array(), return elgg_view($view, $vars, $bypass, $debug); } - // @todo would be better to always make sure name is initialized properly $name = $annotation->name; - $intname = (int) $name; - if ("{$intname}" == "{$name}") { - $name = get_metastring($intname); - } if (empty($name)) { return false; } @@ -1330,21 +1325,18 @@ function elgg_view_form($action, $form_vars = array(), $body_vars = array()) { * @access private */ function elgg_view_list_item($item, array $vars = array()) { + global $CONFIG; - switch ($item->getType()) { - case 'user': - case 'object': - case 'group': - case 'site': - return elgg_view_entity($item, $vars); - case 'annotation': - return elgg_view_annotation($item, $vars); - case 'river': - return elgg_view_river_item($item, $vars); - default: - return false; - break; + $type = $item->getType(); + if (in_array($type, $CONFIG->entity_types)) { + return elgg_view_entity($item, $vars); + } else if ($type == 'annotation') { + return elgg_view_annotation($item, $vars); + } else if ($type == 'river') { + return elgg_view_river_item($item, $vars); } + + return false; } /** @@ -1671,5 +1663,5 @@ function elgg_views_boot() { } } -elgg_register_event_handler('boot', 'system', 'elgg_views_boot', 1000); +elgg_register_event_handler('boot', 'system', 'elgg_views_boot'); elgg_register_event_handler('init', 'system', 'elgg_views_handle_deprecated_views'); |