public function __construct($steam_group) { parent::__construct($steam_group); $tnr = array(); $tnr["groupname"] = $steam_group->get_groupname(TRUE); $tnr["name"] = $steam_group->get_name(TRUE); $tnr["OBJ_TYPE"] = $steam_group->get_attribute(OBJ_TYPE, TRUE); $tnr["parentgroup"] = $steam_group->get_parent_group(TRUE); $result = $GLOBALS["STEAM"]->buffer_flush(); $name = $result[$tnr["name"]]; $groupname = $result[$tnr["groupname"]]; $vars["parentgroup"] = $result[$tnr["parentgroup"]]; $vars["OBJ_TYPE"] = $result[$tnr["OBJ_TYPE"]]; $course_group = self::get_course_group($steam_group, $vars); if (is_object($course_group)) { $steam_group = $course_group; } parent::__construct($steam_group); if (!is_object($this->steam_group_staff = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $groupname . ".staff"))) { throw new Exception("Subgroup staff not found in course " . $name . "/" . $steam_group->get_id()); } if (!is_object($this->steam_group_learners = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $groupname . ".learners"))) { throw new Exception("Subgroup learners not found in course " . $name); } $this->steam_group_admins = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $groupname . ".admins"); // don't complain about missing admins group, since old courses don't have an admins subgroup... $this->steam_group_semester = $result[$tnr["parentgroup"]]; }
public function __construct($tutorial_steam_group) { parent::__construct($tutorial_steam_group); $this->tutorial_no = $tutorial_steam_group->get_attribute("OBJ_NAME"); $this->max_learners = $tutorial_steam_group->get_attribute("GROUP_MAXSIZE") != 0 ? $tutorial_steam_group->get_attribute("GROUP_MAXSIZE") : $tutorial_steam_group->get_attribute("TUTORIAL_MAX_LEARNERS"); $this->tutor = $tutorial_steam_group->get_attribute("TUTORIAL_TUTOR"); $this->short_desc = $tutorial_steam_group->get_attribute("OBJ_DESC"); $this->long_desc = $tutorial_steam_group->get_attribute("TUTORIAL_LONG_DESC"); $this->steam_group_semester = $tutorial_steam_group->get_parent_group()->get_parent_group()->get_parent_group(); $this->steam_group_course = $tutorial_steam_group->get_parent_group()->get_parent_group(); $this->steam_group_course_staff = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $this->steam_group_course->get_groupname() . ".staff"); $this->steam_group_course_learners = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $this->steam_group_course->get_groupname() . ".learners"); }