From ef61a122b4b7f3fbb37361ca5dd1bb8fad382dd9 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 26 May 2008 16:19:13 +0000 Subject: Added layout manager to elgglib git-svn-id: https://code.elgg.org/elgg/trunk@711 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'engine/lib') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index b3ed96318..320a571c2 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -231,6 +231,26 @@ } + /** + * Displays an internal layout for the use of a plugin canvas. + * Takes a variable number of parameters, which are made available + * in the views as $vars['area1'] .. $vars['areaN']. + * + * @param string $layout The name of the views in canvas/layouts/. + * @return string The layout + */ + function elgg_view_layout($layout) { + + $arg = 1; + $param_array = array(); + while ($arg < func_num_args()) { + $param_array['area' . $arg] = func_get_arg($arg); + $arg++; + } + return elgg_view('canvas/layouts/{$layout}',$param_array); + + } + /** * Sets an alternative function to handle templates, which will be passed to by elgg_view. * This function must take the $view and $vars parameters from elgg_view: -- cgit v1.2.3