aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/elgglib.php20
1 files changed, 20 insertions, 0 deletions
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
@@ -232,6 +232,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:
*