diff options
author | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-12 01:23:13 +0000 |
---|---|---|
committer | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-12 01:23:13 +0000 |
commit | 79bc76893ba8721582485b90f76d6185105b6389 (patch) | |
tree | ad1e34634e382da02d363795ada22b447f990ef3 /engine | |
parent | 2536a142c94c2482ddaca5b8fd09ef20d71f52aa (diff) | |
download | elgg-79bc76893ba8721582485b90f76d6185105b6389.tar.gz elgg-79bc76893ba8721582485b90f76d6185105b6389.tar.bz2 |
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
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/views.php | 22 |
1 files changed, 22 insertions, 0 deletions
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 @@ -1144,6 +1144,28 @@ function elgg_view_image_block($image, $body, $vars = array()) { } /** + * 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 * * @param ElggRiverItem $item A river item object |