Example #1
0
 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());
     }
 }
Example #2
0
 public function __construct($template, $path = "", $context = "")
 {
     parent::__construct($template);
     $this->path = $path;
     $this->set_context($this->generate_context($context));
     $this->set_content();
 }
Example #3
0
 public function __construct($course)
 {
     if (!$course instanceof koala_group_course) {
         throw new Exception("not a group", E_PARAMETER);
     }
     $this->course = $course;
     parent::__construct(PATH_EXTENSIONS . "content/course/ui/html/group_profile.template.html");
 }
 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");
 }
Example #5
0
 public function __construct($group)
 {
     if ($group instanceof koala_group) {
         $this->koala_group = $group;
     } else {
         if ($group instanceof steam_group) {
             $this->koala_group = new koala_group_default($group);
         } else {
             throw new Exception("'group' param is not koala_group or steam_group", E_PARAMETER);
         }
     }
     parent::__construct(PATH_EXTENSIONS . "content/group/ui/html/" . "group_profile.template.html");
 }
Example #6
0
 public function __construct($user)
 {
     if ($user instanceof steam_user) {
         $this->koala_user = new koala_user($user);
     } else {
         if ($user instanceof koala_user) {
             $this->koala_user = $user;
         } else {
             throw new Exception("'user' param is not a koala_user or steam_user", E_PARAMETER);
         }
     }
     parent::__construct(PATH_TEMPLATES . "user.template.html");
 }