Get all the assets filtered by a group and if to include the raw assets.

@param  string  $group
@param  bool  $raw
@return \Illuminate\Support\Collection
436704
public function getAssets($group = null, $raw = true)
    {
        // Spin through all of the assets that belong to the given group and push them on
        // to the end of the array.
        $assets = clone $this->directory->getAssets();

        foreach ($assets as $key => $asset)
        {
            if ( ! $raw and $asset->isRaw() or ! is_null($group) and ! $asset->{'is'.ucfirst(str_singular($group))}())
            {
                $assets->forget($key);
            }
        }

        // Spin through each of the assets and build an ordered array of assets. Once
        // we have the ordered array we'll transform it into a collection and apply
        // the collection wide filters to each asset.
        $ordered = array();

        foreach ($assets as $asset)
        {
            $this->orderAsset($asset, $ordered);
        }

        return new \Illuminate\Support\Collection($ordered);
    }
784576
public function filterByGroup($group = '', $inGroup = true)
    {
        if (!($group instanceof \Concrete\Core\User\Group\Group)) {
            $group = \Concrete\Core\User\Group\Group::getByName($group);
        }
        $this->checkGroupJoin();
        $app = Application::getFacadeApplication();
        /** @var $likeBuilder LikeBuilder */
        $likeBuilder = $app->make(LikeBuilder::class);
        $query = $this->getQueryObject()->getConnection()->createQueryBuilder();
        $orX = $this->getQueryObject()->expr()->orX();
        $query->select('u.uID')->from('Users','u')
            ->leftJoin('u','UserGroups','ug','u.uID=ug.uID')
            ->leftJoin('ug', $query->getConnection()->getDatabasePlatform()->quoteSingleIdentifier('Groups'), 'g', 'ug.gID=g.gID');
        $orX->add($this->getQueryObject()->expr()->like('g.gPath', ':groupPath_'.$group->getGroupID()));
        $this->getQueryObject()->setParameter('groupPath_'.$group->getGroupID(),$likeBuilder->escapeForLike($group->getGroupPath()). '/%');
        $orX->add($this->getQueryObject()->expr()->eq('g.gID', $group->getGroupID()));
        $query->where($orX);
        if ($inGroup) {
            $this->getQueryObject()->andWhere($this->getQueryObject()->expr()->in('u.uID', $query->getSQL()));
        } else {
            $this->getQueryObject()->andWhere($this->getQueryObject()->expr()->notIn('u.uID', $query->getSQL()));
        }

    }
87747
public function viewAction(Group $group)
    {
        $table = $this->createAdminTable('ucms_group');

        $table
            ->addHeader($this->t("Information"), 'basic')
            ->addRow($this->t("Title"), $group->getTitle())
            ->addRow($this->t("Identifier"), $group->getId())
        ;

        $this->addArbitraryAttributesToTable($table, $group->getAttributes());

        return $table->render();
    }
541413
public function render(Group $group)
    {
        if ($group->isAuthorized()) {
            $items = [];
            foreach ($group->getItems() as $item) {
                $items[] = (new IlluminateItemRenderer($this->factory))->render($item);
            }

            return $this->factory->make($this->view, [
                'group' => $group,
                'items' => $items
            ])->render();
        }
    }
907110
public static function getIcons($group=null)
	{
		$key = $GLOBALS['BOOTSTRAP']['icons']['active'];

		// load icons if not done so far
		if(!isset($GLOBALS['BOOTSTRAP']['icons']['sets'][$key]['icons']))
		{
			if (TL_MODE == 'BE') {
				if (isset($GLOBALS['BOOTSTRAP']['icons']['sets'][$key]['stylesheet'])) {
					foreach ((array) $GLOBALS['BOOTSTRAP']['icons']['sets'][$key]['stylesheet'] as $stylesheet) {
						$GLOBALS['TL_CSS'][] = $stylesheet;
					}
				}
			}

			$GLOBALS['BOOTSTRAP']['icons']['sets'][$key]['icons'] =
				include TL_ROOT . '/' . $GLOBALS['BOOTSTRAP']['icons']['sets'][$key]['path'];
		}

		// get all icons
		if($group === null)
		{
			return $GLOBALS['BOOTSTRAP']['icons']['sets'][$key]['icons'];
		}

		// get all icons as flat array
		elseif($group === true)
		{
			if(self::$flatIcons === null) {
				$icons = array();

				foreach ($GLOBALS['BOOTSTRAP']['icons']['sets'][$key]['icons'] as $groupIcons)
				{
					$icons = array_merge($icons, $groupIcons);
				}

				self::$flatIcons = $icons;
			}

			return self::$flatIcons;
		}

		return $GLOBALS['BOOTSTRAP']['icons']['sets'][$key]['icons'];
	}
416375
public function setActualFields($group = UNDEFINED)
    {
        if (is_array($group)) {
            $this->actual_fields = $group;

            return $this;
        }
        if ($group === UNDEFINED) {
            $group = 'all';
        }
        $this->actual_fields = $this->getGroupField($group);

        return $this;
    }
113029
public function clearGroup($group)
    {
        $this->_File = null;

        $prefix = (string)$this->_config['prefix'];

        $directoryIterator = new RecursiveDirectoryIterator($this->_config['path']);
        $contents = new RecursiveIteratorIterator(
            $directoryIterator,
            RecursiveIteratorIterator::CHILD_FIRST
        );
        $filtered = new CallbackFilterIterator(
            $contents,
            function (SplFileInfo $current) use ($group, $prefix) {
                if (!$current->isFile()) {
                    return false;
                }

                $hasPrefix = $prefix === ''
                    || strpos($current->getBasename(), $prefix) === 0;
                if ($hasPrefix === false) {
                    return false;
                }

                $pos = strpos(
                    $current->getPathname(),
                    DIRECTORY_SEPARATOR . $group . DIRECTORY_SEPARATOR
                );

                return $pos !== false;
            }
        );
        foreach ($filtered as $object) {
            $path = $object->getPathname();
            $object = null;
            // @codingStandardsIgnoreLine
            @unlink($path);
        }

        return true;
    }
605616
public function tagsWithGroup(string $group = null): Collection
    {
        return $this->tags->filter(function (Tag $tag) use ($group) {
            return $tag->group === $group;
        });
    }
966412
public function getRuleResultsByGroup($group)
    {
        $results = [];
        foreach ($this->getRuleResults() as $rule => $ruleResult) {
            if (in_array($group, $ruleResult->getGroups())) {
                $results[$rule] = $ruleResult;
            }
        }

        return $results;
    }
22538
public static function css($stylesheets = array(), $attr = array(), $group = NULL, $raw = false)
	{
		return static::instance()->css($stylesheets, $attr, $group, $raw);
	}
161607
public function retrieveAll($raw = false)
    {
        if ($cache = $this->loadCache()) {
            if (!$raw) {
                $results = [];
                foreach ($cache as $key => $value) {
                    $results[$key] = unserialize($value['data']);
                }
                return $results;
            } else {
                return $cache;
            }
        }
        return null;
    }
524418
public function retrieveGroup($group)
    {
        $result = array();

        foreach (Profiler::$_samples as $record) {
            if ($record[3] == $group) {
                $result[] = $record;
            }
        }

        return $result;
    }
490450
public function renderCss($assets, $group, $attributes = [])
    {
        // temporary list of assets to pipeline
        $inline_group = false;

        if (array_key_exists('loading', $attributes) && $attributes['loading'] === 'inline') {
            $inline_group = true;
            unset($attributes['loading']);
        }

        // Store Attributes
        $this->attributes = array_merge(['type' => 'text/css', 'rel' => 'stylesheet'], $attributes);

        // Compute uid based on assets and timestamp
        $json_assets = json_encode($assets);
        $uid = md5($json_assets . $this->css_minify . $this->css_rewrite . $group);
        $file = $uid . '.css';
        $relative_path = "{$this->base_url}{$this->assets_url}/{$file}";

        $buffer = null;

        if (file_exists($this->assets_dir . $file)) {
            $buffer = file_get_contents($this->assets_dir . $file) . "\n";
        } else {
            //if nothing found get out of here!
            if (empty($assets)) {
                return false;
            }

            // Concatenate files
            $buffer = $this->gatherLinks($assets, self::CSS_ASSET);

            // Minify if required
            if ($this->shouldMinify('css')) {
                $minifier = new \MatthiasMullie\Minify\CSS();
                $minifier->add($buffer);
                $buffer = $minifier->minify();
            }

            // Write file
            if (trim($buffer) !== '') {
                file_put_contents($this->assets_dir . $file, $buffer);
            }
        }

        if ($inline_group) {
            $output = "<style>\n" . $buffer . "\n</style>\n";
        } else {
            $this->asset = $relative_path;
            $output = '<link href="' . $relative_path . $this->renderQueryString() . '"' . $this->renderAttributes() . ">\n";
        }

        return $output;
    }
542851
protected function renderAsset(Asset $asset, $group)
    {
        return $asset->isInline() ? $this->renderInline($asset, $group) : $this->renderExternal($asset, $group);
    }
1154207
public static function getInstance($group)
	{
		static $instances;

		// Set instances array
		if (!isset($instances))
		{
			$instances = array();
		}

		// Do we have a matching instance?
		if (!isset($instances[$group]))
		{
			// If an ID is passed, check for a match in existing instances
			if (is_numeric($group))
			{
				foreach ($instances as $instance)
				{
					if ($instance && $instance->get('gidNumber') == $group)
					{
						// Match found
						return $instance;
						break;
					}
				}
			}

			// No matches
			// Create group object
			$hzg = new self();

			if ($hzg->read($group) === false)
			{
				$instances[$group] = false;
			}
			else
			{
				$instances[$group] = $hzg;
			}
		}

		// Return instance
		return $instances[$group];
	}
158967
public function addGroup($group)
    {
        if (null === $this->groups) {
            $this->groups = [];
        }
        if (!in_array($group, $this->groups)) {
            $this->groups[] = $group;
        }

        return $this;
    }
583235
public static function selectRandomResource ($group)
	{
		
		// If the resource group is not set
		
		if (!isset (self::$resources[$group]))
		{
			
			// Return FALSE
			
			$bln = FALSE;
			return $bln;
			
		}
		
		// Return random resource name
		
		return array_rand (self::$resources[$group]);
		
	}