original_string: protected function setup_groups() {
          // find out current groups mode
          if ($this->groupmode = groups_get_course_groupmode($this->course)) {
              if (empty($this->gpr->groupid)) {
                  $this->currentgroup = groups_get_course_group($this->course, true);
              } else {
                  $this->currentgroup = $this->gpr->groupid;
              }
              $this->group_selector = groups_print_course_menu($this->course, $this->pbarurl, true);
  
              if ($this->groupmode == SEPARATEGROUPS and !$this->currentgroup and !has_capability('moodle/site:accessallgroups', $this->context)) {
                  $this->currentgroup = -2; // means can not access any groups at all
              }
              if ($this->currentgroup) {
                  $group = groups_get_group($this->currentgroup);
                  $this->currentgroupname     = $group->name;
                  $this->groupsql             = " JOIN {groups_members} gm ON gm.userid = u.id ";
                  $this->groupwheresql        = " AND gm.groupid = :gr_grpid ";
                  $this->groupwheresql_params = array('gr_grpid'=>$this->currentgroup);
              }
          }
      }
code: protected function setup_groups() {
          // find out current groups mode
          if ($this->groupmode = groups_get_course_groupmode($this->course)) {
              if (empty($this->gpr->groupid)) {
                  $this->currentgroup = groups_get_course_group($this->course, true);
              } else {
                  $this->currentgroup = $this->gpr->groupid;
              }
              $this->group_selector = groups_print_course_menu($this->course, $this->pbarurl, true);
  
              if ($this->groupmode == SEPARATEGROUPS and !$this->currentgroup and !has_capability('moodle/site:accessallgroups', $this->context)) {
                  $this->currentgroup = -2; // means can not access any groups at all
              }
              if ($this->currentgroup) {
                  $group = groups_get_group($this->currentgroup);
                  $this->currentgroupname     = $group->name;
                  $this->groupsql             = " JOIN {groups_members} gm ON gm.userid = u.id ";
                  $this->groupwheresql        = " AND gm.groupid = :gr_grpid ";
                  $this->groupwheresql_params = array('gr_grpid'=>$this->currentgroup);
              }
          }
      }
code_tokens: protected function setup_groups ( ) { // find out current groups mode if ( $ this -> groupmode = groups_get_course_groupmode ( $ this -> course ) ) { if ( empty ( $ this -> gpr -> groupid ) ) { $ this -> currentgroup = groups_get_course_group ( $ this -> course , true ) ; } else { $ this -> currentgroup = $ this -> gpr -> groupid ; } $ this -> group_selector = groups_print_course_menu ( $ this -> course , $ this -> pbarurl , true ) ; if ( $ this -> groupmode == SEPARATEGROUPS and ! $ this -> currentgroup and ! has_capability ( 'moodle/site:accessallgroups' , $ this -> context ) ) { $ this -> currentgroup = - 2 ; // means can not access any groups at all } if ( $ this -> currentgroup ) { $ group = groups_get_group ( $ this -> currentgroup ) ; $ this -> currentgroupname = $ group -> name ; $ this -> groupsql = " JOIN {groups_members} gm ON gm.userid = u.id " ; $ this -> groupwheresql = " AND gm.groupid = :gr_grpid " ; $ this -> groupwheresql_params = array ( 'gr_grpid' => $ this -> currentgroup ) ; } } }
docstring: Sets up this object's group variables, mainly to restrict the selection of users to display.
docstring_tokens: Sets up this object s group variables mainly to restrict the selection of users to display .