]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Added granular view hook view:$view_name instead of a monolithic display:view hook.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 13 Apr 2010 19:36:02 +0000 (19:36 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 13 Apr 2010 19:36:02 +0000 (19:36 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@5724 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/elgglib.php

index 764c230bfa9de8218cd559311b046842c9e76840..0cb696e1dff64447d8239e74bec98ab622f20531 100644 (file)
@@ -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;
 }