aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-26 16:19:13 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-26 16:19:13 +0000
commitef61a122b4b7f3fbb37361ca5dd1bb8fad382dd9 (patch)
tree832ef6bc8c89658d0f28ddad0f12f58676987b03
parent95efaea68d69b15f1558ae3b338c1d59aa4a0d98 (diff)
downloadelgg-ef61a122b4b7f3fbb37361ca5dd1bb8fad382dd9.tar.gz
elgg-ef61a122b4b7f3fbb37361ca5dd1bb8fad382dd9.tar.bz2
Added layout manager to elgglib
git-svn-id: https://code.elgg.org/elgg/trunk@711 36083f99-b078-4883-b0ff-0f9b5a30f544
-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:
*