applications/dashboard/controllers/class.profilecontroller.php
public function BuildProfile() {
      if (!is_object($this->User))
         throw new Exception(T('Cannot build profile information if user is not defined.'));
      
      $Session = Gdn::Session();
      if (strpos($this->CssClass, 'Profile') === FALSE)
         $this->CssClass .= ' Profile';
      $this->Title(Gdn_Format::Text($this->User->Name));
      
      if ($this->_DeliveryType != DELIVERY_TYPE_VIEW) {
         // Javascript needed
         $this->AddJsFile('jquery.jcrop.pack.js');
         $this->AddJsFile('profile.js');
         $this->AddJsFile('jquery.gardenmorepager.js');
         $this->AddJsFile('activity.js');
         
         // Build activity URL
         $ActivityUrl = 'profile/activity/';
         if ($this->User->UserID != $Session->UserID)
            $ActivityUrl = UserUrl($this->User, '', 'activity');
         
         // Show activity?
         if (C('Garden.Profile.ShowActivities', TRUE))
            $this->AddProfileTab(T('Activity'), $ActivityUrl, 'Activity', Sprite('SpActivity').' '.T('Activity'));
            
         // Show notifications?
         if ($this->User->UserID == $Session->UserID) {
            $Notifications = T('Notifications');
            $NotificationsHtml = Sprite('SpNotifications').' '.$Notifications;
            $CountNotifications = $Session->User->CountNotifications;
            if (is_numeric($CountNotifications) && $CountNotifications > 0)
               $NotificationsHtml .= ' <span class="Aside"><span class="Count">'.$CountNotifications.'</span></span>';
               
            $this->AddProfileTab($Notifications, 'profile/notifications', 'Notifications', $NotificationsHtml);
         }
         
         // Show invitations?
         if (C('Garden.Registration.Method') == 'Invitation')
            $this->AddProfileTab(T('Invitations'), 'profile/invitations', 'InvitationsLink');
         
         $this->FireEvent('AddProfileTabs');
      }
      
      return TRUE;
   }
public function BuildProfile() {
      if (!is_object($this->User))
         throw new Exception(T('Cannot build profile information if user is not defined.'));
      
      $Session = Gdn::Session();
      if (strpos($this->CssClass, 'Profile') === FALSE)
         $this->CssClass .= ' Profile';
      $this->Title(Gdn_Format::Text($this->User->Name));
      
      if ($this->_DeliveryType != DELIVERY_TYPE_VIEW) {
         // Javascript needed
         $this->AddJsFile('jquery.jcrop.pack.js');
         $this->AddJsFile('profile.js');
         $this->AddJsFile('jquery.gardenmorepager.js');
         $this->AddJsFile('activity.js');
         
         // Build activity URL
         $ActivityUrl = 'profile/activity/';
         if ($this->User->UserID != $Session->UserID)
            $ActivityUrl = UserUrl($this->User, '', 'activity');
         
         // Show activity?
         if (C('Garden.Profile.ShowActivities', TRUE))
            $this->AddProfileTab(T('Activity'), $ActivityUrl, 'Activity', Sprite('SpActivity').' '.T('Activity'));
            
         // Show notifications?
         if ($this->User->UserID == $Session->UserID) {
            $Notifications = T('Notifications');
            $NotificationsHtml = Sprite('SpNotifications').' '.$Notifications;
            $CountNotifications = $Session->User->CountNotifications;
            if (is_numeric($CountNotifications) && $CountNotifications > 0)
               $NotificationsHtml .= ' <span class="Aside"><span class="Count">'.$CountNotifications.'</span></span>';
               
            $this->AddProfileTab($Notifications, 'profile/notifications', 'Notifications', $NotificationsHtml);
         }
         
         // Show invitations?
         if (C('Garden.Registration.Method') == 'Invitation')
            $this->AddProfileTab(T('Invitations'), 'profile/invitations', 'InvitationsLink');
         
         $this->FireEvent('AddProfileTabs');
      }
      
      return TRUE;
   }
public function BuildProfile ( ) { if ( ! is_object ( $ this -> User ) ) throw new Exception ( T ( 'Cannot build profile information if user is not defined.' ) ) ; $ Session = Gdn :: Session ( ) ; if ( strpos ( $ this -> CssClass , 'Profile' ) === FALSE ) $ this -> CssClass .= ' Profile' ; $ this -> Title ( Gdn_Format :: Text ( $ this -> User -> Name ) ) ; if ( $ this -> _DeliveryType != DELIVERY_TYPE_VIEW ) { // Javascript needed $ this -> AddJsFile ( 'jquery.jcrop.pack.js' ) ; $ this -> AddJsFile ( 'profile.js' ) ; $ this -> AddJsFile ( 'jquery.gardenmorepager.js' ) ; $ this -> AddJsFile ( 'activity.js' ) ; // Build activity URL $ ActivityUrl = 'profile/activity/' ; if ( $ this -> User -> UserID != $ Session -> UserID ) $ ActivityUrl = UserUrl ( $ this -> User , '' , 'activity' ) ; // Show activity? if ( C ( 'Garden.Profile.ShowActivities' , TRUE ) ) $ this -> AddProfileTab ( T ( 'Activity' ) , $ ActivityUrl , 'Activity' , Sprite ( 'SpActivity' ) . ' ' . T ( 'Activity' ) ) ; // Show notifications? if ( $ this -> User -> UserID == $ Session -> UserID ) { $ Notifications = T ( 'Notifications' ) ; $ NotificationsHtml = Sprite ( 'SpNotifications' ) . ' ' . $ Notifications ; $ CountNotifications = $ Session -> User -> CountNotifications ; if ( is_numeric ( $ CountNotifications ) && $ CountNotifications > 0 ) $ NotificationsHtml .= ' <span class="Aside"><span class="Count">' . $ CountNotifications . '</span></span>' ; $ this -> AddProfileTab ( $ Notifications , 'profile/notifications' , 'Notifications' , $ NotificationsHtml ) ; } // Show invitations? if ( C ( 'Garden.Registration.Method' ) == 'Invitation' ) $ this -> AddProfileTab ( T ( 'Invitations' ) , 'profile/invitations' , 'InvitationsLink' ) ; $ this -> FireEvent ( 'AddProfileTabs' ) ; } return TRUE ; }
Build the user profile.

Set the page title, add data to page modules, add modules to assets,
add tabs to tab menu. $this->User must be defined, or this method will throw an exception.

@since 2.0.0
@access public
@return bool Always true.
Build the user profile .