function display($block, $label, $value, $is_buddy = TRUE) { global $GENERAL_displayed, $CONTACTS_AND_GROUPS_displayed, $CONTACT_DATA_displayed; if (empty($value)) { return; } if ($is_buddy && viewer_authorized($label)) { $c = $GLOBALS["content"]; $c->setCurrentBlock("BLOCK_" . $block); $c->setVariable("LABEL_" . $block, secure_gettext($label)); $c->setVariable("VALUE_" . $block, $value); $c->parse("BLOCK_" . $block); ${$block . '_displayed'} = true; } }
public function execute(\FrameResponseObject $frameResponseObject) { //$portal = \lms_portal::get_instance(); //$portal->initialize( GUEST_NOT_ALLOWED ); //$portal->set_guest_allowed( GUEST_NOT_ALLOWED ); $user = \lms_steam::get_current_user(); //$portal_user = $portal->get_user(); //$path = $request->getPath(); $current_semester = $this->params[1]; $group_course = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), "Courses." . $this->params[0] . "." . $this->params[1]); $group = new \koala_group_course($group_course); //$html_handler_course = new \koala_html_course($course); if (!$group instanceof \koala_group) { throw new \Exception("Variable group not set."); } if ($_SERVER["REQUEST_METHOD"] == "POST") { if (isset($_POST["remove"]) && is_array($_POST["remove"])) { $id = key($_POST["remove"]); $member_to_kick = \steam_factory::username_to_object($GLOBALS["STEAM"]->get_id(), $id); $group->remove_member($member_to_kick); $frameResponseObject->setConfirmText(str_replace("%NAME", h($member_to_kick->get_attribute("USER_FIRSTNAME")) . " " . h($member_to_kick->get_attribute("USER_FULLNAME")), gettext("User %NAME successfully removed from group members."))); //$portal->set_confirmation( str_replace( "%NAME", h($member_to_kick->get_attribute( "USER_FIRSTNAME" ))." " . h($member_to_kick->get_attribute( "USER_FULLNAME" )), gettext( "User %NAME successfully removed from group members." ) ) ); // clear caches: $cache = get_cache_function($member_to_kick->get_name()); $cache->drop("lms_steam::user_get_groups", $member_to_kick->get_name(), TRUE); $cache->drop("lms_steam::user_get_groups", $member_to_kick->get_name(), FALSE); $cache->drop("lms_steam::user_get_profile", $member_to_kick->get_name()); $cache->drop("lms_portal::get_menu_html", $member_to_kick->get_name(), TRUE); $cache = get_cache_function($group->get_id()); $cache->drop("lms_steam::group_get_members", $group->get_id()); } else { if (isset($_POST["hide"]) && is_array($_POST["hide"])) { $hidden_members = $group->get_steam_group()->get_attribute("COURSE_HIDDEN_STAFF"); if (!is_array($hidden_members)) { $hidden_members = array(); } $users_to_hide = array_keys($_POST["hide"]); $displayed_staff_members = array(); $displayed_staff_members = array_keys($_POST["displayed_staff_member"]); $tmp1_users_to_hide = array_unique(array_merge($hidden_members, $users_to_hide)); $tmp2_users_to_hide = array_diff($tmp1_users_to_hide, $displayed_staff_members); $final_users_to_hide = array_unique(array_merge($tmp2_users_to_hide, $users_to_hide)); $group->get_steam_group()->set_attribute("COURSE_HIDDEN_STAFF", $final_users_to_hide); } else { $hidden_members = $group->get_steam_group()->get_attribute("COURSE_HIDDEN_STAFF"); if (!is_array($hidden_members)) { $hidden_members = array(); } $displayed_staff_members = array(); $displayed_staff_members = array_keys($_POST["displayed_staff_member"]); $users_to_hide = array(); $users_to_hide = array_diff($hidden_members, $displayed_staff_members); $group->get_steam_group()->set_attribute("COURSE_HIDDEN_STAFF", $users_to_hide); } $frameResponseObject->setConfirmText("Sucessfully updated the visibility of course staff"); //$portal->set_confirmation( "Sucessfully updated the visibility of course staff" ); } } $cache = get_cache_function($group->get_id(), CACHE_LIFETIME_STATIC); switch (get_class($group)) { case "koala_group_course": $html_handler_group = new \koala_html_course($group); $html_handler_group->set_context("staff"); //$members = $cache->call( "lms_steam::group_get_members", $group->steam_group_staff->get_id() ); $members = \lms_steam::group_get_members($group->steam_group_staff->get_id()); break; default: $html_handler_group = new \koala_html_group($group); $html_handler_group->set_context("staff"); //$members = $cache->call( "lms_steam::group_get_members", $group->get_id() ); $members = \lms_steam::group_get_members($group->get_id()); break; } $is_admin = $group->is_admin($user); $content = \Course::getInstance()->loadTemplate("list_staff.template.html"); //$content = new HTML_TEMPLATE_IT(); //$content->loadTemplateFile( PATH_TEMPLATES . "list_staff.template.html" ); $no_members = count($members); //DONE if ($no_members > 0) { $pageIterator = \lms_portal::get_paginator(10, $no_members, "(" . str_replace("%NAME", h($group->get_name()), gettext("%TOTAL members in %NAME")) . ")"); $content->setVariable("PAGEITERATOR", $pageIterator["html"]); $start = $pageIterator["startIndex"]; //$start = $portal->set_paginator( $content, 10, $no_members, "(" . str_replace( "%NAME", h($group->get_name()), gettext( "%TOTAL members in %NAME" ) ) . ")" ); $end = $start + 10 > $no_members ? $no_members : $start + 10; $content->setVariable("LABEL_CONTACTS", gettext("staff member") . " (" . str_replace(array("%a", "%z", "%s"), array($start + 1, $end, $no_members), gettext("%a-%z out of %s")) . ")"); $content->setCurrentBlock("BLOCK_CONTACT_LIST"); $content->setVariable("LABEL_NAME_POSITION", gettext("Name, position")); !COURSE_STAFF_FACULTY_AND_FOCUS or $content->setVariable("LABEL_SUBJECT_AREA", gettext("Origin/Focus")); $content->setVariable("LABEL_COMMUNICATION", gettext("Communication")); if (\lms_steam::is_koala_admin($user) || !COURSE_KOALAADMIN_ONLY && $is_admin) { !COURSE_STAFFLIST_MANAGE or $content->setVariable("TH_MANAGE_CONTACT", gettext("Action")); !COURSE_STAFFLIST_HIDE or $content->setVariable("TH_STAFF_MEMBER_VISIBILITY", gettext("hidden")); !COURSE_STAFFLIST_HIDE or $content->setVariable("STAFF_MEMBER_VISIBILITY_TITLE", gettext("Selected staff members will not be visible on the course start page.")); } !COURSE_STAFF_EXTENSIONS or $content->setVariable("TH_MANAGE_EXTENSIONS", "Status"); $content->setVariable("BEGIN_HTML_FORM", "<form method=\"POST\" action=\"\">"); $content->setVariable("END_HTML_FORM", "</form>"); $hidden_members = $group->get_steam_group()->get_attribute("COURSE_HIDDEN_STAFF"); if (!is_array($hidden_members)) { $hidden_members = array(); } for ($i = $start; $i < $end; $i++) { $member = $members[$i]; if ($member["USER_TRASHED"] === 1) { continue; } $content->setCurrentBlock("BLOCK_CONTACT"); $content->setVariable("CONTACT_LINK", PATH_URL . "user/" . h($member["OBJ_NAME"]) . "/"); $icon_link = $member["OBJ_ICON"] == 0 ? PATH_STYLE . "images/anonymous.jpg" : PATH_URL . "download/image/" . h($member["OBJ_ICON"]) . "/26/35"; $content->setVariable("CONTACT_IMAGE", $icon_link); $title = !empty($member["USER_ACADEMIC_TITLE"]) ? h($member["USER_ACADEMIC_TITLE"]) . " " : ""; $content->setVariable("CONTACT_NAME", $title . h($member["USER_FIRSTNAME"]) . " " . h($member["USER_FULLNAME"])); if (!COURSE_SHOW_ONLY_EXTERN_MAIL || COURSE_SHOW_ONLY_EXTERN_MAIL && is_string(\steam_factory::get_user($GLOBALS['STEAM']->get_id(), $member["OBJ_NAME"])->get_attribute("USER_EMAIL")) && steam_factory::get_user($GLOBALS['STEAM']->get_id(), $member["OBJ_NAME"])->get_attribute("USER_EMAIL") != "" && steam_factory::get_user($GLOBALS['STEAM']->get_id(), $member["OBJ_NAME"])->get_attribute("USER_FORWARD_MSG") === 1) { $content->setVariable("LINK_SEND_MESSAGE", PATH_URL . "messages_write.php?to=" . h($member["OBJ_NAME"])); $content->setVariable("LABEL_MESSAGE", gettext("Message")); $content->setVariable("LABEL_SEND", gettext("Send")); } !COURSE_STAFF_FACULTY_AND_FOCUS or $content->setVariable("FACULTY_AND_FOCUS", h($member["USER_PROFILE_FACULTY"])); if (\lms_steam::is_koala_admin($user) || !COURSE_KOALAADMIN_ONLY && $is_admin) { !COURSE_STAFFLIST_MANAGE or $content->setVariable("TD_MANAGE_CONTACT", "<td align=\"center\"><input type=\"submit\" name=\"remove[" . h($member["OBJ_NAME"]) . "]\" value=\"" . gettext("Remove") . "\"/></td>"); if (in_array($member["OBJ_ID"], $hidden_members)) { !COURSE_STAFFLIST_HIDE or $content->setVariable("TD_STAFF_MEMBER_VISIBILITY", "<td align=\"center\"><input type=\"checkbox\" name=\"hide[" . $member["OBJ_ID"] . "]\" checked=\"checked\"/>" . "\n\t\t\t<input type=\"hidden\" name=\"displayed_staff_member[" . $member["OBJ_ID"] . "]\" />" . "</td>"); } else { !COURSE_STAFFLIST_HIDE or $content->setVariable("TD_STAFF_MEMBER_VISIBILITY", "<td align=\"center\"><input type=\"checkbox\" name=\"hide[" . $member["OBJ_ID"] . "]\" />" . "\n\t\t\t<input type=\"hidden\" name=\"displayed_staff_member[" . $member["OBJ_ID"] . "]\" />" . "</td>"); } } $member_desc = empty($member["OBJ_DESC"]) ? "student" : $member["OBJ_DESC"]; $status = secure_gettext($member_desc); $content->setVariable("OBJ_DESC", h($status)); if (COURSE_STAFF_EXTENSIONS) { $extensions = $group->get_extensions(); $result = ""; foreach ($extensions as $extension) { $result .= $extension->get_member_info(\steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $member["OBJ_NAME"]), $group); } $content->setVariable("EXTENSIONS_DATA", $result); } $content->parse("BLOCK_CONTACT"); } if (\lms_steam::is_koala_admin($user) || !COURSE_KOALAADMIN_ONLY && $is_admin) { !COURSE_STAFFLIST_HIDE or $content->setVariable("LABEL_SUBMIT_BUTTON", gettext("Save")); } $content->parse("BLOCK_CONTACT_LIST"); } else { $content->setVariable("LABEL_NO_MEMBERS", gettext("No staff found.")); } $html_handler_group->set_html_left($content->get()); //$portal->set_page_main( $html_handler_group->get_headline(), $html_handler_group->get_html() , "" ); $frameResponseObject->setHeadline($html_handler_group->get_headline()); $widget = new \Widgets\RawHtml(); $widget->setHtml($html_handler_group->get_html()); $frameResponseObject->addWidget($widget); return $frameResponseObject; }
public function initialize($guest_allowed = FALSE, $offline = FALSE) { if ($this->init_done) { return; } $this->init_login($guest_allowed, $offline); // LOG OUT ON POST-EVENT if (isset($_GET["action"]) && $_GET["action"] == "sign_out") { $this->set_confirmation(gettext("You are logged out.")); $this->logout(); } if (isset($_GET["action"]) && $_GET["action"] == "search") { } if (!$offline) { lms_steam::connect(STEAM_SERVER, STEAM_PORT, $this->lms_user->get_login(), $this->lms_user->get_password()); } // DISCLAIMER HANDLING if (DISCLAIMER && isset($GLOBALS['STEAM']) && $this->lms_user->get_login() != "guest") { $steam_user = $GLOBALS['STEAM']->get_current_steam_user(); if ($steam_user instanceof steam_user) { $user_disclaimer = $steam_user->get_attribute("USER_ACCEPTED_DISCLAIMER"); if ($user_disclaimer === 0 || !$user_disclaimer === "TRUE") { if (strpos($_SERVER['REQUEST_URI'], "disclaimer_local.php") == null) { throw new Exception("Disclaimer must be accepted.", E_USER_DISCLAIMER); } } } } // CHANGE PASSWORD if (CHANGE_PASSWORD && isset($GLOBALS['STEAM']) && isset($GLOBALS['STEAM'])) { $steam_user = $GLOBALS['STEAM']->get_current_steam_user(); if ($steam_user instanceof steam_user) { $user_generated_password = $steam_user->get_attribute("USER_GENERATED_PASSWORD"); if ($user_generated_password != "") { if (strpos($_SERVER['REQUEST_URI'], "usermanagement") == null && strpos($_SERVER['REQUEST_URI'], "disclaimer_local.php") == null) { throw new Exception("Change Password.", E_USER_CHANGE_PASSWORD); } } } } // CHOOSE RIGHT LANGUAGE AND SET LOCALES FOR GETTEXT language_support::choose_language(); // SET LOGO URL $this->template->setVariable("PATH_URL", PATH_URL); // SET STYLEPATH AND ADDITIONAL HEADERS $this->template->setVariable("STYLE_PATH", PATH_STYLE); $this->template->setVariable("STANDARD_STYLE_PATH", PATH_URL); // LOAD JAVA-SCRIPTS // $this->add_javascript( PATH_JAVASCRIPT . "bbcode.js?version=".KOALA_VERSION ); // $this->add_javascript( PATH_JAVASCRIPT . "javascript_minimized.js?version=".KOALA_VERSION ); $this->template->setVariable("PATH_JAVASCRIPT", PATH_JAVASCRIPT); $this->template->setVariable("KOALA_VERSION", KOALA_VERSION); // GENERATE HTML FOR STATUS-DIV $this->set_status($offline); // SET CONFIRMATION $this->set_confirmation(); // SET ERROR $this->set_problem_description(""); // Set default page title $this->set_page_title(""); $this->template->setVariable("DEVELOPER_MODE", DEVELOPMENT_MODE); $this->template->setVariable("PATH_URL", PATH_URL); // SET USER ID FOR JAVASCRIPTS $this->template->setVariable("USER_LOGIN", $this->lms_user->get_login()); // LANGUAGE if (isset($_SESSION["LMS_USER"]) && $_SESSION["LMS_USER"]->is_logged_in() && isset($GLOBALS["STEAM"]) && is_object($GLOBALS["STEAM"]->get_current_steam_user())) { $ulang = $GLOBALS["STEAM"]->get_current_steam_user()->get_attribute("USER_LANGUAGE"); if (!is_string($ulang) || $ulang === "0") { $ulang = LANGUAGE_DEFAULT_STEAM; } $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")); if (!array_key_exists($ulang, $languages)) { $ulang = LANGUAGE_DEFAULT_STEAM; } /* $this->template->setCurrentBlock("PORTAL_LANGUAGES"); $this->template->setVariable("PORTAL_LANGUAGES_REDIRECT", $_SERVER["REQUEST_URI"] ); $this->template->setVariable("PORTAL_LANGUAGES_ACTION", PATH_URL . "?action=switch_language"); foreach( $languages as $key => $language) { $this->template->setCurrentBlock("LANGUAGE"); $this->template->setVariable("LABEL_LANGUAGE_LABEL", "language_" . $key); $this->template->setVariable("LANGUAGE_ICON", PATH_URL . "styles/" . STYLE . "/images/" . $language["icon"]); $this->template->setVariable("LABEL_LANGUAGE", $language["name"]); $this->template->setVariable("LANGUAGE_VALUE", $key); if ( $ulang == $key ) { $this->template->setVariable("LANGUAGE_CHECKED", "checked=\"checked\""); } $this->template->parse("LANGUAGE"); } $this->template->parse("PORTAL_LANGUAGES"); */ } $this->template->setVariable("COPYRIGHT_INFO", "© " . strftime("%Y") . " " . secure_gettext(COPYRIGHT_NAME)); $this->template->setVariable("IMPRESSUM_INFO", " | " . " <a href='" . PATH_URL . "imprint/'>" . gettext("Imprint") . "</a>"); DISCLAIMER ? $this->template->setVariable("SECURITY_INFO", " | " . " <a href='" . PATH_URL . "disclaimer_static.php'>" . "Nutzerordnung" . "</a>") : ""; // $this->template->setVariable( "SECURITY_INFO", " | " . " <a target='_blank' href='".PATH_URL."html/datenschutzerklaerung.html' >Datenschutzerklärung</a>" ); // $this->template->setVariable( "POLICY_INFO", " | " . " <a target='_blank' href='".PATH_URL."html/policy.html' >Policy</a>" ); // $this->template->setVariable( "FUNDING_INFO", " | " . str_replace( "%NAME", " <a href='http://www.bmbf.de' target='_blank'>BMBF</a>", gettext( "funded by %NAME" ) ) ); // $this->template->setVariable( "POWERED_BY_INFO", " | " . str_replace( "%NAME", " <a href='http://www.open-steam.org' target='_blank'>open-sTeam</a>", gettext( "powered by %NAME" ) ) ); logging::write_log(LOG_MESSAGES, "RELOAD\t" . $this->lms_user->get_login()); $this->init_done = true; }
$content->setVariable("CONTACT_IMAGE", $icon_link); $title = !empty($member["USER_ACADEMIC_TITLE"]) ? h($member["USER_ACADEMIC_TITLE"]) . " " : ""; $content->setVariable("CONTACT_NAME", $title . h($member["USER_FIRSTNAME"]) . " " . h($member["USER_FULLNAME"])); !COURSE_PARTICIPANTS_COMMUNICATION or $content->setVariable("LINK_SEND_MESSAGE", PATH_URL . "messages_write.php?to=" . h($member["OBJ_NAME"])); !COURSE_PARTICIPANTS_COMMUNICATION or $content->setVariable("LABEL_MESSAGE", gettext("Message")); !COURSE_PARTICIPANTS_COMMUNICATION or $content->setVariable("LABEL_SEND", gettext("Send")); !COURSE_PARTICIPANTS_FACULTY_AND_FOCUS or $content->setVariable("FACULTY_AND_FOCUS", h($member["USER_PROFILE_FACULTY"])); if (lms_steam::is_koala_admin($user) || !COURSE_KOALAADMIN_ONLY && $is_admin) { !COURSE_PARTICIPANTSLIST_MANAGE or $content->setVariable("TD_MANAGE_CONTACT", "<td align=\"center\"><input type=\"submit\" name=\"remove[" . h($member["OBJ_NAME"]) . "]\" value=\"" . gettext("Remove") . "\"/></td>"); } if (COURSE_PARTICIPANTS_EXTENSIONS) { $extensions = $group->get_extensions(); $result = ""; foreach ($extensions as $extension) { $result .= $extension->get_member_info(steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $member["OBJ_NAME"]), $group); } $content->setVariable("EXTENSIONS_DATA", $result); } $member_desc = empty($member["OBJ_DESC"]) ? "student" : $member["OBJ_DESC"]; $status = secure_gettext($member_desc); $content->setVariable("OBJ_DESC", h($status) . " " . ($i + 1)); $content->parse("BLOCK_CONTACT"); } $content->parse("BLOCK_CONTACT_LIST"); } else { $content->setVariable("LABEL_NO_MEMBERS", gettext("No members found.")); } } $html_handler_group->set_html_left($content->get()); $portal->set_page_main($html_handler_group->get_headline(), $html_handler_group->get_html(), ""); $portal->show_html();
public function execute(\FrameResponseObject $frameResponseObject) { $user = \lms_steam::get_current_user(); $cache = get_cache_function($user->get_name(), 86400); $user_profile = $cache->call("lms_steam::user_get_profile", $user->get_name()); if ($_SERVER["REQUEST_METHOD"] == "POST") { $values = $_POST["values"]; foreach ($values as $i => $val) { $values[$i] = htmlspecialchars($val); } if (!empty($values["USER_PROFILE_WEBSITE_URI"]) && substr($values["USER_PROFILE_WEBSITE_URI"], 0, 7) != "http://") { $values["USER_PROFILE_WEBSITE_URI"] = "http://" . $values["USER_PROFILE_WEBSITE_URI"]; } $user->set_attributes($values); if (!empty($values["USER_PROFILE_FACULTY"])) { $old_fac_id = $user_profile["USER_PROFILE_FACULTY"]; $new_fac_id = $values["USER_PROFILE_FACULTY"]; if ($new_fac_id != $old_fac_id) { if ($old_fac_id > 0) { $old_faculty = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $old_fac_id, CLASS_GROUP); $old_faculty->remove_member($user); } if ($new_fac_id > 0) { $new_faculty = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $new_fac_id, CLASS_GROUP); $new_faculty->add_member($user); } } } /* require_once( "Cache/Lite.php" ); $cache = new Cache_Lite( array( "cacheDir" => PATH_CACHE ) ); $cache->clean( $user->get_name() ); $cache->clean( $user->get_id() );*/ if (!empty($values["USER_LANGUAGE"])) { //var_dump($values["USER_LANGUAGE"]);die; $lang_index = \language_support::get_language_index(); \language_support::choose_language($lang_index[$values["USER_LANGUAGE"]]); } $cache = get_cache_function(\lms_steam::get_current_user()->get_name()); $cache->drop("lms_portal::get_menu_html", \lms_steam::get_current_user()->get_name(), TRUE); $cache = get_cache_function($user->get_name()); $cache->drop("lms_steam::user_get_profile", $user->get_name()); $_SESSION["confirmation"] = gettext("Your profile data has been saved."); header("Location: " . PATH_URL . "profile/edit"); } $content = \Profile::getInstance()->loadTemplate("profile_edit.template.html"); //$content = new \HTML_TEMPLATE_IT(); //$content->loadTemplateFile( PATH_TEMPLATES . "profile_edit.template.html" ); if (PLATFORM_ID == "bid") { $content->setVariable("LABEL_INFO", "Hier können Sie Ihre persönlichen Kontaktdaten einrichten. Bis auf Ihren Namen sind alle Angaben freiwillig und können von Ihnen geändert werden. Klicken Sie auf den Button <b><i>Profil-Privatsphäre</i></b> um festzulegen, wem welche Informationen angezeigt werden sollen."); } else { $content->setVariable("LABEL_INFO", gettext("Please complete your profile. None of the fields are mandatory. Some of the fields can not be changed due to central identity management at the IMT.<br/><b>Note: With the button <i>Profile Privacy</i> you can control which information can be seen by other users.</b>")); } if (ENABLED_PROFILE_TITLE) { $content->setVariable("LABEL_PROFILE", gettext("General Information")); } $content->setVariable("LABEL_LOOKING", gettext("Your buddy icon")); $content->setVariable("LABEL_MAIL_PREFS", gettext("Your mail preferences")); $content->setVariable("LABEL_PROFILE_PRIVACY", gettext("Profile Privacy")); $content->setVariable("LINK_BUDDY_ICON", PATH_URL . "profile/image"); $content->setVariable("LINK_MAIL_PREFS", PATH_URL . "messages_prefs.php"); $content->setVariable("LINK_PROFILE_PRIVACY", PATH_URL . "profile/privacy"); if (ENABLED_FIRST_NAME) { $content->setVariable("LABEL_FIRST_NAME", gettext("First name")); } if (ENABLED_FULL_NAME) { $content->setVariable("LABEL_LAST_NAME", gettext("Last name")); } if (ENABLED_DEGREE) { $content->setVariable("LABEL_TITLE", gettext("Academic title")); $content->setVariable("LABEL_DEGREE", gettext("Academic degree")); $content->setVariable("LABEL_IF_AVAILABLE", gettext("only if available")); $academicTitle = (string) $user_profile["USER_ACADEMIC_TITLE"]; switch ($academicTitle) { case "Dr.": $content->setVariable("TITLE_DR_SELECTED", 'selected="selected"'); break; case "PD Dr.": $content->setVariable("TITLE_PRIVDOZDR_SELECTED", 'selected="selected"'); break; case "Prof.": $content->setVariable("TITLE_PROF_SELECTED", 'selected="selected"'); break; case "Prof. Dr.": $content->setVariable("TITLE_PROFDR_SELECTED", 'selected="selected"'); break; default: $content->setVariable("TITLE_NULL_SELECTED", 'selected="selected"'); break; } $content->setVariable("VALUE_ACADEMIC_DEGREE", $this->safe_string($user_profile["USER_ACADEMIC_DEGREE"])); } if (ENABLED_BID_DESCIPTION) { $content->setVariable("LABEL_STATUS_BID", gettext("Description")); } if (ENABLED_STATUS) { $content->setVariable("LABEL_STATUS", gettext("Status")); } if (ENABLED_GENDER) { $content->setVariable("LABEL_GENDER", gettext("Gender")); $content->setVariable("LABEL_FEMALE", gettext("female")); $content->setVariable("LABEL_MALE", gettext("male")); $content->setVariable("LABEL_NOT_SAY", gettext("rather not say")); } if (ENABLED_FACULTY) { $content->setVariable("LABEL_FACULTY", gettext("Origin")); } if (ENABLED_MAIN_FOCUS) { $content->setVariable("LABEL_MAIN_FOCUS", gettext("Main focus")); } if (ENABLED_HOMETOWN) { $content->setVariable("LABEL_HOMETOWN", gettext("Hometown")); } if (ENABLED_WANTS) { $content->setVariable("LABEL_WANTS", gettext("Wants")); } if (ENABLED_HAVES) { $content->setVariable("LABEL_HAVES", gettext("Haves")); } if (ENABLED_OTHER_INTERESTS) { $content->setVariable("LABEL_OTHER_INTERESTS", gettext("Other interests")); } if (ENABLED_ORGANIZATIONS) { $content->setVariable("LABEL_ORGANIZATIONS", gettext("Organizations")); } if (ENABLED_USER_DESC) { $content->setVariable("LABEL_DESCRIBE_YOURSELF", gettext("Describe yourself")); } if (ENABLED_CONTACTS_TITLE) { $content->setVariable("LABEL_CONTACT_DATA", gettext("Contact Data")); } if (ENABLED_EMAIL) { $content->setVariable("LABEL_EMAIL", gettext("E-mail")); $content->setVariable("LABEL_EMAIL_PREFERENCES", gettext("Looking for your e-mail preferences?")); //$content->setVariable( "LINK_EMAIL_PREFERENCES", PATH_URL . "messages_prefs.php" ); } if (ENABLED_TELEPHONE) { //$content->setVariable( "LABEL_TELEPHONE", gettext( "Phone" ) ); $content->setVariable("LABEL_TELEPHONE", "Telefon"); } $content->setVariable("LABEL_MOBILE", gettext("Phone, mobile")); if (ENABLED_ADDRESS) { $content->setVariable("LABEL_ADDRESS", gettext("Address")); } if (ENABLED_PHONE_MOBILE) { $content->setVariable("LABEL_PHONE_MOBILE", gettext("Phone, mobile")); } if (ENABLED_WEBSITE) { $content->setVariable("LABEL_WEBSITE", gettext("Website")); $content->setVariable("LABEL_WEBSITE_NAME", gettext("Website name")); } //TODO: IM-Speichern dementsprechend anpassen if (ENABLED_ICQ_NUMBER || ENABLED_BID_IM) { $content->setVariable("LABEL_ICQ_NUMBER", gettext("ICQ number")); } if (ENABLED_MSN_IDENTIFICATION || ENABLED_BID_IM) { $content->setVariable("LABEL_MSN_IDENTIFICATION", gettext("MSN identification")); } if (ENABLED_AIM_ALIAS || ENABLED_BID_IM) { $content->setVariable("LABEL_AIM_ALIAS", gettext("AIM-alias")); } if (ENABLED_YAHOO_ID || ENABLED_BID_IM) { $content->setVariable("LABEL_YAHOO_ID", gettext("Yahoo-ID")); } if (ENABLED_SKYPE_NAME || ENABLED_BID_IM) { $content->setVariable("LABEL_SKYPE_NAME", gettext("Skype name")); } $content->setVariable("INFO_INCLUDE_HTTP", gettext("Please include the 'http://'")); $content->setVariable("LABEL_SAVE_IT", gettext("Save changes")); $content->setVariable("BACK_LINK", PATH_URL . "profile/index/" . $user->get_name() . "/"); $content->setVariable("LABEL_GOTO_HOMEPAGE", "<a href=\"" . PATH_URL . "profile/index/" . $user->get_name() . "/\">" . gettext("back") . "</a>"); if (ENABLED_USER_DESC) { $content->setVariable("LABEL_BB_BOLD", gettext("B")); $content->setVariable("HINT_BB_BOLD", gettext("boldface")); $content->setVariable("LABEL_BB_ITALIC", gettext("I")); $content->setVariable("HINT_BB_ITALIC", gettext("italic")); $content->setVariable("LABEL_BB_UNDERLINE", gettext("U")); $content->setVariable("HINT_BB_UNDERLINE", gettext("underline")); $content->setVariable("LABEL_BB_STRIKETHROUGH", gettext("S")); $content->setVariable("HINT_BB_STRIKETHROUGH", gettext("strikethrough")); $content->setVariable("LABEL_BB_IMAGE", gettext("IMG")); $content->setVariable("HINT_BB_IMAGE", gettext("image")); $content->setVariable("LABEL_BB_URL", gettext("URL")); $content->setVariable("HINT_BB_URL", gettext("web link")); $content->setVariable("LABEL_BB_MAIL", gettext("MAIL")); $content->setVariable("HINT_BB_MAIL", gettext("email link")); } // PROFILE VALUES if (ENABLED_FIRST_NAME) { $content->setVariable("VALUE_USER_FIRSTNAME", $this->safe_string($user_profile["USER_FIRSTNAME"])); } if (ENABLED_FULL_NAME) { $content->setVariable("VALUE_USER_FULLNAME", $this->safe_string($user_profile["USER_FULLNAME"])); } /* * Assure translations for statuses are available via gettext */ //var_dump($user_profile);die; gettext("student"); gettext("staff member"); gettext("guest"); gettext("alumni"); if (ENABLED_BID_DESCIPTION) { $content->setVariable("VALUE_STATUS_BID", $this->safe_string($user_profile["OBJ_DESC"])); } if (ENABLED_STATUS) { $stati = array("student", "staff member", "guest", "alumni"); foreach ($stati as $status) { $content->setCurrentBlock("BLOCK_STATUS"); $content->setVariable("VALUE_STATUS", $status); if ($status === $user_profile["OBJ_DESC"]) { $content->setVariable("STATUS_SELECTED", 'selected="selected"'); } $content->setVariable("VALUE_STATUS_TRANSLATED", secure_gettext($status)); $content->parse("BLOCK_STATUS"); } } //TODO: TEMPLATE EDITIEREN if (ENABLED_GENDER) { $content->setVariable("GENDER_" . $this->safe_string($user_profile["USER_PROFILE_GENDER"], "X") . "_CHECKED", 'checked="checked"'); } $cache = get_cache_function("ORGANIZATION", 86400); if (ENABLED_FACULTY) { $faculties = $cache->call("lms_steam::get_faculties_asc"); $content->setVariable("LABEL_MISCELLANEOUS", gettext("miscellaneous")); foreach ($faculties as $faculty) { $content->setCurrentBlock("BLOCK_FACULTY"); $content->setVariable("FACULTY_ID", $faculty["OBJ_ID"]); if ($user_profile["USER_PROFILE_FACULTY"] == $faculty["OBJ_ID"]) { $content->setVariable("FACULTY_SELECTED", 'selected="selected"'); } $content->setVariable("FACULTY_NAME", $faculty["OBJ_NAME"]); $content->parse("BLOCK_FACULTY"); } } if (ENABLED_MAIN_FOCUS) { $content->setVariable("VALUE_FOCUS", $this->safe_string($user_profile["USER_PROFILE_FOCUS"])); } if (ENABLED_HOMETOWN) { $content->setVariable("VALUE_HOMETOWN", $this->safe_string($user_profile["USER_PROFILE_HOMETOWN"])); } if (ENABLED_WANTS) { $content->setVariable("VALUE_WANTS", $this->safe_string($user_profile["USER_PROFILE_WANTS"])); } if (ENABLED_HAVES) { $content->setVariable("VALUE_HAVES", $this->safe_string($user_profile["USER_PROFILE_HAVES"])); } if (ENABLED_OTHER_INTERESTS) { $content->setVariable("VALUE_OTHER_INTERESTS", $this->safe_string($user_profile["USER_PROFILE_OTHER_INTERESTS"])); } if (ENABLED_ORGANIZATIONS) { $content->setVariable("VALUE_ORGANIZATIONS", $this->safe_string($user_profile["USER_PROFILE_ORGANIZATIONS"])); } if (ENABLED_USER_DESC) { $content->setVariable("VALUE_USER_PROFILE_DSC", $this->safe_string($user_profile["USER_PROFILE_DSC"])); } if (ENABLED_EMAIL) { $content->setVariable("VALUE_EMAIL", $this->safe_string($user_profile["USER_EMAIL"])); } if (ENABLED_ADDRESS) { $content->setVariable("VALUE_ADDRESS", $this->safe_string($user_profile["USER_PROFILE_ADDRESS"])); } if (ENABLED_TELEPHONE) { $content->setVariable("VALUE_TELEPHONE", $this->safe_string($user_profile["USER_PROFILE_TELEPHONE"])); } if (ENABLED_PHONE_MOBILE) { $content->setVariable("VALUE_PHONE_MOBILE", $this->safe_string($user_profile["USER_PROFILE_PHONE_MOBILE"])); } if (ENABLED_WEBSITE) { $content->setVariable("VALUE_WEBSITE", $this->safe_string($user_profile["USER_PROFILE_WEBSITE_URI"])); $content->setVariable("VALUE_WEBSITE_NAME", $this->safe_string($user_profile["USER_PROFILE_WEBSITE_NAME"])); } if (ENABLED_ICQ_NUMBER || ENABLED_BID_IM) { $content->setVariable("VALUE_IM_ICQ", $this->safe_string($user_profile["USER_PROFILE_IM_ICQ"])); } if (ENABLED_SKYPE_NAME || ENABLED_BID_IM) { $content->setVariable("VALUE_IM_SKYPE", $this->safe_string($user_profile["USER_PROFILE_IM_SKYPE"])); } if (ENABLED_AIM_ALIAS || ENABLED_BID_IM) { $content->setVariable("VALUE_IM_AIM", $this->safe_string($user_profile["USER_PROFILE_IM_AIM"])); } if (ENABLED_MSN_IDENTIFICATION || ENABLED_BID_IM) { $content->setVariable("VALUE_IM_MSN", $this->safe_string($user_profile["USER_PROFILE_IM_MSN"])); } if (ENABLED_YAHOO_ID || ENABLED_BID_IM) { $content->setVariable("VALUE_IM_YAHOO", $this->safe_string($user_profile["USER_PROFILE_IM_YAHOO"])); } if (ENABLED_LANGUAGES) { // LANGUAGE if (TRUE) { // && !empty($user_profile["USER_LANGUAGE"]) ) { $ulang = $user_profile["USER_LANGUAGE"]; if (!is_string($ulang) || $ulang === "0") { $ulang = LANGUAGE_DEFAULT_STEAM; } $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")); if (!array_key_exists($ulang, $languages)) { $ulang = LANGUAGE_DEFAULT_STEAM; } $content->setCurrentBlock("USER_LANGUAGE"); $content->setVariable("LABEL_LANGUAGES", gettext("Language")); foreach ($languages as $key => $language) { $content->setCurrentBlock("LANGUAGE"); $content->setVariable("LABEL_LANGUAGE_LABEL", "profile_language_" . $key); $content->setVariable("LANGUAGE_ICON", PATH_STYLE . "/images/" . $language["icon"]); $content->setVariable("LABEL_LANGUAGE", $language["name"]); $content->setVariable("LANGUAGE_VALUE", $key); if ($ulang == $key) { $content->setVariable("LANGUAGE_CHECKED", "checked=\"checked\""); } $content->parse("LANGUAGE"); } $content->parse("USER_LANGUAGE"); } } if (ENABLED_BID_LANGUAGE) { $content->setVariable("LABEL_LANGUAGES", gettext("Language")); if (trim($user_profile["USER_LANGUAGE"]) == trim("german")) { $content->setVariable("LANG1", "Deutsch"); $content->setVariable("LANG2", "English"); $content->setVariable("LANG3", "german"); $content->setVariable("LANG4", "english"); } else { $content->setVariable("LANG1", "English"); $content->setVariable("LANG2", "Deutsch"); $content->setVariable("LANG3", "english"); $content->setVariable("LANG4", "german"); } } if (ENABLED_BID_NAME) { $content->setVariable("LABEL_BID_NAME", gettext("name")); $completeName = $user_profile["USER_FIRSTNAME"] . " " . $user_profile["USER_FULLNAME"]; $content->setVariable("VALUE_USER_NAME_BID", $completeName); } if (ENABLED_BID_ADRESS) { $content->setVariable("LABEL_BID_ADDRESS", gettext("Address")); $content->setVariable("VALUE_BID_ADDRESS", $user->get_attribute("USER_ADRESS")); } if (ENABLED_BID_EMAIL) { $content->setVariable("LABEL_EMAIL_BID", gettext("E-Mail")); $content->setVariable("VALUE_EMAIL_BID", $user->get_attribute("USER_EMAIL")); } if (ENABLED_BID_PHONE) { $content->setVariable("LABEL_TELEPHONE_BID", "Telefon"); $content->setVariable("VALUE_TELEPHONE_BID", $user->get_attribute("bid:user_callto")); } //var_dump($user_profile);die; if (PLATFORM_ID == "bid") { $frameResponseObject->setHeadline(array(array("link" => PATH_URL . "home/", "name" => $user->get_attribute("USER_FIRSTNAME") . " " . $user->get_attribute("USER_FULLNAME")), array("link" => PATH_URL . "profile/", "name" => gettext("Profile")), array("link" => "", "name" => "Profil ändern"))); } else { $frameResponseObject->setHeadline(array(array("link" => PATH_URL . "profile/index/" . $user->get_name() . "/", "name" => $user->get_attribute("USER_FIRSTNAME") . " " . $user->get_attribute("USER_FULLNAME")), array("link" => "", "name" => gettext("Profile")))); } $rawHtml = new \Widgets\RawHtml(); $rawHtml->setHtml($content->get()); $frameResponseObject->addWidget($rawHtml); /*$portal->set_page_main( array( array( "link" => PATH_URL . "profile/index/" . $user->get_name() . "/", "name" => $user->get_attribute( "USER_FIRSTNAME" ) . " " . $user->get_attribute( "USER_FULLNAME" ) ), array( "link" => "", "name" => gettext( "Profile" ) ) ), $content->get(), "" );*/ return $frameResponseObject; }
$content->setVariable("VALUE_ACADEMIC_DEGREE", safe_string($user_profile["USER_ACADEMIC_DEGREE"])); /* * Assure translations for statuses are available via gettext */ gettext("student"); gettext("staff member"); gettext("guest"); gettext("alumni"); $stati = array("student", "staff member", "guest", "alumni"); foreach ($stati as $status) { $content->setCurrentBlock("BLOCK_STATUS"); $content->setVariable("VALUE_STATUS", $status); if ($status === $user_profile["OBJ_DESC"]) { $content->setVariable("STATUS_SELECTED", 'selected="selected"'); } $content->setVariable("VALUE_STATUS_TRANSLATED", secure_gettext($status)); $content->parse("BLOCK_STATUS"); } $academicTitle = (string) $user_profile["USER_ACADEMIC_TITLE"]; switch ($academicTitle) { case "Dr.": $content->setVariable("TITLE_DR_SELECTED", 'selected="selected"'); break; case "PD Dr.": $content->setVariable("TITLE_PRIVDOZDR_SELECTED", 'selected="selected"'); break; case "Prof.": $content->setVariable("TITLE_PROF_SELECTED", 'selected="selected"'); break; case "Prof. Dr.": $content->setVariable("TITLE_PROFDR_SELECTED", 'selected="selected"');
} $content->setVariable("LABEL_ADMINS", gettext("Moderated by")); if ($group->get_maxsize() > 0) { $content->setCurrentBlock("BLOCK_GROUPSIZE"); $content->setVariable("LABEL_MAXSIZE_HEADER", gettext("The number of participants of this group is limited.")); $content->setVariable("LABEL_MAXSIZE_DESCRIPTION", str_replace("%MAX", $group->get_maxsize(), str_replace("%ACTUAL", $group->count_members(), gettext("The actual participant count is %ACTUAL of %MAX.")))); $content->parse("BLOCK_GROUPSIZE"); } $admins = $group->get_admins(); if (count($admins) > 0) { foreach ($admins as $admin) { $content->setCurrentBlock("BLOCK_ADMIN"); $admin_attributes = $admin->get_attributes(array("USER_FIRSTNAME", "USER_FULLNAME", "OBJ_ICON", "OBJ_DESC", "OBJ_NAME")); if ($admin instanceof steam_user) { $content->setVariable("ADMIN_NAME", h($admin_attributes["USER_FIRSTNAME"]) . " " . h($admin_attributes["USER_FULLNAME"])); $content->setVariable("ADMIN_LINK", PATH_URL . "user/" . h($admin->get_name()) . "/"); } else { $content->setVariable("ADMIN_NAME", h($admin_attributes["OBJ_NAME"])); $content->setVariable("ADMIN_LINK", PATH_URL . "groups/" . $admin->get_id() . "/"); } $content->setVariable("ADMIN_ICON", PATH_URL . "cached/get_document.php?id=" . $admin_attributes["OBJ_ICON"]->get_id() . "&type=usericon&width=40&height=47"); $admin_desc = empty($admin_attributes["OBJ_DESC"]) ? "student" : $admin_attributes["OBJ_DESC"]; $content->setVariable("ADMIN_DESC", secure_gettext($admin_desc)); $content->parse("BLOCK_ADMIN"); } } else { $content->setVariable("LABEL_UNMODERATED", gettext("Group is unmoderated.")); } $html_handler_group->set_html_left($content->get()); $portal->set_page_main($html_handler_group->get_headline(), $html_handler_group->get_html(), ""); $portal->show_html();
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 . '&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; }
public function frameResponse(\FrameResponseObject $frameResponseObject) { $path = $this->params; $user = \lms_steam::get_current_user(); $public = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), STEAM_PUBLIC_GROUP, CLASS_GROUP); $id = $path[0]; try { $steam_group = !empty($id) ? \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $id) : FALSE; } catch (Exception $ex) { include "bad_link.php"; exit; } $html_handler_group = new \koala_html_group($steam_group); $html_handler_group->set_context("start"); $group_is_private = FALSE; if ($steam_group && is_object($steam_group)) { switch ((string) $steam_group->get_attribute("OBJ_TYPE")) { case "course": $group = new \koala_group_course($steam_group); // TODO: Passt der backlink? $backlink = PATH_URL . SEMESTER_URL . "/" . $group->get_semester()->get_name() . "/" . h($group->get_name()) . "/"; break; default: $group = new \koala_group_default($steam_group); // TODO: Passt der backlink? $backlink = PATH_URL . "groups/" . $group->get_id() . "/"; // Determine if group is public or private $parent = $group->get_parent_group(); if ($parent->get_id() == STEAM_PRIVATE_GROUP) { $group_is_private = TRUE; } break; } } if ($group_is_private) { if (!$steam_group->is_member($user) && !\lms_steam::is_koala_admin($user)) { throw new Exception(gettext("You have no rights to access this group"), E_USER_RIGHTS); } } if ($id != STEAM_PUBLIC_GROUP) { //TODO: Somethings wrong here... again a 404 error while loading koala_html_group /* $html_handler_group = new \koala_html_group( $group ); $html_handler_group->set_context( "start" ); */ $content = \Group::getInstance()->loadTemplate("group_start.template.html"); $content->setVariable("LABEL_DESCRIPTION", gettext("Description")); $desc = $group->get_attribute("OBJ_DESC"); if (empty($desc)) { $content->setVariable("OBJ_DESC", gettext("No description available.")); } else { $content->setVariable("OBJ_DESC", get_formatted_output($desc)); } $about = $group->get_attribute("OBJ_LONG_DSC"); if (!empty($about)) { $content->setCurrentBlock("BLOCK_ABOUT"); $content->setVariable("VALUE_ABOUT", get_formatted_output($about)); $content->parse("BLOCK_ABOUT"); } $content->setVariable("LABEL_ADMINS", gettext("Moderated by")); if ($group->get_maxsize() > 0) { $content->setCurrentBlock("BLOCK_GROUPSIZE"); $content->setVariable("LABEL_MAXSIZE_HEADER", gettext("The number of participants of this group is limited.")); $content->setVariable("LABEL_MAXSIZE_DESCRIPTION", str_replace("%MAX", $group->get_maxsize(), str_replace("%ACTUAL", $group->count_members(), gettext("The actual participant count is %ACTUAL of %MAX.")))); $content->parse("BLOCK_GROUPSIZE"); } $admins = $group->get_admins(); if (count($admins) > 0) { foreach ($admins as $admin) { $content->setCurrentBlock("BLOCK_ADMIN"); $admin_attributes = $admin->get_attributes(array("USER_FIRSTNAME", "USER_FULLNAME", "OBJ_ICON", "OBJ_DESC", "OBJ_NAME")); if ($admin instanceof \steam_user) { $content->setVariable("ADMIN_NAME", h($admin_attributes["USER_FIRSTNAME"]) . " " . h($admin_attributes["USER_FULLNAME"])); $content->setVariable("ADMIN_LINK", PATH_URL . "user/" . h($admin->get_name()) . "/"); } else { $content->setVariable("ADMIN_NAME", h($admin_attributes["OBJ_NAME"])); $content->setVariable("ADMIN_LINK", PATH_URL . "groups/" . $admin->get_id() . "/"); } $content->setVariable("ADMIN_ICON", PATH_URL . "cached/get_document.php?id=" . $admin_attributes["OBJ_ICON"]->get_id() . "&type=usericon&width=40&height=47"); $admin_desc = empty($admin_attributes["OBJ_DESC"]) ? "student" : $admin_attributes["OBJ_DESC"]; $content->setVariable("ADMIN_DESC", secure_gettext($admin_desc)); $content->parse("BLOCK_ADMIN"); } } else { $content->setVariable("LABEL_UNMODERATED", gettext("Group is unmoderated.")); } //TODO: Somethings wrong here... again a 404 error while loading koala_html_group //$html_handler_group->set_html_left( $content->get() ); // TODO: Portal...! //$portal->set_page_main( $html_handler_group->get_headline(), $html_handler_group->get_html() , "" ); //$portal->show_html(); } else { //TODO: Wann wird das hier aufgerufen?? $public = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), STEAM_PUBLIC_GROUP, CLASS_GROUP); $user = \lms_steam::get_current_user(); $content = \Group::getInstance()->loadTemplate("groups_public.template.html"); if (MANAGE_GROUPS_MEMBERSHIP || CREATE_GROUPS) { $content->setCurrentBlock("BLOCK_ACTION_BAR_GROUPS"); if (MANAGE_GROUPS_MEMBERSHIP) { $content->setCurrentBlock("BLOCK_MANAGE_GROUPS_MEMBERSHIP"); $content->setVariable("LINK_MANAGE_SUBSCRIPTIONS", PATH_URL . "user/" . $user->get_name() . "/groups/"); $content->setVariable("LABEL_MANAGE_SUBSCRIPTIONS", gettext("Manage subscriptions")); $content->parse("BLOCK_MANAGE_GROUPS_MEMBERSHIP"); } if (CREATE_GROUPS) { $content->setCurrentBlock("BLOCK_CREATE_GROUPS"); $content->setVariable("LINK_CREATE_NEW_GROUP", PATH_URL . "groups_create_dsc.php?parent=" . (isset($_GET["cat"]) ? $_GET["cat"] : $public->get_id())); $content->setVariable("LABEL_CREATE_NEW_GROUP", gettext("Create new group")); $content->parse("BLOCK_CREATE_GROUPS"); } $content->parse("BLOCK_ACTION_BAR_GROUPS"); } $content->setVariable("LABEL_NAME", gettext("Name")); $content->setVariable("LABEL_DESC", gettext("Description")); if (!empty($_GET["cat"])) { // EINE KATEGORIE ANZEIGEN if (!($category = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_GET["cat"]))) { include "bad_link.php"; exit; } if (!$category instanceof \steam_container) { include "bad_link.php"; exit; } $subgroups = $category->get_inventory(CLASS_GROUP); $content->setVariable("LABEL_ALL_CATEGORIES", str_replace(array("%i", "%NAME"), array(count($subgroups), $category->get_name()), gettext("%i groups in %NAME"))); $content->setVariable("LABEL_SUBGROUPS_MEMBERS", gettext("Members")); $tnr = array(); $attributes = array(OBJ_NAME, OBJ_DESC); $tnr = array(); $attributes = array(OBJ_NAME, OBJ_DESC); foreach ($subgroups as $subgroup) { $tnr[$subgroup->get_id()] = array(); $tnr[$subgroup->get_id()][OBJ_NAME] = $subgroup->get_attribute(OBJ_NAME, TRUE); $tnr[$subgroup->get_id()][OBJ_DESC] = $subgroup->get_attribute(OBJ_DESC, TRUE); $tnr[$subgroup->get_id()]["membercount"] = $subgroup->count_members(TRUE); } $result = $GLOBALS["STEAM"]->buffer_flush(); foreach ($subgroups as $subgroup) { $subgroup->set_value(OBJ_NAME, $result[$tnr[$subgroup->get_id()][OBJ_NAME]]); $subgroup->set_value(OBJ_DESC, $result[$tnr[$subgroup->get_id()][OBJ_DESC]]); } usort($subgroups, "sort_objects_new"); foreach ($subgroups as $subgroup) { $content->setCurrentBlock("BLOCK_CATEGORY_GROUP"); $content->setVariable("VALUE_LINK", PATH_URL . "groups/" . $subgroup->get_id() . "/"); $content->setVariable("VALUE_NAME", h($subgroup->get_name())); $content->setVariable("VALUE_SUBGROUPS_MEMBERS", $result[$subgroup->get_id()]["membercount"]); $content->setVariable("VALUE_DESC", h($subgroup->get_attribute("OBJ_DESC"))); $content->parse("BLOCK_CATEGORY_GROUP"); } $headline = array(array("link" => PATH_URL . "groups/", "name" => gettext("Public Groups")), array("link" => "", "name" => h($category->get_name()))); } else { // KATEGORIEN ANZEIGEN $categories = $public->get_workroom()->get_inventory(CLASS_ROOM | CLASS_CONTAINER); $content->setVariable("LABEL_ALL_CATEGORIES", str_replace("%i", count($categories), gettext("%i categories in Public Groups"))); $content->setVariable("LABEL_SUBGROUPS_MEMBERS", gettext("Groups")); if (count($categories) > 0) { $tnr = array(); $attributes = array(OBJ_NAME, OBJ_DESC); foreach ($categories as $category) { $tnr[$category->get_id()] = array(); $tnr[$category->get_id()]["attributes"] = $category->get_attributes($attributes, TRUE); $tnr[$category->get_id()]["inventory"] = $category->get_inventory_raw(CLASS_GROUP, TRUE); } $result = $GLOBALS["STEAM"]->buffer_flush(); foreach ($categories as $category) { $category->set_value(OBJ_NAME, $result[$tnr[$category->get_id()]["attributes"]][OBJ_NAME]); $category->set_value(OBJ_DESC, $result[$tnr[$category->get_id()]["attributes"]][OBJ_DESC]); } usort($categories, "sort_objects_new"); foreach ($categories as $category) { $content->setCurrentBlock("BLOCK_CATEGORY_GROUP"); $content->setVariable("VALUE_LINK", PATH_URL . "groups/?cat=" . $category->get_id()); $content->setVariable("VALUE_NAME", h($category->get_name())); $content->setVariable("VALUE_DESC", h($category->get_attribute(OBJ_DESC))); $subgroups = $result[$tnr[$category->get_id()]["inventory"]]; $no_subgroups = count($subgroups); if ($no_subgroups == 0) { $content->setVariable("VALUE_SUBGROUPS_MEMBERS", "-"); } else { $content->setVariable("VALUE_SUBGROUPS_MEMBERS", $no_subgroups); } $content->parse("BLOCK_CATEGORY_GROUP"); } } $headline = gettext("Public Groups"); } $portal->set_page_main($headline, $content->get(), ""); $portal->show_html(); } $html_handler_group->set_html_left($content->get()); $frameResponseObject->setTitle("Group"); $rawHtml = new \Widgets\RawHtml(); $rawHtml->setHtml($html_handler_group->get_html()); $frameResponseObject->addWidget($rawHtml); return $frameResponseObject; }
} } $content = new HTML_TEMPLATE_IT(PATH_TEMPLATES); $content->loadTemplateFile("rss_feeds_subscr.template.html"); $content->setVariable("INFO_SUBSCRIBED_FEEDS", gettext("Here are the feeds you subscribed to.") . " " . gettext("Feel free to cancel these subscriptions, if they become uninteresting for your daily work.")); $content->setVariable("LABEL_NAME", gettext("Feed")); $content->setVariable("LABEL_TYPE", gettext("Type")); $content->setVariable("LABEL_CONTEXT", gettext("Context")); $content->setVariable("LABEL_ACTION", gettext("Action")); if (!is_array($feeds) || count($feeds) == 0) { $content->setCurrentBlock("BLOCK_NOFEED"); $content->setVariable("LABEL_NOFEED", gettext("You have no subscriptions.")); $content->parse("BLOCK_NOFEED"); } else { while (list($id, $feed) = each($feeds)) { $content->setCurrentBlock("BLOCK_FEED"); $content->setVariable("FEED_LINK", $feed["link"]); $content->setVariable("FEED_NAME", $feed["name"]); $content->setVariable("FEED_TYPE", secure_gettext($feed["type"])); $content->setVariable("FEED_CONTEXT_NAME", $feed["context_name"]); $content->setVariable("FEED_CONTEXT_LINK", $feed["context_link"]); $content->setVariable("FEED_ID", $id); $content->parse("BLOCK_FEED"); } $content->setCurrentBlock("BLOCK_FEEDACTION"); $content->setVariable("LABEL_UNSUBSCRIBE", gettext("Unsubscribe")); $content->parse("BLOCK_FEEDACTION"); } $portal->set_page_title("News Subscriptions"); $portal->set_page_main(array(array("link" => PATH_URL . "desktop/news/", "name" => gettext("News")), array("link" => "", "name" => gettext("Your Subscriptions"))), $content->get()); $portal->show_html();
public function frameResponse(\FrameResponseObject $frameResponseObject) { $path = $this->params; $user = \lms_steam::get_current_user(); $public = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), STEAM_PUBLIC_GROUP, CLASS_GROUP); $id = $path[0]; $portal = \lms_portal::get_instance(); $portal_user = $portal->get_user(); try { $steam_group = !empty($id) ? \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $id) : FALSE; } catch (\Exception $ex) { include "bad_link.php"; exit; } $group_is_private = FALSE; if ($steam_group && is_object($steam_group)) { switch ((string) $steam_group->get_attribute("OBJ_TYPE")) { case "course": $group = new \koala_group_course($steam_group); // TODO: Passt der backlink? $backlink = PATH_URL . SEMESTER_URL . "/" . $group->get_semester()->get_name() . "/" . h($group->get_name()) . "/"; break; default: $group = new \koala_group_default($steam_group); // TODO: Passt der backlink? $backlink = PATH_URL . "groups/" . $group->get_id() . "/"; // Determine if group is public or private $parent = $group->get_parent_group(); if ($parent->get_id() == STEAM_PRIVATE_GROUP) { $group_is_private = TRUE; } break; } } if ($group_is_private) { if (!$steam_group->is_member($user) && !\lms_steam::is_koala_admin($user)) { throw new \Exception(gettext("You have no rights to access this group"), E_USER_RIGHTS); } } if (!$group instanceof \koala_group) { throw new \Exception("Variable group not set."); } if (COURSE_PARTICIPANTS_STAFF_ONLY && !$group->is_admin($user)) { header("location:../"); exit; } if ($_SERVER["REQUEST_METHOD"] == "POST") { if (is_array($_POST["remove"])) { $id = key($_POST["remove"]); $member_to_kick = \steam_factory::username_to_object($GLOBALS["STEAM"]->get_id(), $id); $group->remove_member($member_to_kick); $portal->set_confirmation(str_replace("%NAME", h($member_to_kick->get_attribute("USER_FIRSTNAME")) . " " . h($member_to_kick->get_attribute("USER_FULLNAME")), gettext("User %NAME successfully removed from group members."))); // clear caches: $cache = get_cache_function($member_to_kick->get_name()); $cache->drop("lms_steam::user_get_groups", $member_to_kick->get_name(), TRUE); $cache->drop("lms_steam::user_get_groups", $member_to_kick->get_name(), FALSE); $cache->drop("lms_steam::user_get_profile", $member_to_kick->get_name()); $cache->drop("lms_portal::get_menu_html", $member_to_kick->get_name(), TRUE); $cache = get_cache_function($group->get_id()); $cache->drop("lms_steam::group_get_members", $group->get_id()); } } $cache = get_cache_function($group->get_id(), CACHE_LIFETIME_STATIC); switch (get_class($group)) { case "koala_group_course": $html_handler_group = new \koala_html_course($group); $html_handler_group->set_context("members"); $members = $cache->call("lms_steam::group_get_members", $group->steam_group_learners->get_id()); break; default: $html_handler_group = new \koala_html_group($group); $html_handler_group->set_context("members"); $members = $cache->call("lms_steam::group_get_members", $group->get_id()); break; } $is_admin = $group->is_admin($user); $content = \Group::getInstance()->loadTemplate("list_users.template.html"); $is_member = $group->is_member($user); //echo "is_member? " . $is_member; $privacy_deny_participants = $group->get_attribute("GROUP_PRIVACY"); //echo "attribute: ''" . $privacy_deny_participants . "''"; if ($privacy_deny_participants == PERMISSION_GROUP_PRIVACY_DENY_PARTICIPANTS && !$is_member) { //echo "*** deny ***"; //TODO $content->setVariable("LABEL_PRIVACY_DENY_PARTICIPANTS", gettext("Participants are hidden.")); } else { //echo "*** permit ***"; $no_members = count($members); if ($no_members > 0) { switch (get_class($group)) { case "koala_group_course": $groupname = $group->get_course_id(); break; default: $groupname = $group->get_name(); break; } if (!USER_LIST_NO_PAGEING) { $paginator = \lms_portal::get_paginator(10, $no_members, "(" . str_replace("%NAME", h($groupname), gettext("%TOTAL members in %NAME")) . ")"); $start = $paginator["startIndex"]; $end = $start + 10 > $no_members ? $no_members : $start + 10; $content->setVariable("PAGINATOR", $paginator["html"]); $content->setVariable("LABEL_CONTACTS", gettext("Members") . " (" . str_replace(array("%a", "%z", "%s"), array($start + 1, $end, $no_members), gettext("%a-%z out of %s")) . ")"); } else { //if (count($members) > 10) { $content->setVariable("LABEL_CONTACTS", gettext("Members") . " (Anzahl " . count($members) . ")"); $content->setCurrentBlock("BLOCK_FILTER"); $content->setVariable("HELP_TEXT", "Benutzer lassen sich einfacher finden, indem Sie den Filter verwenden. Tippen Sie einfach einen Teil des Benutzernamen oder der Benutzerkennung in das Textfeld."); $content->setVariable('LABEL_FILTER', "<b>" . gettext('Filter') . "</b>"); $start = 0; $end = count($members); if (COURSE_PARTICIPANTS_EXTENSIONS) { $extensions = $group->get_extensions(); $html = ""; foreach ($extensions as $extension) { $html .= $extension->get_filter_html($portal, "filter_user", "extension_data"); } $content->setCurrentBlock("BLOCK_EXTENSION_FILTER"); $content->setVariable("EXTENSION_FILTER", $html); $content->parse("BLOCK_EXTENSION_FILTER"); } $content->parse("BLOCK_FILTER"); //} } $content->setCurrentBlock("BLOCK_CONTACT_LIST"); $content->setVariable("LABEL_NAME_POSITION", gettext("Name, position")); !COURSE_PARTICIPANTS_FACULTY_AND_FOCUS or $content->setVariable("LABEL_SUBJECT_AREA", gettext("Origin/Focus")); !COURSE_PARTICIPANTS_COMMUNICATION or $content->setVariable("LABEL_COMMUNICATION", gettext("Communication")); if (\lms_steam::is_koala_admin($user) || !COURSE_KOALAADMIN_ONLY && $is_admin) { !COURSE_PARTICIPANTSLIST_MANAGE or $content->setVariable("TH_MANAGE_CONTACT", gettext("Action")); } !COURSE_PARTICIPANTS_EXTENSIONS or $content->setVariable("TH_MANAGE_EXTENSIONS", "Status"); $content->setVariable("BEGIN_HTML_FORM", "<form method=\"POST\" action=\"\">"); $content->setVariable("END_HTML_FORM", "</form>"); for ($i = $start; $i < $end; $i++) { $member = $members[$i]; if ($member["USER_TRASHED"] === 1) { continue; } $content->setCurrentBlock("BLOCK_CONTACT"); $content->setVariable("CONTACT_LINK", PATH_URL . "user/" . h($member["OBJ_NAME"]) . "/"); // TODO: Passt der link? $icon_link = $member["OBJ_ICON"] == 0 ? PATH_STYLE . "images/anonymous.jpg" : PATH_URL . "cached/get_document.php?id=" . h($member["OBJ_ICON"]) . "&type=usericon&width=30&height=40"; $content->setVariable("CONTACT_IMAGE", $icon_link); $title = !empty($member["USER_ACADEMIC_TITLE"]) ? h($member["USER_ACADEMIC_TITLE"]) . " " : ""; $content->setVariable("CONTACT_NAME", $title . h($member["USER_FIRSTNAME"]) . " " . h($member["USER_FULLNAME"])); !COURSE_PARTICIPANTS_COMMUNICATION or $content->setVariable("LINK_SEND_MESSAGE", PATH_URL . "messages_write.php?to=" . h($member["OBJ_NAME"])); !COURSE_PARTICIPANTS_COMMUNICATION or $content->setVariable("LABEL_MESSAGE", gettext("Message")); !COURSE_PARTICIPANTS_COMMUNICATION or $content->setVariable("LABEL_SEND", gettext("Send")); !COURSE_PARTICIPANTS_FACULTY_AND_FOCUS or $content->setVariable("FACULTY_AND_FOCUS", h($member["USER_PROFILE_FACULTY"])); if (\lms_steam::is_koala_admin($user) || !COURSE_KOALAADMIN_ONLY && $is_admin) { !COURSE_PARTICIPANTSLIST_MANAGE or $content->setVariable("TD_MANAGE_CONTACT", "<td align=\"center\"><input type=\"submit\" name=\"remove[" . h($member["OBJ_NAME"]) . "]\" value=\"" . gettext("Remove") . "\"/></td>"); } if (COURSE_PARTICIPANTS_EXTENSIONS) { $extensions = $group->get_extensions(); $result = ""; foreach ($extensions as $extension) { $result .= $extension->get_member_info(\steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $member["OBJ_NAME"]), $group); } $content->setVariable("EXTENSIONS_DATA", $result); } $member_desc = empty($member["OBJ_DESC"]) ? "student" : $member["OBJ_DESC"]; $status = secure_gettext($member_desc); $content->setVariable("OBJ_DESC", h($status) . " " . ($i + 1)); $content->parse("BLOCK_CONTACT"); } $content->parse("BLOCK_CONTACT_LIST"); } else { $content->setVariable("LABEL_NO_MEMBERS", gettext("No members found.")); } } $html_handler_group->set_html_left($content->get()); $frameResponseObject->setTitle("Group"); $rawHtml = new \Widgets\RawHtml(); $rawHtml->setHtml($html_handler_group->get_html()); $frameResponseObject->addWidget($rawHtml); return $frameResponseObject; }
$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 = 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()); $portal->set_page_main($html_handler_profile->get_headline(), $html_handler_profile->get_html(), "vcard");
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(); }