From 2ed63907f64ac88a060a718cb8598fb66a6e9356 Mon Sep 17 00:00:00 2001 From: brettp Date: Tue, 13 Apr 2010 19:36:02 +0000 Subject: Added granular view hook view:$view_name instead of a monolithic display:view hook. git-svn-id: http://code.elgg.org/elgg/trunk@5724 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 764c230bf..0cb696e1d 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -289,9 +289,17 @@ function elgg_view($view, $vars = array(), $bypass = false, $debug = false, $vie $content = ob_get_clean(); // Plugin hook - $content = trigger_plugin_hook('display', 'view', + $content = trigger_plugin_hook('view', $view_orig, array('view' => $view_orig, 'vars' => $vars), $content); + // backward compatibility with less grandular hook will be gone in 2.0 + $content_tmp = trigger_plugin_hook('display', 'view', array('view' => $view_orig, 'vars' => $vars), $content); + + if ($content_tmp != $content) { + $content = $content_tmp; + elgg_deprecated_notice('The display:view plugin hook is deprecated by view:view_name or view:all', 1.8); + } + // Return $content return $content; } -- cgit v1.2.3