function render()
 {
     $r = get_page_user();
     $this->title .= ucfirst($r->login_name);
     $this->inner_HTML = $this->generate_inner_html();
     $content = parent::render();
     return $content;
 }
function uihelper_set_user_heading($page, $do_theme = TRUE, $userid = NULL)
{
    global $uid;
    $uid = !empty($userid) ? $userid : $uid;
    // Changing ... if we give User id than it will display the information of that user
    // .. if we not give the id than it displayed (Page users id or login user id )
    if (!empty($userid)) {
        $user = new User();
        $user->load((int) $userid);
    } else {
        $user = get_login_user();
        if (!PA::$login_uid) {
            $user = get_page_user();
        }
    }
    if (empty($user)) {
        return;
    }
    if ($do_theme) {
        // put links all theme CSS files in the header
        $theme_details = get_user_theme($uid);
        if (is_array($theme_details['css_files'])) {
            foreach ($theme_details['css_files'] as $key => $value) {
                $page->add_header_css($value);
            }
        }
        $page->header->set('theme_details', $theme_details);
        // see if we have user defined CSS
        // Here we have to load the user
        $usr = new User();
        $usr->user_id = $uid;
        $newcss = $usr->get_profile_field("ui", "newcss");
        if (!empty($newcss)) {
            $usercss = "<style>" . $newcss . "</style>";
            $page->add_header_html($usercss);
        }
    }
    // get selected general user data, so we can set captions, etc.
    $user_data_general = $user->get_profile_fields(GENERAL, array('user_caption', 'sub_caption', 'user_caption_image', 'desktop_image_action', 'desktop_image_display'));
    // set caption value
    if (!empty($user_data_general['user_caption'])) {
        $caption1 = chop_string($user_data_general['user_caption'], 20);
    } else {
        $caption1 = chop_string($user->first_name . " " . $user->last_name, 20);
    }
    $page->header->set('caption1', $caption1);
    $page->header->set('caption2', chop_string(@$user_data_general['sub_caption'], 40));
    $page->header->set('caption_image', $user_data_general['user_caption_image']);
    $page->header->set('desktop_image_action', $user_data_general['desktop_image_action']);
    $page->header->set('display_image', @$user_data_general['desktop_image_display']);
}