From 689c997f58b25df81164df9acdf5ebd9c1ad2bc9 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 27 Jun 2008 11:16:45 +0000 Subject: Introducing elgg_view_listing git-svn-id: https://code.elgg.org/elgg/trunk@1169 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 11 +++++++ mod/profile/views/default/profile/listing.php | 46 +++++++++------------------ views/default/search/listing.php | 33 +++++++++++++++++++ 3 files changed, 59 insertions(+), 31 deletions(-) create mode 100644 views/default/search/listing.php diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index bd1f12448..166757ea4 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -462,6 +462,17 @@ } + /** + * Wrapper function to display search listings. + * + * @param string $icon The icon for the listing + * @param string $info Any information that needs to be displayed. + * @return string The HTML (etc) representing the listing + */ + function elgg_view_listing($icon, $info) { + return elgg_view('search/listing',array('icon' => $icon, 'info' => $info)); + } + /** * 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: diff --git a/mod/profile/views/default/profile/listing.php b/mod/profile/views/default/profile/listing.php index 6b6381f64..3b322f799 100644 --- a/mod/profile/views/default/profile/listing.php +++ b/mod/profile/views/default/profile/listing.php @@ -12,36 +12,20 @@ * @uses $vars['entity'] The user entity */ -?> - -
+ $icon = elgg_view( + "profile/icon", array( + 'entity' => $vars['entity'], + 'size' => 'small', + ) + ); -
- $vars['entity'], - 'size' => 'small', - ) - ); - - ?> -
-
-

getUrl() . "\">" . $vars['entity']->name . ""; - - ?>

- location; - if (!empty($location)) { - echo "

" . elgg_echo("profile:location") . ": " . elgg_view("output/tags",array('value' => $vars['entity']->location)) . "

"; - } - - ?> -
+ $info = "

getUrl() . "\">" . $vars['entity']->name . "

"; -
\ No newline at end of file + $location = $vars['entity']->location; + if (!empty($location)) { + $info .= "

" . elgg_echo("profile:location") . ": " . elgg_view("output/tags",array('value' => $vars['entity']->location)) . "

"; + } + + echo elgg_view_listing($icon, $info); + +?> \ No newline at end of file diff --git a/views/default/search/listing.php b/views/default/search/listing.php new file mode 100644 index 000000000..8ffad8ffa --- /dev/null +++ b/views/default/search/listing.php @@ -0,0 +1,33 @@ + + +
+ +
+ +
+
+ +
+ +
\ No newline at end of file -- cgit v1.2.3