From 79bc76893ba8721582485b90f76d6185105b6389 Mon Sep 17 00:00:00 2001 From: ewinslow Date: Sat, 12 Feb 2011 01:23:13 +0000 Subject: Added an elgg_view_module shortcut function -- now to try it out! git-svn-id: http://code.elgg.org/elgg/trunk@8133 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/views.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/engine/lib/views.php b/engine/lib/views.php index 80ac4e827..144a346f5 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -1143,6 +1143,28 @@ function elgg_view_image_block($image, $body, $vars = array()) { return elgg_view('layout/objects/image_block', $vars); } +/** + * Wrapper function for the module display pattern. + * + * Box with header, body, footer + * + * This is a shortcut for {@elgg_view layout/objects/module}. + * + * @param string $type The type of module (main, info, popup, aside, etc.) + * @param string $title A title to put in the header + * @param string $body Content of the module + * @param string $vars Additional parameters for the module + * + * @return string + * @since 1.8.0 + */ +function elgg_view_module($type, $title, $body, $vars = array()) { + $vars['class'] .= " elgg-module-$type"; //@todo this will probably cause errors? + $vars['title'] = $title; + $vars['body'] = $body; + return elgg_view('layout/objects/module', $vars); +} + /** * Returns a human-readable representation of a river item * -- cgit v1.2.3