]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Cleaning up profile owner blocks to allow for view extensions.
authornickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 21 May 2010 16:36:52 +0000 (16:36 +0000)
committernickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 21 May 2010 16:36:52 +0000 (16:36 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@6126 36083f99-b078-4883-b0ff-0f9b5a30f544

views/default/page_elements/owner_block.php

index ef77d68952d04e12c0b1ddbd34773b5e6280fd73..9aef07eef1f43de2f355b9b366fbd71eac8ff689 100644 (file)
@@ -30,23 +30,28 @@ END;
 if(is_plugin_enabled('profile')) {
        // Is there a page owner?
        $owner = page_owner_entity();
-       $location = elgg_view("output/tags",array('value' => $owner->location));
-       if ($owner instanceof ElggEntity) {
-               $icon = elgg_view("profile/icon",array('entity' => $owner, 'size' => 'tiny'));
-               if ($owner instanceof ElggUser || $owner instanceof ElggGroup) {
-                       $info = '<h3><a href="' . $owner->getURL() . '">' . $owner->name . '</a></h3>';
-               }
-               $display = "<div class='owner_block_icon'>" . $icon . "</div>";
-               $display .= "<div class='owner_block_contents clearfloat'>" . $info;
+       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 = "<div class=\"owner_block_icon\">$icon</div>";
+               $display .= '<div class="owner_block_contents clearfloat">';
+               $display .= "<h3><a href=\"$owner_url\">{$owner->name}</a></h3>";
 
                if ($owner->briefdescription) {
-                       $desc = $owner->briefdescription;
-                       $display .= "<p class='profile_info briefdescription'>" . $desc . "</p>";
+                       $display .= "<p class=\"profile_info briefdescription\">{$owner->briefdescription}</p>";
                }
-               $display .= "<p class='profile_info location'>{$location}</p>";
-               $display .= "</div>"; // close owner_block_contents
+               
+               $location = elgg_view('output/tags', array('value' => $owner->location));
+               $display .= "<p class=\"profile_info location\">$location</p>";
+
+               $display .= elgg_view('owner_block/profile_extend');
+               
+               // close owner_block_content
+               $display .= '</div>';
 
-               $contents .= "<div id='owner_block' class='radius8'>".$display."</div>";
+               $contents .= "<div id=\"owner_block\" class=\"radius8\">$display</div>";
        }
 }