From ca5c2911327cdbffb5bee1d44d1f673025fcdbce Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 8 Dec 2010 00:55:39 +0000 Subject: moved a few elements to layout from page git-svn-id: http://code.elgg.org/elgg/trunk@7556 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/layout/elements/owner_block.php | 77 +++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 views/default/layout/elements/owner_block.php (limited to 'views/default/layout/elements/owner_block.php') diff --git a/views/default/layout/elements/owner_block.php b/views/default/layout/elements/owner_block.php new file mode 100644 index 000000000..66fc180dd --- /dev/null +++ b/views/default/layout/elements/owner_block.php @@ -0,0 +1,77 @@ +{$label} +END; +} + +if(is_plugin_enabled('profile')) { + // Is there a page owner? + $owner = elgg_get_page_owner(); + if ($owner instanceof ElggGroup || + ($owner instanceof ElggUser && $owner->getGUID() != get_loggedin_userid()) + ) { + $icon = elgg_view('profile/icon', array('entity' => $owner, 'size' => 'tiny')); + $owner_url = $owner->getURL(); + $display = "
$icon
"; + $display .= '
'; + $display .= "

{$owner->name}

"; + + if ($owner->briefdescription) { + $display .= "

{$owner->briefdescription}

"; + } + + $location = elgg_view('output/tags', array('value' => $owner->location)); + $display .= "

$location

"; + + $display .= '
'; + + // Trigger owner block menu + $params = array('owner' => $owner); + $links = elgg_trigger_plugin_hook('profile_menu', 'profile', $params, array()); + if (is_array($links) && !empty($links)) { + // sort the links by name + usort($links, create_function( + '$a, $b', + 'return strnatcasecmp($a[\'text\'], $b[\'text\']);' + )); + + $display .= ''; + } + + // Allow plugins to extend the owner block contents + $display .= elgg_view('owner_block/profile_extend'); + + $contents .= "
$display
"; + } +} + +$contents .= elgg_view('owner_block/extend'); + + +echo $contents; -- cgit v1.2.3