Пример #1
0
 public function execute(\FrameResponseObject $frameResponseObject)
 {
     $current_user = \lms_steam::get_current_user();
     $login = $current_user->get_name();
     //$path = $request->getPath();
     if (isset($this->id)) {
         $userName = $this->id;
         $user = \steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $userName);
     } else {
         $user = $current_user;
     }
     //$portal=\lms_portal::get_instance();
     $cache = get_cache_function($login, 86400);
     //	$portal->set_page_title( $login );
     $html_handler_profile = new \koala_html_profile($user);
     $html_handler_profile->set_context("groups");
     $content = \Profile::getInstance()->loadTemplate("list_groups.template.html");
     //$content = new HTML_TEMPLATE_IT();
     //$content->loadTemplateFile( PATH_TEMPLATES . "list_groups.template.html" );
     if ($this->viewer_authorized($current_user, $user)) {
         $public = $user->get_id() != $current_user->get_id() ? TRUE : FALSE;
         $groups = $cache->call("lms_steam::user_get_groups", $login, $public);
         usort($groups, "sort_objects");
         $no_groups = count($groups);
         if ($no_groups > 0) {
             $content->setCurrentBlock("BLOCK_GROUP_LIST");
             $pageIterator = \lms_portal::get_paginator(10, $no_groups, "(" . gettext("%TOTAL groups in list") . ")");
             $content->setVariable("PAGEITERATOR", $pageIterator["html"]);
             $start = $pageIterator["startIndex"];
             $end = $start + 10 > $no_groups ? $no_groups : $start + 10;
             if ($current_user->get_id() == $user->get_id()) {
                 $content->setVariable("LABEL_GROUPS", gettext("Your groups") . " (" . str_replace(array("%a", "%z", "%s"), array($start + 1, $end, $no_groups), gettext("%a-%z out of %s")) . ")");
             } else {
                 $content->setVariable("LABEL_GROUPS", str_replace("%NAME", $user->get_attribute("USER_FIRSTNAME") . " " . $user->get_attribute("USER_FULLNAME"), gettext("%NAME's groups")) . " (" . str_replace(array("%a", "%z", "%s"), array($start + 1, $end, $no_groups), gettext("%a-%z out of %s")) . ")");
             }
             // GROUPS
             $content->setVariable("LABEL_NAME_DESCRIPTION", gettext("Name, description"));
             $content->setVariable("LABEL_MEMBERS", gettext("Members list"));
             $content->setVariable("LABEL_COMMUNICATION", gettext("Communication"));
             if ($user->get_id() == $current_user->get_id()) {
                 $content->setVariable("TH_MANAGE_GROUP", gettext("Manage membership"));
             }
             for ($i = $start; $i < $end; $i++) {
                 $group = $groups[$i];
                 $content->setCurrentBlock("BLOCK_GROUP");
                 $content->setVariable("GROUP_LINK", PATH_URL . "groups/" . $group["OBJ_ID"] . "/");
                 $content->setVariable("GROUP_NAME", h($group["OBJ_NAME"]));
                 $content->setVariable("MEMBER_LINK", PATH_URL . "groups/" . $group["OBJ_ID"] . "/members/");
                 $content->setVariable("GROUP_MEMBERS", h($group["GROUP_NO_MEMBERS"]));
                 $content->setVariable("LINK_SEND_MESSAGE", PATH_URL . "messages_write.php?group=" . $group["OBJ_ID"]);
                 $content->setVariable("LABEL_MESSAGE", gettext("Message"));
                 $content->setVariable("LABEL_SEND", gettext("Send"));
                 if ($user->get_id() == $current_user->get_id()) {
                     $content->setVariable("TD_MANAGE_GROUP", "<a href=\"" . PATH_URL . "group_cancel.php?group=" . $group["OBJ_ID"] . "\">" . gettext("Resign") . "</a>");
                 }
                 $content->setVariable("OBJ_DESC", h($group["OBJ_DESC"]));
                 $content->parse("BLOCK_GROUP");
             }
             $content->parse("BLOCK_GROUP_LIST");
         } else {
             $content->setVariable("LABEL_GROUPS", gettext("No memberships found."));
         }
     } else {
         $messagebox = "<div class=\"infoBar\"><h2>" . gettext("The user has restricted the display of this information.") . "</h2></div>";
         $content->setVariable("LABEL_PRIVACY_DENY_PARTICIPANTS", $messagebox);
     }
     $frameResponseObject->setHeadline($html_handler_profile->get_headline());
     $html_handler_profile->set_html_left($content->get());
     $rawHtml = new \Widgets\RawHtml();
     $rawHtml->setHtml($html_handler_profile->get_html());
     $frameResponseObject->addWidget($rawHtml);
     return $frameResponseObject;
     //$portal->set_page_main( $html_handler_profile->get_headline(), $html_handler_profile->get_html());
     //return $portal->get_html();
 }
Пример #2
0
 public function execute(\FrameResponseObject $frameResponseObject)
 {
     //var_dump($request);
     $current_user = \lms_steam::get_current_user();
     //var_dump($current_user);die;
     $name = $this->id;
     if ($name != "") {
         //$userName = $path[2];
         $user = \steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $name);
     } else {
         $user = $current_user;
     }
     $login = $user->get_name();
     $cache = get_cache_function($login, 3600);
     //$portal = \lms_portal::get_instance();
     //$portal->set_page_title( $login );
     $user_profile = $cache->call("lms_steam::user_get_profile", $login);
     $html_handler_profile = new \koala_html_profile($user);
     $html_handler_profile->set_context("profile");
     $GLOBALS["content"] = \Profile::getInstance()->loadTemplate("profile_display.template.html");
     //$content = new HTML_TEMPLATE_IT();
     //$content->loadTemplateFile( PATH_TEMPLATES . "profile_display.template.html" );
     if (!empty($user_profile["USER_PROFILE_DSC"])) {
         $GLOBALS["content"]->setVariable("HTML_CODE_DESCRIPTION", "<p>" . get_formatted_output($user_profile["USER_PROFILE_DSC"]) . "</p>");
     }
     if (!empty($user_profile["USER_PROFILE_WEBSITE_URI"])) {
         $website_name = h(empty($user_profile["USER_PROFILE_WEBSITE_NAME"]) ? $user_profile["USER_PROFILE_WEBSITE_URI"] : $user_profile["USER_PROFILE_WEBSITE_NAME"]);
         $GLOBALS["content"]->setVariable("HTML_CODE_PERSONAL_WEBSITE", "<br/><b>" . gettext("Website") . ":</b> <a href=\"" . h($user_profile["USER_PROFILE_WEBSITE_URI"]) . "\" target=\"_blank\">{$website_name}</a>");
     }
     //get Buddys from user and put them into the $globals-Array for authorization-query
     $confirmed = $user->get_id() != $current_user->get_id() ? TRUE : FALSE;
     $contacts = $cache->call("lms_steam::user_get_buddies", $login, $confirmed);
     $tmp = array();
     foreach ($contacts as $contact) {
         $tmp[] = $contact["OBJ_ID"];
     }
     $GLOBALS["contact_ids"] = $tmp;
     //get Viewer-Authorization and put them into the $globals-Array for authorization-query
     $user_privacy = $cache->call("lms_steam::user_get_profile_privacy", $user->get_name());
     $GLOBALS["authorizations"] = $user_privacy;
     $GLOBALS["current user"] = $current_user;
     //$GLOBALS["content"] = $content;
     ///////////////////////////////////////////////////
     //////////////  GENERAL INFORMATION  //////////////
     ///////////////////////////////////////////////////
     // Status
     if (ENABLED_BID_DESCIPTION) {
         $user_profile_desc = $user_profile["OBJ_DESC"];
         $status = secure_gettext($user_profile_desc);
         if ($status != "" && !is_integer($status)) {
             $this->display("GENERAL", "Beschreibung", $status);
         }
     }
     if (ENABLED_STATUS) {
         $user_profile_desc = empty($user_profile["OBJ_DESC"]) ? "student" : $user_profile["OBJ_DESC"];
         $status = secure_gettext($user_profile_desc);
         $this->display("GENERAL", "Status", $status);
     }
     if (ENABLED_EMAIL) {
         $user_email = empty($user_profile["USER_EMAIL"]) ? "keine E-Mail-Adresse gesetzt" : $user_profile["USER_EMAIL"];
         $this->display("GENERAL", "E-Mail-Adresse", h($user_email));
     }
     if (ENABLED_BID_EMAIL) {
         $helper = empty($user_profile["USER_EMAIL"]) ? true : false;
         $user_email = empty($user_profile["USER_EMAIL"]) ? "keine E-Mail-Adresse gesetzt" : $user_profile["USER_EMAIL"];
         if ($helper) {
             $this->display("GENERAL", "E-Mail", h($user_email));
         } else {
             $mail = h($user_profile["USER_EMAIL"]);
             $mail1 = '<a href="mailto:' . $mail . '">' . $mail . '</a>';
             //var_dump($mail1);die;
             $this->display("GENERAL", "E-Mail", $mail1);
         }
     }
     // Gender
     if (ENABLED_GENDER) {
         switch (is_string($user_profile["USER_PROFILE_GENDER"]) ? $user_profile["USER_PROFILE_GENDER"] : "X") {
             case "F":
                 $gender = gettext("female");
                 break;
             case "M":
                 $gender = gettext("male");
                 break;
             default:
                 $gender = gettext("rather not say");
                 break;
         }
         $this->display("GENERAL", "Gender", $gender);
     }
     // Origin - Faculty
     if (ENABLED_FACULTY) {
         $faculty = \lms_steam::get_faculty_name($user_profile["USER_PROFILE_FACULTY"]);
         $this->display("GENERAL", "Origin", $faculty);
     }
     if (ENABLED_WANTS) {
         $this->display("GENERAL", "Wants", h($user_profile["USER_PROFILE_WANTS"]));
     }
     if (ENABLED_HAVES) {
         $this->display("GENERAL", "Haves", h($user_profile["USER_PROFILE_HAVES"]));
     }
     if (ENABLED_ORGANIZATIONS) {
         $this->display("GENERAL", "Organizations", h($user_profile["USER_PROFILE_ORGANIZATIONS"]));
     }
     if (ENABLED_HOMETOWN) {
         $this->display("GENERAL", "Hometown", h($user_profile["USER_PROFILE_HOMETOWN"]));
     }
     if (ENABLED_MAIN_FOCUS) {
         $this->display("GENERAL", "Main focus", h($user_profile["USER_PROFILE_FOCUS"]));
     }
     if (ENABLED_OTHER_INTERESTS) {
         $this->display("GENERAL", "Other interests", h($user_profile["USER_PROFILE_OTHER_INTERESTS"]));
     }
     // LANGUAGE
     if (ENABLED_BID_LANGUAGE) {
         $this->display("GENERAL", "Language", $user_profile["USER_LANGUAGE"]);
     }
     if (ENABLED_LANGUAGES) {
         $languages = array("english" => array("name" => gettext("English"), "icon" => "flag_gb.gif", "lang_key" => "en_US"), "german" => array("name" => gettext("German"), "icon" => "flag_de.gif", "lang_key" => "de_DE"));
         $ulang = $user_profile["USER_LANGUAGE"];
         if (!is_string($ulang) || $ulang === "0") {
             $ulang = LANGUAGE_DEFAULT_STEAM;
         }
         if (!array_key_exists($ulang, $languages)) {
             $ulang = LANGUAGE_DEFAULT_STEAM;
         }
         $language_string = "";
         foreach ($languages as $key => $language) {
             if ($ulang == $key) {
                 $language_string .= "<img class=\"flag\" src=\"" . PATH_EXTENSIONS . "/profile/asset/icons/images/" . $language["icon"] . "\" title=\"" . $language["name"] . "\" />";
             }
         }
         $this->display("GENERAL", "Language", $language_string);
     }
     if ($this->GENERAL_displayed) {
         $GLOBALS["content"]->setVariable("HEADER_GENERAL_INFORMATION", gettext("General Information"));
     }
     ///////////////////////////////////////////////////
     ///////////////  CONTACTS & GROUPS  ///////////////
     ///////////////////////////////////////////////////
     // CONTACTS
     if (ENABLED_CONTACTS) {
         $html_code_contacts = "";
         $max_contacts = $counter = 25;
         if (count($contacts) > 0) {
             foreach ($contacts as $id => $contact) {
                 if ($counter > 0) {
                     $title = !empty($contact["USER_ACADEMIC_TITLE"]) ? $contact["USER_ACADEMIC_TITLE"] . " " : "";
                     $html_code_contacts .= "<a href=\"" . PATH_URL . "profile/" . $contact["OBJ_NAME"] . "/\">" . $title . $contact["USER_FIRSTNAME"] . " " . $contact["USER_FULLNAME"] . "</a>";
                     $html_code_contacts .= $id == count($contacts) - 1 || $counter == 1 ? "" : ", ";
                     $counter--;
                 } else {
                     $html_code_contacts .= " <a href=\"" . PATH_URL . "profile/{$login}/contacts/\">(" . gettext("more") . "...)</a>";
                     break;
                 }
             }
         } else {
             $html_code_contacts = gettext("No contacts yet.");
         }
         $this->display("CONTACTS_AND_GROUPS", "Contacts", $html_code_contacts);
     }
     if (ENABLED_GROUPS) {
         // GROUPS
         $public = $user->get_id() != $current_user->get_id() ? TRUE : FALSE;
         $groups = $cache->call("lms_steam::user_get_groups", $login, $public);
         $html_code_groups = "";
         $max_groups = $counter = 25;
         if (count($groups) > 0) {
             usort($groups, "sort_objects");
             foreach ($groups as $id => $group) {
                 if ($counter > 0) {
                     $html_code_groups .= "<a href=\"" . PATH_URL . "groups/" . $group["OBJ_ID"] . "/\">" . h($group["OBJ_NAME"]) . "</a>";
                     $html_code_groups .= $id == count($groups) - 1 || $counter == 1 ? "" : ", ";
                     $counter--;
                 } else {
                     $html_code_groups .= " <a href=\"" . PATH_URL . "profile/{$login}/groups/\">(" . gettext("more") . "...)</a>";
                     break;
                 }
             }
         } else {
             $html_code_groups = gettext("No memberships yet.");
         }
         $this->display("CONTACTS_AND_GROUPS", "Groups", $html_code_groups);
     }
     if ($this->CONTACTS_AND_GROUPS_displayed) {
         $GLOBALS["content"]->setVariable("HEADER_CONTACTS_AND_GROUPS", gettext("Contacts and Groups"));
     }
     /////////////////////////////////////////////////////
     ///////////////  CONTACT INFORMATION  ///////////////
     /////////////////////////////////////////////////////
     $is_buddy = $user->is_buddy($current_user) || $user->get_id() == $current_user->get_id() ? TRUE : FALSE;
     if (ENABLED_EMAIL) {
         $mail = h($user_profile["USER_EMAIL"]);
         $mail1 = '<a href="mailto:"' . $mail . '">' . $mail . '</a>';
         $this->display("CONTACT_DATA", "E-mail", $mail1, $is_buddy);
     }
     if (ENABLED_ADDRESS) {
         $adress = h($user_profile["USER_PROFILE_ADDRESS"]);
         $this->display("CONTACT_DATA", "Address", $adress, $is_buddy);
     }
     if (ENABLED_BID_ADRESS) {
         $adress = h($user_profile["USER_PROFILE_ADDRESS"]);
         if (isset($adress) && !is_integer($adress) && trim($adress) != "") {
             $this->display("GENERAL", "Address", h($user_profile["USER_ADRESS"]), $is_buddy);
         }
     }
     if (ENABLED_TELEPHONE) {
         $this->display("CONTACT_DATA", "Telephone", h($user_profile["USER_PROFILE_TELEPHONE"]), $is_buddy);
     }
     if (ENABLED_BID_PHONE) {
         $phone = h($user_profile["bid:user_callto"]);
         if (isset($phone) && $phone != 0 && $phone != "") {
             $phone1 = '<a href="callto:' . $phone . '">' . $phone . '</a>';
             $this->display("GENERAL", "Telefon", $phone1, $is_buddy);
         }
     }
     if (ENABLED_PHONE_MOBILE) {
         $this->display("CONTACT_DATA", "Phone, mobile", h($user_profile["USER_PROFILE_PHONE_MOBILE"]), $is_buddy);
     }
     // Website
     $website_name = $user_profile["USER_PROFILE_WEBSITE_NAME"];
     $website_uri = $user_profile["USER_PROFILE_WEBSITE_URI"];
     if (empty($website_name)) {
         $website_name = $website_uri;
     }
     $website_link = empty($website_name) ? '' : '<a target="_blank" href="' . h($website_uri) . '">' . h($website_name) . '</a>';
     if (ENABLED_WEBSITE) {
         $this->display("CONTACT_DATA", gettext("Website"), $website_link);
     }
     if (ENABLED_ICQ_NUMBER || ENABLED_BID_IM) {
         $icq = h($user_profile["USER_PROFILE_IM_ICQ"]);
         if (isset($icq) && $icq !== 0 && $icq != "") {
             $icq1 = '<a href="http://www.icq.com/whitepages/cmd.php?uin=' . $icq . '&amp;action=add">' . $icq . '</a>';
             $this->display("CONTACT_DATA", "ICQ number", $icq1);
         }
     }
     if (ENABLED_MSN_IDENTIFICATION || ENABLED_BID_IM) {
         $msn = h($user_profile["USER_PROFILE_IM_MSN"]);
         if (isset($msn) && $msn !== 0 && $msn != "") {
             $msn1 = '<a href="http://members.msn.com/' . $msn . '">' . $msn . '</a>';
             $this->display("CONTACT_DATA", "MSN identification", $msn1);
         }
     }
     // AIM
     if (ENABLED_AIM_ALIAS || ENABLED_BID_IM) {
         if (!empty($user_profile["USER_PROFILE_IM_AIM"])) {
             $aim_alias = h($user_profile["USER_PROFILE_IM_AIM"]);
             if (isset($aim_alias) && $aim_alias !== 0 && $aim_alias != "") {
                 $aim = "<a href=\"aim:" . $aim_alias . "\">" . $aim_alias . "</a>";
                 $this->display("CONTACT_DATA", "AIM-alias", $aim);
             }
             //$aim = "<span id=\"USER_PROFILE_IM_AIM\"><a href=\"{VALUE_AIM_LINK}\">{VALUE_AIM_ALIAS}</a></span>";
         }
     }
     if (ENABLED_YAHOO_ID || ENABLED_BID_IM) {
         $yahoo = h($user_profile["USER_PROFILE_IM_YAHOO"]) !== 0 ? h($user_profile["USER_PROFILE_IM_YAHOO"]) : "";
         if (isset($yahoo) && $yahoo !== 0 && $yahoo != "") {
             $this->display("CONTACT_DATA", "Yahoo-ID", $yahoo);
         }
     }
     // Skype
     if (ENABLED_SKYPE_NAME || ENABLED_BID_IM) {
         if (!empty($user_profile["USER_PROFILE_IM_SKYPE"])) {
             $skype_alias = h($user_profile["USER_PROFILE_IM_SKYPE"]);
             if (isset($skype_alias) && $skype_alias !== 0 && $skype_alias != "") {
                 $skype = "<a href=\"skype:" . $skype_alias . "\">" . $skype_alias . "</a>";
             }
             $this->display("CONTACT_DATA", "Skype name", $skype);
         }
     }
     $GLOBALS["content"] = $GLOBALS["content"];
     if ($this->CONTACT_DATA_displayed) {
         $GLOBALS["content"]->setVariable("HEADER_CONTACT_DATA", gettext("Contact Data"));
     }
     $GLOBALS["content"]->setVariable("PATH_JAVASCRIPT", PATH_JAVASCRIPT);
     $GLOBALS["content"]->setVariable("KOALA_VERSION", KOALA_VERSION);
     $GLOBALS["content"]->setVariable("USER_LOGIN", $login);
     $html_handler_profile->set_html_left($GLOBALS["content"]->get());
     $frameResponseObject->setHeadline($html_handler_profile->get_headline());
     $rawHtml = new \Widgets\RawHtml();
     $rawHtml->setHtml($html_handler_profile->get_html());
     $frameResponseObject->addWidget($rawHtml);
     return $frameResponseObject;
 }
Пример #3
0
    foreach ($contacts as $contact) {
        $contact_ids[] = $contact["OBJ_ID"];
    }
    $is_contact = in_array($login->get_id(), $contact_ids);
    if (!($contact_authorization & PROFILE_DENY_ALLUSERS)) {
        return true;
    }
    if ($is_contact && !($contact_authorization & PROFILE_DENY_CONTACTS)) {
        return true;
    }
    return false;
}
$current_user = lms_steam::get_current_user();
$cache = get_cache_function($login, 86400);
$portal->set_page_title($login);
$html_handler_profile = new koala_html_profile($user);
$html_handler_profile->set_context("contacts");
if (viewer_authorized($current_user, $user)) {
    // Display Contacts
    $unconfirmed_html = "";
    // Contacts to confirm (visible only for the user himself)
    if ($current_user->get_id() == $user->get_id()) {
        $content = new HTML_TEMPLATE_IT();
        $content->loadTemplateFile(PATH_TEMPLATES . "list_users.template.html");
        $contacts = $cache->call("lms_steam::user_get_contacts_to_confirm", $login);
        $no_contacts = count($contacts);
        if ($no_contacts > 0) {
            $content->setCurrentBlock("BLOCK_CONTACT_LIST");
            $start = $portal->set_paginator($content, 10, $no_contacts, "(" . gettext("%TOTAL contact requests in list") . ")");
            $end = $start + 10 > $no_contacts ? $no_contacts : $start + 10;
            if ($current_user->get_id() == $user->get_id()) {
Пример #4
0
    foreach ($contacts as $contact) {
        $contact_ids[] = $contact["OBJ_ID"];
    }
    $is_contact = in_array($login->get_id(), $contact_ids);
    if (!($group_authorization & PROFILE_DENY_ALLUSERS)) {
        return true;
    }
    if ($is_contact && !($group_authorization & PROFILE_DENY_CONTACTS)) {
        return true;
    }
    return false;
}
$current_user = lms_steam::get_current_user();
$cache = get_cache_function($login, 86400);
$portal->set_page_title($login);
$html_handler_profile = new koala_html_profile($user);
$html_handler_profile->set_context("groups");
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "list_groups.template.html");
if (viewer_authorized($current_user, $user)) {
    $public = $user->get_id() != $current_user->get_id() ? TRUE : FALSE;
    $groups = $cache->call("lms_steam::user_get_groups", $login, $public);
    usort($groups, "sort_objects");
    $no_groups = count($groups);
    if ($no_groups > 0) {
        $content->setCurrentBlock("BLOCK_GROUP_LIST");
        $start = $portal->set_paginator($content, 10, $no_groups, "(" . gettext("%TOTAL groups in list") . ")");
        $end = $start + 10 > $no_groups ? $no_groups : $start + 10;
        if ($current_user->get_id() == $user->get_id()) {
            $content->setVariable("LABEL_GROUPS", gettext("Your groups") . " (" . str_replace(array("%a", "%z", "%s"), array($start + 1, $end, $no_groups), gettext("%a-%z out of %s")) . ")");
        } else {
Пример #5
0
 public function execute(\FrameResponseObject $frameResponseObject)
 {
     $current_user = \lms_steam::get_current_user();
     //$path = $request->getPath();
     if ($this->id != "") {
         $userName = $this->id;
         $user = \steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $userName);
     } else {
         $user = $current_user;
     }
     $login = $current_user->get_name();
     $cache = get_cache_function($login, 86400);
     //$portal = \lms_portal::get_instance();
     //$portal->set_page_title( $login );
     $html_handler_profile = new \koala_html_profile($user);
     $html_handler_profile->set_context("contacts");
     if ($this->viewer_authorized($current_user, $user)) {
         // Display Contacts
         $unconfirmed_html = "";
         // Contacts to confirm (visible only for the user himself)
         if ($current_user->get_id() == $user->get_id()) {
             $content = \Profile::getInstance()->loadTemplate("list_users.template.html");
             //$content = new HTML_TEMPLATE_IT();
             //$content->loadTemplateFile( PATH_TEMPLATES . "list_users.template.html" );
             $contacts = $cache->call("lms_steam::user_get_contacts_to_confirm", $login);
             $no_contacts = count($contacts);
             if ($no_contacts > 0) {
                 $content->setCurrentBlock("BLOCK_CONTACT_LIST");
                 $result = \lms_portal::get_paginator($content, 10, $no_contacts, "(" . gettext("%TOTAL contact requests in list") . ")");
                 $content->setVariable("PAGEITERATOR", $result["html"]);
                 $start = $result["start"];
                 $end = $start + 10 > $no_contacts ? $no_contacts : $start + 10;
                 if ($current_user->get_id() == $user->get_id()) {
                     $content->setVariable("LABEL_CONTACTS", gettext("Contact requests") . " (" . str_replace(array("%a", "%z", "%s"), array($start + 1, $end, $no_contacts), gettext("%a-%z out of %s")) . ")");
                 } else {
                     $content->setVariable("LABEL_CONTACTS", str_replace("%NAME", h($user->get_attribute("USER_FIRSTNAME")) . " " . h($user->get_attribute("USER_FULLNAME")), gettext("%NAME's contacts")) . " (" . str_replace(array("%a", "%z", "%s"), array($start + 1, $end, $no_contacts), gettext("%a-%z out of %s")) . ")");
                 }
                 // CONTACTS
                 $content->setVariable("LABEL_NAME_POSITION", gettext("Name, position"));
                 $content->setVariable("LABEL_SUBJECT_AREA", gettext("Origin/Focus"));
                 $content->setVariable("LABEL_COMMUNICATION", gettext("Communication"));
                 if ($user->get_id() == $current_user->get_id()) {
                     $content->setVariable("TH_MANAGE_CONTACT", gettext("Manage request"));
                 }
                 for ($i = $start; $i < $end; $i++) {
                     $contact = $contacts[$i];
                     $content->setCurrentBlock("BLOCK_CONTACT");
                     $content->setVariable("CONTACT_LINK", PATH_URL . "profile/" . h($contact["OBJ_NAME"]) . "/");
                     $icon_link = $contact["OBJ_ICON"] == 0 ? PATH_STYLE . "images/anonymous.jpg" : PATH_URL . "cached/get_document.php?id=" . h($contact["OBJ_ICON"]) . "&type=usericon&width=30&height=40";
                     $content->setVariable("CONTACT_IMAGE", $icon_link);
                     $title = !empty($contact["USER_ACADEMIC_TITLE"]) ? h($contact["USER_ACADEMIC_TITLE"]) . " " : "";
                     $content->setVariable("CONTACT_NAME", $title . h($contact["USER_FIRSTNAME"]) . " " . h($contact["USER_FULLNAME"]));
                     $faf = \lms_steam::get_faculty_name($contact["USER_PROFILE_FACULTY"]);
                     $faf .= empty($contact["USER_PROFILE_FOCUS"]) ? "" : ": " . h($contact["USER_PROFILE_FOCUS"]);
                     $content->setVariable("FACULTY_AND_FOCUS", $faf);
                     $content->setVariable("LINK_SEND_MESSAGE", PATH_URL . "messages_write.php?to=" . h($contact["OBJ_NAME"]));
                     $content->setVariable("LABEL_MESSAGE", gettext("Message"));
                     $content->setVariable("LABEL_SEND", gettext("Send"));
                     if ($user->get_id() == $current_user->get_id()) {
                         $content->setVariable("TD_MANAGE_CONTACT", "<td align=\"center\"><a href=\"" . PATH_URL . "contact_confirm.php?id=" . h($contact["OBJ_ID"]) . "\">" . gettext("Confirm") . " / " . gettext("Deny") . "</a></td>");
                     }
                     $contact_desc = empty($contact["OBJ_DESC"]) ? "student" : $contact["OBJ_DESC"];
                     $status = secure_gettext($contact_desc);
                     $content->setVariable("OBJ_DESC", h($status));
                     $content->parse("BLOCK_CONTACT");
                 }
                 $content->parse("BLOCK_CONTACT_LIST");
             }
             $unconfirmed_html = $content->get();
         }
         $content = \Profile::getInstance()->loadTemplate("list_users.template.html");
         //$content = new HTML_TEMPLATE_IT();
         //$content->loadTemplateFile( PATH_TEMPLATES . "list_users.template.html" );
         // Contact list
         $confirmed = $user->get_id() != $current_user->get_id() ? TRUE : FALSE;
         $contacts = $cache->call("lms_steam::user_get_buddies", $login, $confirmed);
         // If user views his own contact list, get information about the confirmed contacts too
         //HACK START DOMINIK FRAGEN!
         $confirmed_contacts = "";
         //HACK END
         if (!$confirmed) {
             $confirmed_contacts = $user->get_attribute("USER_CONTACTS_CONFIRMED");
         }
         if (!is_array($confirmed_contacts)) {
             $confirmed_contacts = array();
         }
         $no_contacts = count($contacts);
         if ($no_contacts > 0) {
             $content->setCurrentBlock("BLOCK_CONTACT_LIST");
             $start = $portal->set_paginator($content, 10, $no_contacts, "(" . gettext("%TOTAL contacts in list") . ")");
             $end = $start + 10 > $no_contacts ? $no_contacts : $start + 10;
             if ($current_user->get_id() == $user->get_id()) {
                 $content->setVariable("LABEL_CONTACTS", gettext("Your contacts") . " (" . str_replace(array("%a", "%z", "%s"), array($start + 1, $end, $no_contacts), gettext("%a-%z out of %s")) . ")");
             } else {
                 $content->setVariable("LABEL_CONTACTS", str_replace("%NAME", h($user->get_attribute("USER_FIRSTNAME")) . " " . h($user->get_attribute("USER_FULLNAME")), gettext("%NAME's contacts")) . " (" . str_replace(array("%a", "%z", "%s"), array($start + 1, $end, $no_contacts), gettext("%a-%z out of %s")) . ")");
             }
             // CONTACTS
             $content->setVariable("LABEL_NAME_POSITION", gettext("Name, position"));
             $content->setVariable("LABEL_SUBJECT_AREA", gettext("Origin/Focus"));
             $content->setVariable("LABEL_COMMUNICATION", gettext("Communication"));
             if ($user->get_id() == $current_user->get_id()) {
                 $content->setVariable("TH_MANAGE_CONTACT", gettext("Manage contact"));
             }
             for ($i = $start; $i < $end; $i++) {
                 $contact = $contacts[$i];
                 $content->setCurrentBlock("BLOCK_CONTACT");
                 $content->setVariable("CONTACT_LINK", PATH_URL . "profile/" . h($contact["OBJ_NAME"]) . "/");
                 $icon_link = $contact["OBJ_ICON"] == 0 ? PATH_STYLE . "images/anonymous.jpg" : PATH_URL . "cached/get_document.php?id=" . h($contact["OBJ_ICON"]) . "&type=usericon&width=30&height=40";
                 $content->setVariable("CONTACT_IMAGE", $icon_link);
                 $title = !empty($contact["USER_ACADEMIC_TITLE"]) ? h($contact["USER_ACADEMIC_TITLE"]) . " " : "";
                 $content->setVariable("CONTACT_NAME", $title . h($contact["USER_FIRSTNAME"]) . " " . h($contact["USER_FULLNAME"]));
                 $faf = lms_steam::get_faculty_name($contact["USER_PROFILE_FACULTY"]);
                 $faf .= empty($contact["USER_PROFILE_FOCUS"]) ? "" : ": " . h($contact["USER_PROFILE_FOCUS"]);
                 $content->setVariable("FACULTY_AND_FOCUS", $faf);
                 $content->setVariable("LINK_SEND_MESSAGE", PATH_URL . "messages_write.php?to=" . h($contact["OBJ_NAME"]));
                 $content->setVariable("LABEL_MESSAGE", gettext("Message"));
                 $content->setVariable("LABEL_SEND", gettext("Send"));
                 $cmessage = "";
                 if ($user->get_id() == $current_user->get_id()) {
                     if (isset($confirmed_contacts[$contact["OBJ_ID"]]) && $confirmed_contacts[$contact["OBJ_ID"]]) {
                         $cmessage .= "(" . gettext("Confirmed") . ")";
                     } else {
                         $cmessage .= "(" . gettext("Unconfirmed") . ")";
                     }
                     $content->setVariable("TD_MANAGE_CONTACT", "<td align=\"center\"><a href=\"" . PATH_URL . "contact_delete.php?id=" . h($contact["OBJ_ID"]) . "\">" . gettext("Delete") . "</a></td>");
                 }
                 $contact_desc = empty($contact["OBJ_DESC"]) ? "student" : $contact["OBJ_DESC"];
                 $status = secure_gettext($contact_desc);
                 $content->setVariable("OBJ_DESC", h($status) . (strlen($cmessage) > 0 ? "<br />" . $cmessage : ""));
                 $content->parse("BLOCK_CONTACT");
             }
             $content->parse("BLOCK_CONTACT_LIST");
         } else {
             $content->setVariable("LABEL_CONTACTS", gettext("No contacts yet."));
         }
     } else {
         $messagebox = "<div class=\"infoBar\"><h2>" . gettext("The user has restricted the display of this information.") . "</h2></div>";
         $content = \Profile::getInstance()->loadTemplate("list_users.template.html");
         //$content = new \HTML_TEMPLATE_IT();
         //$content->loadTemplateFile( PATH_TEMPLATES . "list_users.template.html" );
         $content->setVariable("LABEL_PRIVACY_DENY_PARTICIPANTS", $messagebox);
     }
     $html_handler_profile->set_html_left($unconfirmed_html . $content->get());
     $frameResponseObject->setHeadline($html_handler_profile->get_headline());
     $rawHtml = new \Widgets\RawHtml();
     $rawHtml->setHtml($html_handler_profile->get_html());
     $frameResponseObject->addWidget($rawHtml);
     return $frameResponseObject;
     //$portal->set_page_main( $html_handler_profile->get_headline(), $html_handler_profile->get_html(), "vcard" );
     //return $portal->get_html();
 }