public function __construct($steam_user) { if (!$steam_user instanceof steam_user) { throw new Exception("not a user", E_PARAMETER); } parent::__construct(PATH_EXTENSIONS . "content/profile/ui/html/user_profile.template.html"); $this->steam_user = $steam_user; $this->networking_profile = new lms_networking_profile($steam_user); $this->networking_profile->count_profile_visit(lms_steam::get_current_user()); $cache = get_cache_function($steam_user->get_name(), 86400); $user_profile = $cache->call("lms_steam::user_get_profile", $steam_user->get_name()); $itemId = $user_profile["OBJ_ICON"]; $icon_link = $user_profile["OBJ_ICON"] == 0 ? PATH_STYLE . "images/anonymous.jpg" : PATH_URL . "download/image/" . $itemId . "/140/185"; //$icon_link = ( $user_profile[ "OBJ_ICON" ] == 0 ) ? PATH_STYLE . "images/anonymous.jpg" : PATH_URL . "cached/get_document.php?id=" . $user_profile[ "OBJ_ICON" ] . "&type=usericon&width=140&height=185"; $this->template->setVariable("USER_IMAGE", $icon_link); $this->template->setVariable("GIVEN_NAME", $user_profile["USER_FIRSTNAME"]); $this->template->setVariable("FAMILY_NAME", $user_profile["USER_FULLNAME"]); if (!empty($user_profile["USER_ACADEMIC_TITLE"])) { $this->template->setVariable("ACADEMIC_TITLE", $user_profile["USER_ACADEMIC_TITLE"]); } if (!empty($user_profile["USER_ACADEMIC_DEGREE"])) { $this->template->setVariable("ACADEMIC_DEGREE", "(" . $user_profile["USER_ACADEMIC_DEGREE"] . ")"); } $user = lms_steam::get_current_user(); if (lms_steam::is_koala_admin($user)) { $this->template->setVariable("LABEL_LAST_LOGIN", gettext("last login") . ":"); $this->template->setVariable("LABEL_PAGE_HITS", gettext("page hits") . ":"); $this->template->setVariable("LAST_LOGIN", how_long_ago($user_profile["USER_LAST_LOGIN"])); $this->template->setVariable("PAGE_HITS", $this->networking_profile->get_profile_visits()); } }
public function __construct($template, $path = "", $context = "") { parent::__construct($template); $this->path = $path; $this->set_context($this->generate_context($context)); $this->set_content(); }
public function __construct($templateName) { // Name of the template to load $this->templateName = $templateName; // Get current user ID and set rights $currentUserID = $GLOBALS["STEAM"]->get_current_steam_user()->get_id(); $this->isCustomerAdmin = $GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->isCustomerAdmin($currentUserID); $this->isAdmin = $GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->isAdmin($currentUserID); parent::__construct(PATH_TEMPLATES . "usermanagement/" . $templateName . ".template.html"); }
public function set_context($context, $params = array()) { parent::set_context($context, array_merge($params, array("owner" => $this->course))); }