Returns effective groupmode of the module that may be overwritten by forced course groupmode.

@return int one of constants NOGROUPS, SEPARATEGROUPS, VISIBLEGROUPS
489037
private function get_effective_groupmode() {
        $groupmode = $this->groupmode;
        if ($this->modinfo->get_course()->groupmodeforce) {
            $groupmode = $this->modinfo->get_course()->groupmode;
            if ($groupmode != NOGROUPS && !plugin_supports('mod', $this->modname, FEATURE_GROUPS, false)) {
                $groupmode = NOGROUPS;
            }
        }
        return $groupmode;
    }
693609
private function findMostRelevantGroupId()
    {
        if ($this->siteManager->hasDependentContext('group')) {

            /** @var \MakinaCorpus\Ucms\Site\Group $group */
            $group = $this->siteManager->getDependentContext('group');

            if ($group) {
                return (int)$group->getId();
            }
        }

        // There is no context, this means we need to check with user current
        // groups instead; and set the first one we find onto the node
        $accessList = $this->groupManager->getUserGroups($this->currentUser);
        if ($accessList) {
            return (int)reset($accessList)->getGroupId();
        }
    }
721639
public static function map()
    {
        $permissions = [];

        foreach (static::get() as $permission) {
            $permissions[$permission->permission][] = (string) $permission->group_id;
        }

        return $permissions;
    }
302477
protected function getVisibleGroupedComponents()
    {
        $componentGroupsBuilder = ComponentGroup::query();
        if (!$this->guard->check()) {
            $componentGroupsBuilder->visible();
        }

        $usedComponentGroups = Component::grouped()->pluck('group_id');

        return $componentGroupsBuilder->used($usedComponentGroups)
            ->get();
    }
1307387
protected function getAvailableModules()
    {
        $removeModules = array('MelisInstaller', 'MelisSites', 'MelisAssetManager', 'MelisDesign');
        $availableModules = $this->getModuleSvc()->getAllModules();
        $modules = array();

        $mm            = $this->getServiceLocator()->get('ModuleManager');
        $activeModules = array_keys($mm->getLoadedModules());

        foreach ($availableModules as $module) {
            if (!in_array($module, $removeModules)) {
                if(in_array($module, $activeModules)) {
                    $modules[] = $module;
                }

            }
        }
        return $modules;
    }
222390
public function getGroupedAttributes()
    {
        return array(
            AbstractVoter::GROUP_USER => array(
                self::VIEW,
                self::CREATE_POST,
                self::CREATE_TOPIC,
                self::UPLOAD_FILE
            ),
            AbstractVoter::GROUP_MOD => array(
                self::EDIT_POST,
                self::EDIT_TOPIC,
                self::DELETE_POST,
                self::DELETE_TOPIC,
                self::MOVE_POST,
                self::MOVE_TOPIC,
                self::SPLIT_TOPIC,
            )
        );
    }
1353508
public function getGroup() : ?string 
    {
        if ( ! $this->hasGroup()) {
            $this->setGroup($this->getDefaultGroup());
        }
        return $this->group;
    }
283476
public function getGroup()
    {
        if (-1 === $this->index || !$this->valid()) {
            return null;
        }

        return $this->processors[$this->index][1]['group'] ?? null;
    }
88508
public function get_all_groups() {
        if ($this->_groups === null) {
            $this->_groups = groups_get_all_groups($this->course->id);
            foreach ($this->_groups as $gid=>$group) {
                $this->_groups[$gid]->name = format_string($group->name);
            }
        }
        return $this->_groups;
    }
656000
public function getBackendDisplayMode(): string
    {
        $backendDisplayMode = $this->get('backendDisplayMode');
        $validModes = ['current', 'childs', 'both'];
        if (!\in_array($backendDisplayMode, $validModes, true)) {
            $backendDisplayMode = 'current';
        }

        return $backendDisplayMode;
    }
80919
private function getGroupPath() : string
    {
        $path = '';

        foreach ($this->groupOptionsStack as $groupOptions) {
            if (isset($groupOptions['path'])) {
                $path .= $groupOptions['path'];
            }
        }

        return $path;
    }
1363662
public function getDirMode()
    {
        $dirMode = $this->get('dir-mode', 0777);
        $dirMode = is_string($dirMode) ? octdec($dirMode) : $dirMode;

        return $dirMode;
    }
1276309
public function get_course_module() {
        if ($this->coursemodule) {
            return $this->coursemodule;
        }
        if (!$this->context) {
            return null;
        }

        if ($this->context->contextlevel == CONTEXT_MODULE) {
            $modinfo = get_fast_modinfo($this->get_course());
            $this->coursemodule = $modinfo->get_cm($this->context->instanceid);
            return $this->coursemodule;
        }
        return null;
    }
26934
private function Groups()
    {
        if ($this->groups === null)
        {
            $this->groups = array();
            if ($this->GetMember())
            {
                $this->groups = MembergroupUtil::MemberMembergroups($this->GetMember());
            }
        }
        return $this->groups;
    }
315837
public function get_groups_info() {

        if ($this->cachegroups !== null) {
            return $this->cachegroups;
        }

        $groups = [];

        foreach (core_filetypes::get_types() as $ext => $info) {
            if (isset($info['groups']) && is_array($info['groups'])) {
                foreach ($info['groups'] as $group) {
                    if (!isset($groups[$group])) {
                        $groups[$group] = (object) [
                            'extensions' => [],
                            'mimetypes' => [],
                        ];
                    }
                    $groups[$group]->extensions['.'.$ext] = true;
                    if (isset($info['type'])) {
                        $groups[$group]->mimetypes[$info['type']] = true;
                    }
                }
            }
        }

        foreach ($groups as $group => $info) {
            $info->extensions = array_keys($info->extensions);
            $info->mimetypes = array_keys($info->mimetypes);
        }

        $this->cachegroups = $groups;
        return $this->cachegroups;
    }
1343990
protected function _getModuleFilter() {
        $args   = $this->getArgs();
        $only   = self::FILTER_MODULE_COMMAND;

        if (!array_key_exists($only, $args)) {
            return;
        }

        $filter = $args[$only];
        return strtolower($filter);
    }
607328
private function getGroups()
    {
        if ($this->_groups === null) {
            $this->_groups = Group::find()->all();
        }

        return $this->_groups;
    }